
## Search catalogs

`POST /v1/catalogs/search`

Search commercial catalogs with filters. Equivalent to [`GET /v1/catalogs`](./list.md) with filters, but over POST — more convenient for conditions across multiple fields.

## Request fields (body)

| Parameter | Type | Default | Description |
|----------|-----|-----------|---------|
| `filter` | object | — | Filtering by `GET /v1/catalogs/fields` fields.<br>[Filtering syntax](/docs/filtering). Example: `{ "iblockTypeId": "CRM_PRODUCT_CATALOG" }` |
| `limit` | number | `50` | Number of records (up to 5000) |
| `select` | string[] | — | Field selection: `["id", "name"]` |

## Examples

### curl — personal key

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/catalogs/search" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "filter": { "iblockTypeId": "CRM_PRODUCT_CATALOG" },
    "limit": 10
  }'
```

### curl — OAuth application

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/catalogs/search" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "filter": { "iblockTypeId": "CRM_PRODUCT_CATALOG" },
    "limit": 10
  }'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/catalogs/search', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    filter: { iblockTypeId: 'CRM_PRODUCT_CATALOG' },
    limit: 10,
  }),
})

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

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/catalogs/search', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    filter: { iblockTypeId: 'CRM_PRODUCT_CATALOG' },
    limit: 10,
  }),
})

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

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data` | array | Array of catalogs (all fields — see [Catalog fields](/docs/entities/catalogs/fields)) |
| `meta.total` | number | Total number of catalogs matching the filter |
| `meta.hasMore` | boolean | Whether there are more records beyond `limit` |
| `meta.durationMs` | number | Request duration in milliseconds |

The `meta` fields sit next to `data`, not inside it. Pages must be walked by `meta.hasMore`: a `data` length equal to `limit` does not rule out the last page.

## Response example

```json
{
  "success": true,
  "data": [
    {
      "id": 25,
      "iblockId": 25,
      "iblockTypeId": "CRM_PRODUCT_CATALOG",
      "lid": "s1",
      "name": "CRM product catalog",
      "productIblockId": null,
      "skuPropertyId": null,
      "subscription": "N",
      "vatId": 1
    },
    {
      "id": 27,
      "iblockId": 27,
      "iblockTypeId": "CRM_PRODUCT_CATALOG",
      "lid": "s1",
      "name": "CRM product catalog (offers)",
      "productIblockId": 25,
      "skuPropertyId": 101,
      "subscription": "N",
      "vatId": 1
    }
  ],
  "meta": {
    "total": 2,
    "hasMore": false,
    "durationMs": 142
  }
}
```

## Error response example

400 — filter by a non-existent field:

```json
{
  "success": false,
  "error": {
    "code": "UNKNOWN_FILTER_FIELD",
    "message": "Unknown filter field 'nonExistentField' for entity 'catalogs'. Available: id, iblockId, iblockTypeId, lid, name, productIblockId, skuPropertyId, subscription, vatId, yandexExport"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `UNKNOWN_FILTER_FIELD` | Filter by a field the catalog does not have. The message contains the list of available fields |
| 403 | `SCOPE_DENIED` | The API key does not have the `catalog` scope |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header was not provided |

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

## Known specifics

**Product catalog or offers catalog.** The catalog type in the output can be determined from the `productIblockId` and `skuPropertyId` fields: in a base product catalog both are `null`. In an offers catalog they are populated, where `productIblockId` is the `iblockId` of the linked product catalog.

**When to use list instead of search:** for a single simple condition it is easier to use [`GET /v1/catalogs`](./list.md) with the `filter` query parameter.

## See also

- [List of catalogs](/docs/entities/catalogs/list)
- [Get a catalog](/docs/entities/catalogs/get)
- [Catalog fields](/docs/entities/catalogs/fields)
- [Filtering syntax](/docs/filtering)
- [Entities reference](/docs/entities-index)
