
## Lead fields

`GET /v1/leads/fields`

Returns the full list of available fields, including user fields (`ufCrm_*`).

## Examples

### curl — personal key

```bash
curl "https://vibecode.bitrix24.com/v1/leads/fields" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

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

const { success, data } = await res.json()
console.log('Fields:', Object.keys(data).length)
```

### JavaScript — OAuth application

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

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

## Response fields

| Field | Type | RO | Description |
|------|-----|:--:|---------|
| `id` | number | yes | Lead ID |
| `title` | string | | Lead title |
| `name` | string | | First name |
| `lastName` | string | | Last name |
| `secondName` | string | | Middle name |
| `stageId` | string | | Lead status (stage) — canonical name in responses: `NEW`, `IN_PROCESS`, … List: `GET /v1/statuses?filter[entityId]=STATUS` |
| `statusId` | string | | Alias of `stageId` on write, in filters and sorting. ⚠ In list/get/search responses the value arrives in the `stageId` field, the `statusId` key is not returned in the response — read `stageId`. Do not pass both the alias and the canonical name in one request |
| `companyTitle` | string | | Company name |
| `companyId` | number | | Company ID. Lookup: `GET /v1/companies` |
| `contactId` | number | | Contact ID. Lookup: `GET /v1/contacts` |
| `opportunity` | number | | Amount — canonical name in responses. ⚠ For the written value to persist, pass `isManualOpportunity: true` in the same request |
| `amount` | number | | Alias of `opportunity` on write/in filters. In responses the value arrives in the `opportunity` field |
| `isManualOpportunity` | boolean | | Manual amount mode. Without `true`, the amount is recalculated from the product rows and the written value is overwritten |
| `currency` | string | | Alias of `currencyId` on write/in filters. Currency. List: `GET /v1/currencies` |
| `currencyId` | string | | Currency — canonical name in responses |
| `sourceId` | string | | Source. List: `GET /v1/statuses?filter[entityId]=SOURCE` |
| `sourceDescription` | string | | Source description |
| `assignedById` | number | | Assignee. List: `GET /v1/users` |
| `createdBy` | number | yes | Creator. Lookup: `GET /v1/users` |
| `opened` | boolean | | Available to everyone |
| `comments` | string | | Comment |
| `post` | string | | Position |
| `phone` | multifield | | Phone. On input (POST/PATCH) accepts `string \| string[] \| object[]`. On output `phone` is a string with the primary value, per-type values are in `phoneWork`/`phoneMobile`, and the full list with types is in the `fm[]` array (format `{ id, typeId, valueType, value }`). ⚠ PATCH **only adds** new records — old `phone` entries are not removed. See [Update lead](/docs/entities/leads/update). ⚠ The UPPER form `[{ "VALUE": "...", "VALUE_TYPE": "WORK" }]` is **not accepted** — it returns `400 INVALID_MULTIFIELD_SHAPE`. Use camelCase: `[{ "value": "...", "typeId": "WORK" }]`. |
| `email` | multifield | | Email. On input accepts `string \| string[] \| object[]`. On output `email` is a string with the primary value, per-type values are in `emailWork`/`emailHome`/`emailMailing`, and the full list is in the `fm[]` array. ⚠ PATCH **only adds** new records — old `email` entries are not removed. ⚠ The UPPER form `[{ "VALUE": "...", "VALUE_TYPE": "WORK" }]` is **not accepted** — it returns `400 INVALID_MULTIFIELD_SHAPE`. Use camelCase: `[{ "value": "...", "typeId": "WORK" }]`. |
| `birthdate` | datetime | | Birth date |
| `hasPhone` | boolean | yes | Whether a phone is set |
| `hasEmail` | boolean | yes | Whether an email is set |
| `hasImol` | boolean | yes | Whether there is an Open Channel contact |
| `isReturnCustomer` | boolean | yes | Repeat customer |
| `createdTime` | datetime | yes | Creation date |
| `updatedTime` | datetime | yes | Modification date |
| `originatorId` | string | | External source — identifier of the external system the lead was imported from; `null` for leads created in Bitrix24 |
| `dateClosed` | datetime | yes | Date the lead was closed; `null` while the lead is open |
| `lastCommunicationTime` | string | yes | Date of the last communication with the lead; `null` if there was none |
| `utmSource` | string | | `utm_source` tag of the traffic source; `null` if not set |
| `utmMedium` | string | | `utm_medium` tag of the traffic source; `null` if not set |
| `utmCampaign` | string | | `utm_campaign` tag of the traffic source; `null` if not set |
| `utmContent` | string | | `utm_content` tag of the traffic source; `null` if not set |
| `utmTerm` | string | | `utm_term` tag of the traffic source; `null` if not set |

**User fields** (`ufCrm_*`) are also returned in responses and accepted on create/update.



## Available includes

The `GET /v1/leads/fields` endpoint returns the list of available includes: `contact`, `company`.

Usage example: [Get leads](/docs/entities/leads/get#related-data).

More about includes: [Related data](/docs/includes).


## Response example

```json
{
  "success": true,
  "data": {
    "fields": {
      "id": { "type": "number", "readonly": true, "label": "Lead ID", "description": "Unique numeric lead identifier." },
      "title": { "type": "string", "readonly": false, "label": "Title", "description": "Lead title." },
      "assignedById": { "type": "number", "readonly": false, "label": "Assigned to", "description": "ID of the responsible user. List: GET /v1/users." }
    },
    "batch": ["create", "update", "delete"]
  }
}
```

Showing 3 of many fields. Full list in the table above.

## 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 |

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

## See also

- [Update lead](/docs/entities/leads/update)
- [Deals](/docs/entities/deals)
- [User fields](/docs/userfields)
- [Entity API](/docs/entity-api)
- [Limits and optimization](/docs/optimization)
