For AI agents: markdown of this page — /docs-content-en/entities/activities/search.md documentation index — /llms.txt

Search activities

POST /v1/activities/search

Search activities with filters via POST — more convenient for complex queries.

Request fields (body)

Parameter Type Default Description
Parameterfilter Typeobject Default— DescriptionFiltering by the fields from GET /v1/activities/fields.
Filtering syntax. Example: ?filter[ownerTypeId]=2&filter[ownerId]=741
Parameterlimit Typenumber Default50 DescriptionNumber of records (up to 5000)
Parameteroffset Typenumber Default0 DescriptionSkip N records. Rejected when combined with a date-range filter wider than 14 days — see UNSTABLE_OFFSET_PAGINATION in the "Errors" section
Parameterorder Typeobject Default— DescriptionSorting: { "deadline": "asc" }
Parameterselect Typestring[] Default— DescriptionField selection: ["id", "subject", "typeId", "completed"]
Parameterinclude Typestring[] Default— DescriptionRelated employees: ["responsible", "author"]. Available: responsible, author, editor; a comma-separated string is also accepted. Employee cards arrive in the _included field of every data element. Loading employee details requires the user scope in addition to crm. Relation details and a response example — List activities
ParameterautoWindow Typeboolean Defaulttrue DescriptionSplit the result set into weekly windows when filtering by a date range wider than 14 days. false disables splitting

Examples

curl — personal key

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/activities/search" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "filter": { "ownerTypeId": 2, "ownerId": 741, "completed": false },
    "limit": 20,
    "order": { "deadline": "asc" }
  }'

curl — OAuth application

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/activities/search" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "filter": { "ownerTypeId": 2, "ownerId": 741, "completed": false },
    "limit": 20,
    "order": { "deadline": "asc" }
  }'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/activities/search', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    filter: { ownerTypeId: 2, ownerId: 741, completed: false },
    limit: 20,
    order: { deadline: 'asc' },
  }),
})

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

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/activities/search', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    filter: { ownerTypeId: 2, ownerId: 741, completed: false },
    limit: 20,
    order: { deadline: 'asc' },
  }),
})

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

Response fields

Field Type Description
Fielddata Typearray DescriptionArray of activities (fields — see Fields)
Fieldmeta.total Typenumber DescriptionHow many records matched the filter
Fieldmeta.hasMore Typeboolean DescriptionWhether there are more records beyond limit
Fieldmeta.durationMs Typenumber DescriptionRequest duration in milliseconds
Fieldmeta.autoWindowed Typeboolean Descriptiontrue if the result set was split into time windows
Fieldmeta.windowCount Typenumber DescriptionNumber of windows. Present with autoWindowed: true
Fieldmeta.batchWaves Typenumber DescriptionNumber of parallel request waves. Present with autoWindowed: true
Fieldmeta.includeSkipped Typeboolean Descriptiontrue if the response holds more than 200 records and the relations from include are not loaded. Reduce limit. With 200 records or fewer, the field is absent

The meta fields sit next to data, not inside it. Paginate using meta.hasMore: a data length equal to limit does not rule out the last page.

Response example

JSON
{
  "success": true,
  "data": [
    {
      "id": 3894,
      "typeId": 1,
      "ownerTypeId": 2,
      "ownerId": 741,
      "subject": "Project meeting",
      "responsibleId": 1,
      "completed": false,
      "deadline": "2026-04-16T11:00:00+00:00",
      "createdAt": "2026-04-15T14:30:00+00:00"
    }
  ],
  "meta": {
    "total": 3,
    "hasMore": false,
    "durationMs": 336
  }
}

With a date-range filter wider than 14 days, meta additionally contains autoWindowed, windowCount, and batchWaves:

JSON
{
  "success": true,
  "data": [ /* ... */ ],
  "meta": {
    "total": 269,
    "hasMore": true,
    "autoWindowed": true,
    "windowCount": 131,
    "batchWaves": 3,
    "durationMs": 1139
  }
}

Error response example

403 — no scope:

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

Errors

HTTP Code Description
HTTP400 CodeUNSTABLE_OFFSET_PAGINATION Descriptionoffset greater than zero together with a date-range filter wider than 14 days. Two different retrieval algorithms produce inconsistent results, so the request is rejected. Fetch everything in a single request with limit up to 5000, or pass autoWindow: false with sorting by id, or split the date range into parts yourself
HTTP400 CodeINVALID_INCLUDE Descriptioninclude contains a name outside the set responsible, author, editor. The response lists the available names
HTTP400 CodeINVALID_INCLUDE Descriptioninclude is neither an array of strings nor a string (for example, [1] or an object). The response does not list the names
HTTP400 CodeINCLUDE_LIMIT_EXCEEDED Descriptioninclude contains more than three names, including duplicates
HTTP403 CodeSCOPE_DENIED DescriptionThe API key lacks the crm scope
HTTP403 CodeSCOPE_DENIED Descriptioninclude requests a relation to an employee, and the key lacks the user scope. The response names the relation and the missing scope
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no configured tokens
HTTP429 CodeRATE_LIMITED DescriptionRate 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.

Known specifics

Time-window splitting. A date-range filter wider than 14 days is automatically split into weekly windows executed in parallel waves, so the result set bypasses the ceiling of 5000 records per call. meta then contains autoWindowed: true, the number of windows windowCount, and the number of waves batchWaves. The autoWindow: false parameter disables splitting. While splitting is active, an offset greater than zero is rejected with UNSTABLE_OFFSET_PAGINATION.

Fields for grouping and aggregation: typeId, ownerTypeId, responsibleId, authorId, editorId, completed, status, direction, providerId, providerTypeId. Used in POST /v1/activities/aggregate (see Aggregate activities).

See also