## List entity fields

`GET /v1/crm-forms/entity-fields`

Returns the fields of leads, contacts, companies, deals and other CRM entities that can be added to a CRM form. Call it before creating or updating a form to look up field names.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `entityName` (query) | string | yes | CRM entity name, for example `LEAD`, `CONTACT`, `COMPANY`, `DEAL`, `DYNAMIC_177`. For the list, see `data.entitySchemes[].entityNames` in [Builder configuration](/docs/entities/crm-forms/configuration).<br>To request several entities, pass up to 10 names in one of these ways: comma-separated `?entityName=LEAD,CONTACT`, repeated `?entityName=LEAD&entityName=CONTACT` or `?entityName[]=LEAD&entityName[]=CONTACT` |

The endpoint accepts no other query parameters.

## Examples

### curl — personal key

```bash
curl "https://vibecode.bitrix24.com/v1/crm-forms/entity-fields?entityName=LEAD" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl "https://vibecode.bitrix24.com/v1/crm-forms/entity-fields?entityName=LEAD" \
  -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-forms/entity-fields?entityName=LEAD', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { success, data } = await res.json()
console.log(data.map(field => `${field.name} — ${field.label}`))
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/crm-forms/entity-fields?entityName=LEAD', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

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

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data` | array | Fields of all requested entities in one array. No pagination |
| `data[].name` | string | Field name in the form: the entity name plus the field code, for example `LEAD_NAME`. Pass this value in `fields[].name` when [creating a form](/docs/entities/crm-forms/create) |
| `data[].label` | string | Field label |
| `data[].type` | string | Field type: `string`, `text`, `list`, `date`, `datetime`, `double`, `file`, `typed_string`, `crm_entity`, `resourcebooking`. The `typed_string` type is used by communication fields: phone, email, website, messenger |
| `data[].required` | boolean | Whether the field is required |
| `data[].multiple` | boolean | Whether the field accepts multiple values |
| `data[].entityName` | string | Entity the field belongs to, for example `LEAD` |
| `data[].entityLabel` | string | Entity label |
| `data[].items` | array | Value options of a `list` field. An empty array for fields of other types |
| `data[].items[].id` | string | Option ID, for example `WEB` in the `LEAD_SOURCE_ID` field |
| `data[].items[].label` | string | Option label |

## Response example

The example shows four fields from the lead response. Option IDs depend on the Bitrix24 account; labels in this example are illustrative:

```json
{
  "success": true,
  "data": [
    {
      "name": "LEAD_TITLE",
      "label": "Lead name",
      "type": "string",
      "required": false,
      "multiple": false,
      "entityName": "LEAD",
      "entityLabel": "Lead",
      "items": []
    },
    {
      "name": "LEAD_HONORIFIC",
      "label": "Salutation",
      "type": "list",
      "required": false,
      "multiple": false,
      "entityName": "LEAD",
      "entityLabel": "Lead",
      "items": [
        {
          "id": "HNR_RU_1",
          "label": "Mr."
        },
        {
          "id": "HNR_RU_2",
          "label": "Mrs."
        }
      ]
    },
    {
      "name": "LEAD_NAME",
      "label": "First name",
      "type": "string",
      "required": false,
      "multiple": false,
      "entityName": "LEAD",
      "entityLabel": "Lead",
      "items": []
    },
    {
      "name": "LEAD_PHONE",
      "label": "Phone",
      "type": "typed_string",
      "required": false,
      "multiple": true,
      "entityName": "LEAD",
      "entityLabel": "Lead",
      "items": []
    }
  ]
}
```

## Error response example

400 — `entityName` is not passed:

```json
{
  "success": false,
  "error": {
    "code": "MISSING_REQUIRED_FIELDS",
    "message": "entityName is required"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|----------|
| 400 | `MISSING_REQUIRED_FIELDS` | `entityName` is missing |
| 400 | `INVALID_PARAMS` | More than 10 names, an empty name, or an unknown query parameter |
| 403 | `BITRIX_ACCESS_DENIED` | The Bitrix24 user lacks permission to access forms |
| 403 | `BITRIX_INSUFFICIENT_SCOPE` | The Bitrix24 token lacks the required scope |
| 404 | `ENTITY_NOT_FOUND` | Bitrix24 did not find a requested entity or field descriptor. The original code is in `error.b24Code` |
| 409 | `CRM_FORM_REST_NOT_ENABLED` | The CRM form REST methods are unavailable on this Bitrix24 account. This does not mean that an individual form is missing |
| 400–599 | `CRM_FORM_*` | Rejection under form rules. The code and HTTP status are preserved. The original code is in `error.b24Code` |
| 422 | `BITRIX_ERROR` | Another Bitrix24 rejection. The reason is in `error.message`. The original code is in `error.b24Code` |
| 429 | `RATE_LIMITED` | Request rate exceeded. Follow the `Retry-After` header |
| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 returned an unexpected response shape |
| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable: a server error or a dropped connection |
| 503 | `BITRIX_TIMEOUT` | Bitrix24 did not respond in time. The read can be retried |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |
| 401 | `TOKEN_MISSING` | The key has no configured Bitrix24 credentials |
| 403 | `SCOPE_DENIED` | The Vibecode API key lacks the `crm` scope |

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

## See also

- [Get builder configuration](/docs/entities/crm-forms/configuration)
- [Form contract fields](/docs/entities/crm-forms/fields)
- [Create a form](/docs/entities/crm-forms/create)
- [Update a form](/docs/entities/crm-forms/update)
- [CRM forms](/docs/entities/crm-forms)
