[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Factivities\u002Fsearch":3,"docs-tabs-entities\u002Factivities\u002Fsearch":6},{"content":4,"lastmod":5},"\n## Search activities\n\n`POST \u002Fv1\u002Factivities\u002Fsearch`\n\nSearch activities with filters via POST — more convenient for complex queries.\n\n## Request fields (body)\n\n| Parameter | Type | Default | Description |\n|----------|-----|-----------|---------|\n| `filter` | object | — | Filtering by the fields from `GET \u002Fv1\u002Factivities\u002Ffields`.\u003Cbr>[Filtering syntax](\u002Fdocs\u002Ffiltering). Example: `?filter[ownerTypeId]=2&filter[ownerId]=741` |\n| `limit` | number | `50` | Number of records (up to 5000) |\n| `offset` | number | `0` | Skip N records. Rejected when combined with a date-range filter wider than 14 days — see `UNSTABLE_OFFSET_PAGINATION` in the \"Errors\" section |\n| `order` | object | — | Sorting: `{ \"deadline\": \"asc\" }` |\n| `select` | string[] | — | Field selection: `[\"id\", \"subject\", \"typeId\", \"completed\"]` |\n| `include` | string[] | — | Related 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](\u002Fdocs\u002Fentities\u002Factivities\u002Flist#related-data) |\n| `autoWindow` | boolean | `true` | Split the result set into weekly windows when filtering by a date range wider than 14 days. `false` disables splitting |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Factivities\u002Fsearch\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"filter\": { \"ownerTypeId\": 2, \"ownerId\": 741, \"completed\": false },\n    \"limit\": 20,\n    \"order\": { \"deadline\": \"asc\" }\n  }'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Factivities\u002Fsearch\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"filter\": { \"ownerTypeId\": 2, \"ownerId\": 741, \"completed\": false },\n    \"limit\": 20,\n    \"order\": { \"deadline\": \"asc\" }\n  }'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Factivities\u002Fsearch', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    filter: { ownerTypeId: 2, ownerId: 741, completed: false },\n    limit: 20,\n    order: { deadline: 'asc' },\n  }),\n})\n\nconst { success, data } = await res.json()\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Factivities\u002Fsearch', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    filter: { ownerTypeId: 2, ownerId: 741, completed: false },\n    limit: 20,\n    order: { deadline: 'asc' },\n  }),\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `data` | array | Array of activities (fields — see [Fields](\u002Fdocs\u002Fentities\u002Factivities\u002Ffields)) |\n| `meta.total` | number | How many records matched the filter |\n| `meta.hasMore` | boolean | Whether there are more records beyond `limit` |\n| `meta.durationMs` | number | Request duration in milliseconds |\n| `meta.autoWindowed` | boolean | `true` if the result set was split into time windows |\n| `meta.windowCount` | number | Number of windows. Present with `autoWindowed: true` |\n| `meta.batchWaves` | number | Number of parallel request waves. Present with `autoWindowed: true` |\n| `meta.includeSkipped` | boolean | `true` 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 |\n\nThe `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.\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": [\n    {\n      \"id\": 3894,\n      \"typeId\": 1,\n      \"ownerTypeId\": 2,\n      \"ownerId\": 741,\n      \"subject\": \"Project meeting\",\n      \"responsibleId\": 1,\n      \"completed\": false,\n      \"deadline\": \"2026-04-16T11:00:00+00:00\",\n      \"createdAt\": \"2026-04-15T14:30:00+00:00\"\n    }\n  ],\n  \"meta\": {\n    \"total\": 3,\n    \"hasMore\": false,\n    \"durationMs\": 336\n  }\n}\n```\n\nWith a date-range filter wider than 14 days, `meta` additionally contains `autoWindowed`, `windowCount`, and `batchWaves`:\n\n```json\n{\n  \"success\": true,\n  \"data\": [ \u002F* ... *\u002F ],\n  \"meta\": {\n    \"total\": 269,\n    \"hasMore\": true,\n    \"autoWindowed\": true,\n    \"windowCount\": 131,\n    \"batchWaves\": 3,\n    \"durationMs\": 1139\n  }\n}\n```\n\n## Error response example\n\n403 — no scope:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"SCOPE_DENIED\",\n    \"message\": \"This endpoint requires 'crm' scope\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `UNSTABLE_OFFSET_PAGINATION` | `offset` 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 |\n| 400 | `INVALID_INCLUDE` | `include` contains a name outside the set `responsible`, `author`, `editor`. The response lists the available names |\n| 400 | `INVALID_INCLUDE` | `include` is neither an array of strings nor a string (for example, `[1]` or an object). The response does not list the names |\n| 400 | `INCLUDE_LIMIT_EXCEEDED` | `include` contains more than three names, including duplicates |\n| 403 | `SCOPE_DENIED` | The API key lacks the `crm` scope |\n| 403 | `SCOPE_DENIED` | `include` requests a relation to an employee, and the key lacks the `user` scope. The response names the relation and the missing scope |\n| 401 | `TOKEN_MISSING` | The API key has no configured tokens |\n| 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 |\n\nFor the full list of common API errors, see [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**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`.\n\n**Fields for grouping and aggregation:** `typeId`, `ownerTypeId`, `responsibleId`, `authorId`, `editorId`, `completed`, `status`, `direction`, `providerId`, `providerTypeId`. Used in `POST \u002Fv1\u002Factivities\u002Faggregate` (see [Aggregate activities](\u002Fdocs\u002Fentities\u002Factivities\u002Faggregate)).\n\n## See also\n\n- [List activities](\u002Fdocs\u002Fentities\u002Factivities\u002Flist)\n- [Filtering syntax](\u002Fdocs\u002Ffiltering)\n- [Related data](\u002Fdocs\u002Fincludes)\n- [Batch](\u002Fdocs\u002Fbatch)\n- [Limits and optimization](\u002Fdocs\u002Foptimization)\n","2026-10-23",{},1794739305715]