
## List deals

`GET /v1/deals`

Returns a list of deals with support for filtering, sorting and auto-pagination.

## Parameters

| Parameter | Type | Default | Description |
|----------|-----|-----------|---------|
| `limit` | number | `50` | Number of records (up to 5000). When `limit > 50`, the response is assembled from several sequential reads of 50 records |
| `offset` | number | `0` | Skip N records. When `offset > 0`, `limit ≤ 500` is recommended. For a full-collection walk a cursor is cheaper — `order[id]=asc` plus `filter[>id]` from `meta.nextAfterId` |
| `select` | string | — | Field selection: `?select=id,title,amount` |
| `sort` | string | — | Use the short sorting syntax: `?sort=-createdAt`. A leading minus sign means descending order. |
| `order` | object | — | Sorting: `?order[createdAt]=desc` |
| `filter` | object | — | Filter by fields from `GET /v1/deals/fields`.<br>[Filtering syntax](/docs/filtering). Example: `?filter[stageId]=NEW` |
| `withTotal` | string | — | Whether you need the count: `true` or `false`. `false` — do not request a count. This is the only way to guarantee that `meta.total` is absent from the response. Without the parameter: the API key setting applies, then the platform default — and in that case a short page still carries the exact count even without an explicit request. [Paging and counts](/docs/entity-api#paging-and-record-counts) |

## Examples

### curl — personal key

```bash
curl -g "https://vibecode.bitrix24.com/v1/deals?limit=10&order[amount]=desc&filter[stageId]=NEW" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl -g "https://vibecode.bitrix24.com/v1/deals?limit=10&order[amount]=desc&filter[stageId]=NEW" \
  -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?limit=10&order[amount]=desc&filter[stageId]=NEW', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { success, data, meta } = await res.json()
console.log(`Found ${meta.total} deals`)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/deals?limit=10&order[amount]=desc&filter[stageId]=NEW', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

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

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `data` | array | Array of deals (each contains all fields — see [Fields](/docs/entities/deals/fields)) |
| `meta.total` | number | Total number of records matching the filter. An optional field: if no count was requested, it is absent from the response |
| `meta.hasMore` | boolean | Whether there are more records beyond `limit` |
| `meta.nextAfterId` | string | The identifier of the last returned record. Returned when the sort is strictly `id` ascending, while `hasMore` is `true`. Pass it back as `filter[>id]` — a cheap replacement for a growing `offset` |

The card URL of any deal from the `data` array is built from its `id`:

```
https://<portal>.bitrix24.com/crm/deal/details/<id>/
```

`<portal>` — the Bitrix24 portal domain. Access is restricted by the employee's permissions in Bitrix24.

## Response example

```json
{
  "success": true,
  "data": [
    {
      "id": 741,
      "title": "Equipment delivery",
      "amount": 50000,
      "currency": "USD",
      "stageId": "NEW",
      "categoryId": 0,
      "assignedById": 1,
      "createdAt": "2026-04-14T08:43:59.000Z",
      "contactId": 71,
      "companyId": 0,
      "opened": true
    }
  ],
  "meta": {
    "total": 156,
    "hasMore": true
  }
}
```

## Error response example

403 — no scope:

```json
{
  "success": false,
  "error": {
    "code": "SCOPE_DENIED",
    "message": "This endpoint requires 'crm' scope"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `UNKNOWN_FILTER_FIELD` | Filter on a field absent from the deal schema. The message contains the list of available fields |
| 403 | `SCOPE_DENIED` | API key lacks the `crm` scope |
| 401 | `TOKEN_MISSING` | API key has no configured tokens |
| 429 | `RATE_LIMITED` | Rate limit exceeded: 300 requests per minute per portal. All API keys of the portal share one limit. The current limit is returned in the `x-ratelimit-limit` header. Retry after the delay in the `Retry-After` header |

For the full list of common API errors, see [Errors](/docs/errors).

## Known specifics

**Auto-pagination:** `limit > 50` runs as several sequential reads of 50 records, and the response arrives as a single array. The response time grows with `limit` — [Client-side timeout](/docs/optimization#client-side-timeout).

**`offset` limit:** when `offset ≥ 2500` the response may come back with `INTERNAL_ERROR`. Keep `limit ≤ 500` at large offsets, and walk the whole collection with the `filter[>id]` cursor — it does not depend on depth.

**When to use search.** Complex filters with many conditions are passed in the request body rather than the query string. Search additionally splits a wide date range into windows — [Search with date windowing](/docs/optimization#search-with-date-windowing). See [Search deals](/docs/entities/deals/search).

## See also

- [Search deals](/docs/entities/deals/search)
- [Create deal](/docs/entities/deals/create)
- [Filtering syntax](/docs/filtering)
- [API overview](/docs/entity-api)
- [Batch](/docs/batch)
- [Limits and optimization](/docs/optimization)
