
## Create company

`POST /v1/companies`

Creates a new company in CRM.

## Request fields (body)

| Parameter | Type | Description |
|----------|-----|---------|
| `title` | string | Company name |
| `typeId` | string | Company type: `CUSTOMER`, `SUPPLIER`, `COMPETITOR`. List of values: `GET /v1/statuses?filter[entityId]=COMPANY_TYPE` |
| `industry` | string | Industry: `IT`, `TELECOM`, `MANUFACTURING`, etc. List: `GET /v1/statuses?filter[entityId]=INDUSTRY` |
| `revenue` | number | Annual revenue |
| `currencyId` | string | Revenue currency. List: `GET /v1/currencies` |
| `phone` | string \| string[] \| object[] | Phone. 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`). **Important:** the UPPER form `[{ "VALUE": "...", "VALUE_TYPE": "WORK" }]` is **not accepted** — it returns `400 INVALID_MULTIFIELD_SHAPE`. Use camelCase: `[{ "value": "...", "typeId": "WORK" }]` |
| `email` | string \| string[] \| object[] | Email. 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`). **Important:** the UPPER form `[{ "VALUE": "...", "VALUE_TYPE": "WORK" }]` is **not accepted** — it returns `400 INVALID_MULTIFIELD_SHAPE`. Use camelCase: `[{ "value": "...", "typeId": "WORK" }]` |
| `web` | string \| string[] \| object[] | Website. 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`). **Important:** the UPPER form `[{ "VALUE": "...", "VALUE_TYPE": "WORK" }]` is **not accepted** — it returns `400 INVALID_MULTIFIELD_SHAPE`. Use camelCase: `[{ "value": "...", "typeId": "WORK" }]` |
| `comments` | string | Comment |
| `assignedById` | number | Responsible person. List: `GET /v1/users` |
| `opened` | boolean | Available to everyone |
| `leadId` | number | ID of the lead the company was created from |
| `ufCrm*` | per field schema | A user field of the Bitrix24 account, for example `ufCrmProjectCode`. The actual name and type are in the schema [`GET /v1/companies/fields`](/docs/entities/companies/fields), and the value format for each type is in [User fields (UF)](/docs/entity-api#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 `ID`s. 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](/docs/entities/companies/fields).

## Examples

### curl — personal key

```bash
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

```bash
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 |
|------|-----|---------|
| `success` | boolean | `true` when the request succeeds |
| `data` | object | The created company with all fields, including user fields `ufCrm*`. All fields — [Company fields](/docs/entities/companies/fields) |
| `data.id` | number | ID of the created company |
| `data.title` | string | Name |
| `data.typeId` | string | Company type |
| `data.industry` | string | Industry |
| `data.assignedById` | number | ID of the responsible person |
| `data.createdBy` | number | ID of the creator |
| `data.createdTime` | datetime | Creation date |
| `data.updatedTime` | datetime | Modification date |

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 |
|------|-----|---------|
| 403 | `SCOPE_DENIED` | The API key does not have the `crm` scope |
| 401 | `TOKEN_MISSING` | The API key has no configured tokens |
| 400 | `INVALID_REQUEST` | Invalid fields |
| 400 | `INVALID_MULTIFIELD_SHAPE` | Wrong shape for `phone`, `email` or `web`: the form with upper-case `VALUE` / `VALUE_TYPE` keys is not accepted; the expected shape is `[{ "value", "typeId" }]`. The same code is returned when `phone`, `email` or `web` holds an object without `value` — for example empty or with keys such as `n0`, `0` or `011` — or a number or `true`/`false`, on its own or as an array item, or when the raw `fm` is not an array, for example a string, a number, an empty object or an object keyed by type such as `PHONE`: `fm` is accepted only as an array `[{ "typeId", "valueType", "value" }]`. The request is refused and nothing is written |
| 400 | `MULTIFIELD_ID_NOT_SUPPORTED` | `phone`, `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. The same refusal applies when `fm`, `phone`, `email` or `web` is sent as an object keyed by row IDs (`{"fm": {"11": {…}}}`) |

Full list of common API errors — [Errors](/docs/errors).

## See also

- [Working with files in CRM fields](/docs/recipes/crm-files)
- [List companies](/docs/entities/companies/list)
- [Company fields](/docs/entities/companies/fields)
- [Duplicate search](/docs/duplicates)
- [Contacts](/docs/entities/contacts)
- [Deals](/docs/entities/deals)
- [Entity API](/docs/entity-api)
- [Limits and optimization](/docs/optimization)
