لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/entities/companies.md فهرس التوثيق — /llms.txt

مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.

Companies

CRM company management: create, retrieve, update, delete, filter.

Bitrix24 API: crm.item.* Scope: crm

Create company

POST /v1/companies

Creates a new company in CRM.

Request fields (body)

Parameter Type Description
Parametertitle Typestring DescriptionCompany name
ParametertypeId Typestring DescriptionCompany type: CUSTOMER, SUPPLIER, COMPETITOR. Values list: GET /v1/statuses?filter[entityId]=COMPANY_TYPE
Parameterindustry Typestring DescriptionIndustry: IT, TELECOM, MANUFACTURING, etc. List: GET /v1/statuses?filter[entityId]=INDUSTRY
Parameterrevenue Typenumber DescriptionAnnual revenue
ParametercurrencyId Typestring DescriptionRevenue currency. List: GET /v1/currencies
Parameterphone Typestring | string[] | object[] DescriptionPhone. Accepts three forms: a string "+1...", an array of strings ["+1...", "+1..."], or an array of objects [{ "value": "+1...", "typeId": "WORK" }, …]. typeId: WORK | HOME | MOBILE | OTHER (default WORK). ⚠ The UPPER form [{ "VALUE": "...", "VALUE_TYPE": "WORK" }] is not accepted — it returns 400 INVALID_MULTIFIELD_SHAPE. Use camelCase: [{ "value": "...", "typeId": "WORK" }]
Parameteremail Typestring | string[] | object[] DescriptionEmail. Accepts three forms: a string "a@b.com", an array of strings ["a@b.com", "b@c.com"], or an array of objects [{ "value": "a@b.com", "typeId": "WORK" }, …]. typeId: WORK | HOME | MAILING | OTHER (default WORK). ⚠ The UPPER form [{ "VALUE": "...", "VALUE_TYPE": "WORK" }] is not accepted — it returns 400 INVALID_MULTIFIELD_SHAPE. Use camelCase: [{ "value": "...", "typeId": "WORK" }]
Parameterweb Typestring | string[] | object[] DescriptionWebsite. Accepts three forms: a string "https://acme.com", an array of strings, or an array of objects [{ "value": "https://...", "typeId": "WORK" }]. typeId: WORK | HOME | OTHER (default WORK). ⚠ The UPPER form [{ "VALUE": "...", "VALUE_TYPE": "WORK" }] is not accepted — it returns 400 INVALID_MULTIFIELD_SHAPE. Use camelCase: [{ "value": "...", "typeId": "WORK" }]
Parametercomments Typestring DescriptionComment
ParametersourceId Typestring DescriptionSource. List: GET /v1/statuses?filter[entityId]=SOURCE
ParametersourceDescription Typestring DescriptionSource description
ParameterassignedById Typenumber DescriptionResponsible person. List: GET /v1/users
Parameteropened Typeboolean DescriptionAvailable to everyone
ParameterleadId Typenumber DescriptionID of the lead the company was created from
ParameterufCrm* Typeper field schema DescriptionA user field of the Bitrix24 account, for example ufCrmProjectCode. The actual name and type are in the schema GET /v1/companies/fields, and the value format for each type is in User fields (UF). An enumeration field takes the option ID from the field's items array in the schema, and a multiple field takes an array of such IDs. If you send the option label VALUE instead of the ID, the value is lost: a single-value field gets 0. A number that is not among the options is stored as is. Neither the label nor a non-existent ID raises an error, and the request returns 201, so map the label to its ID on your side and check the stored value of this field in the response data

Full list of fields: GET /v1/companies/fields.

Examples

curl — personal key

Terminal
curl -X POST https://vibecode.bitrix24.com/v1/companies \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Acme LLC",
    "typeId": "CUSTOMER",
    "industry": "IT",
    "phone": "+12025550123",
    "email": "info@example.com",
    "web": "https://example.com"
  }'

curl — OAuth application

Terminal
curl -X POST https://vibecode.bitrix24.com/v1/companies \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Acme LLC",
    "typeId": "CUSTOMER",
    "industry": "IT",
    "phone": "+12025550124",
    "email": "info@example.com",
    "web": "https://example.com"
  }'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/companies', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    title: 'Acme LLC',
    typeId: 'CUSTOMER',
    industry: 'IT',
    phone: '+12025550125',
    email: 'info@example.com',
    web: 'https://example.com',
  }),
})

const { success, data } = await res.json()
console.log('Company ID:', data.id)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/companies', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    title: 'Acme LLC',
    typeId: 'CUSTOMER',
    industry: 'IT',
    phone: '+12025550126',
    email: 'info@example.com',
    web: 'https://example.com',
  }),
})

const { success, data } = await res.json()

Alternative form — array of objects with explicit `typeId`

If you need to specify several values or an explicit type (HOME, OTHER):

JSON
{
  "phone": [
    { "value": "+12025550127", "typeId": "WORK" },
    { "value": "+12025550123", "typeId": "OTHER" }
  ],
  "email": [
    { "value": "info@example.com", "typeId": "WORK" },
    { "value": "sales@example.com", "typeId": "MAILING" }
  ],
  "web": [
    { "value": "https://example.com", "typeId": "WORK" },
    { "value": "https://shop.example.com", "typeId": "OTHER" }
  ]
}

Response fields

Field Type Description
Fieldid Typenumber DescriptionID of the created company
Fieldtitle Typestring DescriptionName
FieldtypeId Typestring DescriptionCompany type
Fieldindustry Typestring DescriptionIndustry
FieldassignedById Typenumber DescriptionResponsible person
FieldcreatedBy Typenumber DescriptionCreator
FieldcreatedTime Typedatetime DescriptionCreation date
FieldupdatedTime Typedatetime DescriptionModification date

The response contains all company fields, including user fields (ufCrm*).

The company card URL in Bitrix24 is built from id:

https://<portal>.bitrix24.com/crm/company/details/<id>/

<portal> is the Bitrix24 portal domain. Access is restricted by the employee's permissions in Bitrix24.

Response example

JSON
{
  "success": true,
  "data": {
    "id": 2923,
    "title": "Acme LLC",
    "typeId": "CUSTOMER",
    "industry": "IT",
    "revenue": 0,
    "currencyId": "USD",
    "assignedById": 1,
    "createdBy": 1,
    "createdTime": "2026-04-15T12:53:59+00:00",
    "updatedTime": "2026-04-15T12:53:59+00:00",
    "opened": true
  }
}

Error response example

403 — no scope:

JSON
{
  "success": false,
  "error": {
    "code": "SCOPE_DENIED",
    "message": "This endpoint requires 'crm' scope"
  }
}

Errors

HTTP Code Description
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the crm scope
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no configured tokens
HTTP400 CodeINVALID_REQUEST DescriptionInvalid fields
HTTP400 CodeMULTIFIELD_ID_NOT_SUPPORTED Descriptionphone, email, web or the raw fm[] contains an object with an id field. There is nothing to address on create: Bitrix24 assigns multifield row ids itself, so the request is refused and nothing is written

Full list of common API errors — Errors.

See also