## CRM entity types

`GET /v1/crm-enums/owner-types`

Reference list of the CRM entity types on the Bitrix24 account, smart processes included. Use it to map a numeric entity type to its letter code and back.

## Examples

### curl — personal key

```bash
curl "https://vibecode.bitrix24.com/v1/crm-enums/owner-types" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl "https://vibecode.bitrix24.com/v1/crm-enums/owner-types" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/crm-enums/owner-types', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { data } = await res.json()
const byShortCode = Object.fromEntries(data.map((type) => [type.symbolCodeShort, type.id]))
console.log(byShortCode.D) // 2
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/crm-enums/owner-types', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { data } = await res.json()
```

## Response fields

| Field | Type | Description |
|------|-----|----------|
| `success` | boolean | `true` on a successful request |
| `data` | array | CRM entity types |
| `data[].id` | number | Type ID. Matches `entityTypeId` in CRM routes, for example in [`/v1/items/:entityTypeId`](/docs/entities/items) |
| `data[].name` | string | Type name in the Bitrix24 account language |
| `data[].symbolCode` | string \| null | Symbolic code, for example `DEAL`, `SMART_INVOICE`, `DYNAMIC_1038` |
| `data[].symbolCodeShort` | string \| null | Short code. Matches the `ownerType` of product rows, for example [`D` for a deal](/docs/entities/deals/products-get) |

## Response example

```json
{
  "success": true,
  "data": [
    { "id": 1, "name": "Lead", "symbolCode": "LEAD", "symbolCodeShort": "L" },
    { "id": 2, "name": "Deal", "symbolCode": "DEAL", "symbolCodeShort": "D" },
    { "id": 31, "name": "Invoice", "symbolCode": "SMART_INVOICE", "symbolCodeShort": "SI" },
    { "id": 1038, "name": "No fields", "symbolCode": "DYNAMIC_1038", "symbolCodeShort": "T40e" }
  ]
}
```

The example shows 4 of the 17 types returned by the test Bitrix24 account.

## Error response example

401 — the `X-Api-Key` header is missing:

```json
{
  "success": false,
  "error": {
    "code": "MISSING_API_KEY",
    "message": "API key required. Pass via X-Api-Key header."
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|----------|
| 403 | `BITRIX_ACCESS_DENIED` | The key's user has no permission to read the reference list in Bitrix24 |
| 422 | `BITRIX_ERROR` | Bitrix24 rejected the request. The reason is in `message` |
| 429 | `RATE_LIMITED` | Bitrix24 request rate exceeded, retry in 1-2 seconds |
| 502 | `BITRIX_RESPONSE_INVALID` | Bitrix24 returned the reference list in an unexpected shape |
| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable: it returned a server error or the connection dropped |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |
| 401 | `TOKEN_MISSING` | The API key has no Bitrix24 tokens configured |
| 403 | `SCOPE_DENIED` | The API key lacks the `crm` scope |

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

## Known specifics

- **Smart processes are included in the list.** Their `symbolCode` is `DYNAMIC_` plus `id`, and `symbolCodeShort` is the letter `T` plus `id` in hexadecimal: for type `1038` it is `T40e`. Each Bitrix24 account has its own set of smart processes.
- **Query parameters are ignored.** The method takes no parameters, and any passed in the URL do not affect the response.

## See also

- [CRM address types](/docs/entities/crm-enums/address-types)
- [CRM enums](/docs/entities/crm-enums)
- [Smart process items](/docs/entities/items)
- [Deal product rows](/docs/entities/deals/products-get)
