
## Deal fields

`GET /v1/deals/fields`

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

## Examples

### curl — personal key

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

### curl — OAuth app

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

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

### JavaScript — OAuth app

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

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

## Response fields

| Field | Bitrix24 | Type | RO | Description |
|------|----------|-----|:--:|---------|
| `id` | `id` | number | yes | Deal ID |
| `title` | `title` | string | | Title |
| `amount` | `opportunity` | number | | Amount |
| `currency` | `currencyId` | string | | Currency. List: `GET /v1/currencies` |
| `stageId` | `stageId` | string | | Pipeline stage. The set of stages and their identifiers is configured in your Bitrix24 account and differs between pipelines. Current list — `GET /v1/statuses?filter[entityId]=DEAL_STAGE` for the main pipeline, `GET /v1/statuses?filter[entityId]=DEAL_STAGE_{N}` for the pipeline with `categoryId={N}` (the `categoryId` value is taken from `GET /v1/deal-categories`) |
| `categoryId` | `categoryId` | number | | Pipeline ID (0 = main). List: `GET /v1/deal-categories` |
| `stageSemanticId` | `stageSemanticId` | string | yes | Semantic category of the current stage: `P` — in progress, `S` — success, `F` — failure |
| `companyId` | `companyId` | number | | Company ID. Search: `GET /v1/companies` |
| `contactId` | `contactId` | number | | Primary contact ID. Search: `GET /v1/contacts` |
| `contactIds` | `contactIds` | number[] | yes | All linked contacts. Search: `GET /v1/contacts` |
| `assignedById` | `assignedById` | number | | Assigned person. List: `GET /v1/users` |
| `createdBy` | `createdBy` | number | yes | Creator. Search: `GET /v1/users` |
| `updatedBy` | `updatedBy` | number | yes | Who modified it. Search: `GET /v1/users` |
| `createdAt` | `createdTime` | datetime | yes | Creation date |
| `updatedAt` | `updatedTime` | datetime | yes | Modification date |
| `closedAt` | `closedate` | datetime | | Closing date |
| `closed` | `closed` | boolean | yes | Whether the deal is closed |
| `sourceId` | `sourceId` | string | | Source. List: `GET /v1/statuses?filter[entityId]=SOURCE` |
| `sourceDescription` | `sourceDescription` | string | | Source description |
| `probability` | `probability` | number | | Probability of success (%) |
| `opened` | `opened` | boolean | | Available to everyone |
| `comments` | `comments` | string | | Comment |
| `observers` | `observers` | number[] | | Observers. List: `GET /v1/users` |
| `typeId` | `typeId` | string | | Record type. List: `GET /v1/statuses?filter[entityId]=DEAL_TYPE` |
| `isReturning` | `isReturnCustomer` | boolean | | Repeat deal |

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



## Available include

The `GET /v1/deals/fields` endpoint returns the list of available include: `contact`, `company`, `quote`.

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

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


## Response example

```json
{
  "success": true,
  "data": {
    "fields": {
      "id": { "type": "number", "readonly": true, "label": "Deal ID", "description": "Unique numeric deal identifier." },
      "title": { "type": "string", "readonly": false, "label": "Title", "description": "Deal title." },
      "assignedById": { "type": "number", "readonly": false, "label": "Assigned to", "description": "ID of the responsible user. List: GET /v1/users." },
      "stageSemanticId": { "type": "string", "readonly": true, "label": "Stage semantics", "description": "Semantic category of the current stage — codes are explained in the enum.", "enum": [{ "value": "P", "label": "In progress" }, { "value": "S", "label": "Success" }, { "value": "F", "label": "Failure" }] }
    },
    "batch": ["create", "update", "delete"]
  }
}
```

3 of many fields are shown. The full list is in the table above.

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 403 | `SCOPE_DENIED` | API key lacks the `crm` scope |
| 401 | `TOKEN_MISSING` | API key has no configured tokens |

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

## See also

- [Create deal](/docs/entities/deals/create) — which fields to pass
- [User fields](/docs/userfields) — creating and managing `ufCrm_*`
- [Entity API](/docs/entity-api) — select for fetching the needed fields
- [Limits and optimization](/docs/optimization) — rate limits
