Create a New Deal Direction crm.dealcategory.add

Choose a tool for developing with an AI agent:

  • use Alaio Vibecode to build an app for Bitrix24 from a task description without knowing any programming language. The agent writes the code and deploys the app to a server, with no manual hosting setup
  • use the MCP server to develop a REST API integration in your own project. The agent refers to the official REST documentation

Scope: crm

Who can execute the method: any user

DEPRECATED

Development of this method has been halted. Please use crm.category.add.

This method creates a new deal direction.

Method Parameters

Required parameters are marked with *

Name
type

Description

fields
array

Field values for creating a deal direction.

To find out the required format for the fields, execute the method crm.dealcategory.fields and check the format of the returned field values.

Code Examples

How to Use Examples in Documentation

curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{"fields":{"NAME":"New Direction","SORT":"20"}}' \
        https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/crm.dealcategory.add
        
curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{"fields":{"NAME":"New Direction","SORT":"20"},"auth":"**put_access_token_here**"}' \
        https://**put_your_bitrix24_address**/rest/crm.dealcategory.add
        
try
        {
            const response = await $b24.callMethod(
                'crm.dealcategory.add',
                {
                    fields:
                    {
                        "NAME": "New Direction",
                        "SORT": "20"
                    }
                }
            );
            
            const result = response.getData().result;
            console.info('Created direction with ID ' + result);
        }
        catch( error )
        {
            console.error('Error:', error);
        }
        
try {
            $response = $b24Service
                ->core
                ->call(
                    'crm.dealcategory.add',
                    [
                        'fields' => [
                            'NAME' => 'New Direction',
                            'SORT' => '20',
                        ],
                    ]
                );
        
            $result = $response
                ->getResponseData()
                ->getResult();
        
            if ($result->error()) {
                error_log($result->error());
            } else {
                echo 'Created direction with ID ' . $result->data();
            }
        
        } catch (Throwable $e) {
            error_log($e->getMessage());
            echo 'Error creating deal category: ' . $e->getMessage();
        }
        
BX24.callMethod(
            "crm.dealcategory.add",
            {
                fields:
                {
                    "NAME": "New Direction",
                    "SORT": "20"
                }
            },
            function(result)
            {
                if(result.error())
                    console.error(result.error());
                else
                    console.info("Created direction with ID " + result.data());
            }
        );
        
require_once('crest.php');
        
        $result = CRest::call(
            'crm.dealcategory.add',
            [
                'fields' =>
                [
                    'NAME' => 'New Direction',
                    'SORT' => '20'
                ]
            ]
        );
        
        echo '<PRE>';
        print_r($result);
        echo '</PRE>';
        
// client and ctx are already created — see the Go SDK section
        res, err := client.Core().Call(ctx, "crm.dealcategory.add", b24.Params{
        	"fields": b24.Params{
        		"NAME": "New Direction",
        		"SORT": "20",
        	},
        })
        if err != nil {
        	return fmt.Errorf("crm.dealcategory.add: %w", err)
        }
        
        // The response arrives as json.RawMessage — unmarshal it
        // into a struct matching the response shape shown below on this page.
        fmt.Printf("%s\n", res.Result)