Create a New Company crm.company.add
Scope:
crmWho can execute the method: a user with the "Add|Import" access permission for companies
Method Development Stopped
The method crm.company.add continues to function, but there is a more relevant alternative crm.item.add.
The method crm.company.add creates a new company.
Method Parameters
Required parameters are marked with *
|
Name |
Description |
|
fields* |
Object format:
where:
The list of available fields is described in the method crm.company.fields. An incorrect field in
To find out the list of required fields, execute the method crm.company.fields. |
|
params |
An object containing a set of additional parameters:
|
Parameter fields
|
Name |
Description |
|
TITLE |
Company name |
|
COMPANY_TYPE |
Company type. The list of available types can be obtained using the method crm.status.list with the filter Default — the first available company type |
|
INDUSTRY |
Industry. The list of available values can be obtained using the method crm.status.list with the filter Default — the first available industry |
|
EMPLOYEES |
Number of employees. The list of available values can be obtained using the method crm.status.list with the filter Default — the first available value |
|
CURRENCY_ID |
Currency. The list of available currencies can be obtained using the method crm.currency.list |
|
REVENUE |
Annual revenue |
|
LOGO |
Company logo |
|
OPENED |
Is the company available to everyone? Possible values:
Default |
|
ASSIGNED_BY_ID |
Identifier of the user responsible for the element. Default — the identifier of the user calling the method |
|
COMMENTS |
Comment |
|
PHONE |
Phone |
|
EMAIL |
|
|
WEB |
Website |
|
Messenger |
|
|
UTM_SOURCE |
Advertising system, e.g., Google Ads |
|
UTM_MEDIUM |
Traffic type. Possible values:
|
|
UTM_CAMPAIGN |
Advertising campaign designation |
|
UTM_CONTENT |
Campaign content. For example, for contextual ads |
|
UTM_TERM |
Campaign search condition. For example, keywords for contextual advertising |
|
IS_MY_COMPANY |
Is the company "my company"? Possible values:
|
|
UF_... |
Custom fields. For example, Depending on the account settings, companies may have a set of custom fields of specific types. You can add a custom field to a company using the method crm.company.userfield.add |
|
PARENT_ID_... |
Relationship fields. If there are SPAs related to companies on the account, there is a field for each such SPA that stores the relationship between that SPA and the company. The field itself stores the identifier of the element of that SPA |
Fields for connections with external data sources
If the company is created by an external system, then:
- the field
ORIGINATOR_IDstores the string identifier of that system - the field
ORIGIN_IDstores the string identifier of the company in that external system - the field
ORIGIN_VERSIONstores the version of the company's data in that external system
|
Name |
Description |
|
ORIGINATOR_ID |
Identifier of the external system that is the source of data about this company |
|
ORIGIN_ID |
Identifier of the company in the external system |
|
ORIGIN_VERSION |
Version of the data in the external system. Used to protect data from accidental overwriting |
Import
These fields are available for filling when the parameter IMPORT = 'Y' is passed in the params parameter.
|
Name |
Description |
|
DATE_CREATE |
Creation date |
|
DATE_MODIFY |
Modification date |
|
CREATED_BY_ID |
Created by |
|
MODIFY_BY_ID |
Modified by |
To add the company's address and banking details, use the methods requisites.
Examples
How to Use Examples in Documentation
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"fields":{"TITLE":"LLC Smith","COMPANY_TYPE":"CUSTOMER","INDUSTRY":"MANUFACTURING","EMPLOYEES":"EMPLOYEES_2","CURRENCY_ID":"USD","REVENUE":3000000,"OPENED":"Y","ASSIGNED_BY_ID":1,"PHONE":[{"VALUE":"555888","VALUE_TYPE":"WORK"}]},"params":{"REGISTER_SONET_EVENT":"Y"}}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/crm.company.add
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"fields":{"TITLE":"LLC Smith","COMPANY_TYPE":"CUSTOMER","INDUSTRY":"MANUFACTURING","EMPLOYEES":"EMPLOYEES_2","CURRENCY_ID":"USD","REVENUE":3000000,"OPENED":"Y","ASSIGNED_BY_ID":1,"PHONE":[{"VALUE":"555888","VALUE_TYPE":"WORK"}]},"params":{"REGISTER_SONET_EVENT":"Y"},"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/crm.company.add
try
{
const response = await $b24.callMethod(
"crm.company.add",
{
fields:
{
"TITLE": "LLC Smith",
"COMPANY_TYPE": "CUSTOMER",
"INDUSTRY": "MANUFACTURING",
"EMPLOYEES": "EMPLOYEES_2",
"CURRENCY_ID": "USD",
"REVENUE" : 3000000,
"LOGO": { "fileData": document.getElementById('logo') },
"OPENED": "Y",
"ASSIGNED_BY_ID": 1,
"PHONE": [ { "VALUE": "555888", "VALUE_TYPE": "WORK" } ]
},
params: { "REGISTER_SONET_EVENT": "Y" }
}
);
const result = response.getData().result;
console.info("Company created with ID " + result);
}
catch( error )
{
console.error(error);
}
try {
$response = $b24Service
->core
->call(
'crm.company.add',
[
'fields' => [
'TITLE' => 'LLC Smith',
'COMPANY_TYPE' => 'CUSTOMER',
'INDUSTRY' => 'MANUFACTURING',
'EMPLOYEES' => 'EMPLOYEES_2',
'CURRENCY_ID' => 'USD',
'REVENUE' => 3000000,
'LOGO' => ['fileData' => $_POST['logo']],
'OPENED' => 'Y',
'ASSIGNED_BY_ID' => 1,
'PHONE' => [['VALUE' => '555888', 'VALUE_TYPE' => 'WORK']],
],
'params' => ['REGISTER_SONET_EVENT' => 'Y'],
]
);
$result = $response
->getResponseData()
->getResult();
echo 'Company created with ID ' . $result;
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error creating company: ' . $e->getMessage();
}
BX24.callMethod(
"crm.company.add",
{
fields:
{
"TITLE": "LLC Smith",
"COMPANY_TYPE": "CUSTOMER",
"INDUSTRY": "MANUFACTURING",
"EMPLOYEES": "EMPLOYEES_2",
"CURRENCY_ID": "USD",
"REVENUE" : 3000000,
"LOGO": { "fileData": document.getElementById('logo') },
"OPENED": "Y",
"ASSIGNED_BY_ID": 1,
"PHONE": [ { "VALUE": "555888", "VALUE_TYPE": "WORK" } ]
},
params: { "REGISTER_SONET_EVENT": "Y" }
},
function(result)
{
if(result.error())
console.error(result.error());
else
console.info("Company created with ID " + result.data());
}
);
require_once('crest.php');
$result = CRest::call(
'crm.company.add',
[
'fields' => [
'TITLE' => 'LLC Smith',
'COMPANY_TYPE' => 'CUSTOMER',
'INDUSTRY' => 'MANUFACTURING',
'EMPLOYEES' => 'EMPLOYEES_2',
'CURRENCY_ID' => 'USD',
'REVENUE' => 3000000,
'OPENED' => 'Y',
'ASSIGNED_BY_ID' => 1,
'PHONE' => [['VALUE' => '555888', 'VALUE_TYPE' => 'WORK']],
],
'params' => ['REGISTER_SONET_EVENT' => 'Y'],
]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
Response Handling
HTTP Status: 200
{
"result": 2921,
"time": {
"start": 1769500710,
"finish": 1769500711.551784,
"duration": 1.5517840385437012,
"processing": 1,
"date_start": "2026-01-27T10:58:30+02:00",
"date_finish": "2026-01-27T10:58:31+02:00",
"operating_reset_at": 1769501310,
"operating": 0.6509370803833008
}
}
Returned Data
|
Name |
Description |
|
result |
Root element of the response, contains the identifier of the created company |
|
time |
Information about the request execution time |
Error Handling
HTTP Status: 400
{
"error": "",
"error_description": "Parameter 'fields' must be array."
}
|
Name |
Description |
|
error |
String error code. It may consist of digits, Latin letters, and underscores |
|
error_description |
Textual description of the error. The description is not intended to be shown to the end user in its raw form |
Possible Error Codes
|
Code |
Description |
Value |
|
|
Parameter 'fields' must be array |
The |
|
|
Parameter 'params' must be array |
The |
|
|
Access denied |
The user does not have permission for "Add" or "Import" companies |
|
|
Disk resource exhausted |
|
|
|
The |
The |
Statuses and System Error Codes
HTTP Status: 20x, 40x, 50x
The errors described below may occur when calling any method.
|
Status |
Code |
Description |
|
|
|
An internal server error has occurred, please contact the server administrator or Bitrix24 technical support |
|
|
|
An internal server error has occurred, please contact the server administrator or Bitrix24 technical support |
|
|
|
The request intensity limit has been exceeded |
|
|
|
The current method is not allowed to be called using batch |
|
|
|
The maximum length of parameters passed to the batch method has been exceeded |
|
|
|
Invalid access token or webhook code |
|
|
|
The methods must be called using the HTTPS protocol |
|
|
|
The REST API is blocked due to overload. This is a manual individual block, to remove it you need to contact Bitrix24 technical support |
|
|
|
The REST API is available only on commercial plans |
|
|
|
The user whose access token or webhook was used to call the method lacks permissions |
|
|
|
The manifest is not available |
|
|
|
The request requires higher privileges than those provided by the webhook token |
|
|
|
The provided access token has expired |
|
|
|
The user does not have access to the application. This means that the application is installed, but the account administrator has allowed access to this application only for specific users |
|
|
|
The public part of the site is closed. To open the public part of the site on an on-premise installation, disable the option "Temporary closure of the public part of the site". Path to the setting: Desktop > Settings > Product Settings > Module Settings > Main Module > Temporary closure of the public part of the site |
Continue Learning
- Companies in CRM: Overview of Methods
- Add a Company via Web Form
- Add a Company with Details via Web Form
- Add a deal and company with requisites