[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Fcalendar-events\u002Fsearch":3,"docs-tabs-entities\u002Fcalendar-events\u002Fsearch":6},{"content":4,"lastmod":5},"\n## Calendar event search\n\n`POST \u002Fv1\u002Fcalendar-events\u002Fsearch`\n\nReturns the same events as `GET \u002Fv1\u002Fcalendar-events`, but the parameters are passed in the request body. The search runs within a single calendar — `type` and `ownerId` are required.\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|-------|---------|\n| `filter` | object | yes | Search conditions: the keys `type` and `ownerId` are required; `from`, `to`, and `section` are optional. Key values are described below the table. A field outside this set returns `400 UNSUPPORTED_FILTER`.\u003Cbr>[Filtering syntax](\u002Fdocs\u002Ffiltering). Example: `{ \"type\": \"user\", \"ownerId\": 1, \"from\": \"2026-06-01T00:00:00\" }` |\n| `limit` | number | no | Number of records, up to 5000. Defaults to `50` |\n| `offset` | number | no | Skip N records |\n| `order` | object | no | Sorting: `{ \"from\": \"desc\" }` |\n| `select` | string[] | no | Field selection: `[\"id\", \"name\", \"from\"]` |\n| `include` | string[] | no | Related employees: `[\"owner\", \"host\", \"attendee\"]` — the same relations and the same `_included` shape as in the [event list](\u002Fdocs\u002Fentities\u002Fcalendar-events\u002Flist), up to three names. The relation reads an employee, so the key needs the `user` scope in addition to `calendar` |\n\n`filter.type` — calendar type: `user`, `group`, `company_calendar`. `filter.ownerId` — calendar owner ID: for `type=user`, the employee ID from [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers\u002Flist); for `type=group`, the workgroup ID. `filter.from` and `filter.to` — start and end of the event selection period in ISO 8601 format. `filter.section` — calendar section ID from [`GET \u002Fv1\u002Fcalendar-sections`](\u002Fdocs\u002Fentities\u002Fcalendar-sections\u002Flist).\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcalendar-events\u002Fsearch\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"filter\": {\n      \"type\": \"user\",\n      \"ownerId\": 1,\n      \"from\": \"2026-06-01T00:00:00\",\n      \"to\": \"2026-07-01T00:00:00\"\n    },\n    \"order\": { \"from\": \"desc\" },\n    \"limit\": 20\n  }'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcalendar-events\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\": {\n      \"type\": \"user\",\n      \"ownerId\": 1,\n      \"from\": \"2026-06-01T00:00:00\",\n      \"to\": \"2026-07-01T00:00:00\"\n    },\n    \"order\": { \"from\": \"desc\" },\n    \"limit\": 20\n  }'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcalendar-events\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: {\n      type: 'user',\n      ownerId: 1,\n      from: '2026-06-01T00:00:00',\n      to: '2026-07-01T00:00:00',\n    },\n    order: { from: 'desc' },\n    limit: 20,\n  }),\n})\n\nconst { success, data } = await res.json()\nconsole.log('Found:', data.length)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcalendar-events\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: {\n      type: 'user',\n      ownerId: 1,\n      from: '2026-06-01T00:00:00',\n      to: '2026-07-01T00:00:00',\n    },\n    order: { from: 'desc' },\n    limit: 20,\n  }),\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data` | array | Array of events. For all fields see [Event fields](\u002Fdocs\u002Fentities\u002Fcalendar-events\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\nThe `meta` fields sit next to `data`, not inside it. Page through the results using `meta.hasMore`: a `data` length equal to `limit` does not rule out the last page.\n\n## Response example\n\nThe main fields are shown. For the full list see [Event fields](\u002Fdocs\u002Fentities\u002Fcalendar-events\u002Ffields).\n\n```json\n{\n  \"success\": true,\n  \"data\": [\n    {\n      \"id\": 7521,\n      \"type\": \"user\",\n      \"ownerId\": 1,\n      \"name\": \"Weekly standup\",\n      \"from\": \"2026-06-15T14:00:00+00:00\",\n      \"to\": \"2026-06-15T15:00:00+00:00\",\n      \"skipTime\": false,\n      \"durationSeconds\": 3600,\n      \"importance\": \"normal\",\n      \"accessibility\": \"busy\",\n      \"isMeeting\": true,\n      \"sectionId\": 3\n    }\n  ],\n  \"meta\": { \"total\": 1, \"hasMore\": false, \"durationMs\": 169 }\n}\n```\n\n## Error response example\n\n400 — filter on an unsupported field:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"UNSUPPORTED_FILTER\",\n    \"message\": \"calendar-events search accepts only top-level parameters: type, ownerId, from, to, section. Filter keys received: NAME. For single-record lookup use GET \u002Fv1\u002Fcalendar-events\u002F:id.\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `MISSING_REQUIRED_PARAMS` | The required `type` and\u002For `ownerId` were not passed. `message` lists the missing fields |\n| 400 | `UNSUPPORTED_FILTER` | The filter contains a field outside the set `type`, `ownerId`, `from`, `to`, `section` |\n| 400 | `INVALID_INCLUDE` | `include` contains a name outside the set `owner`, `host`, `attendee`. The response lists the available names |\n| 400 | `INCLUDE_LIMIT_EXCEEDED` | `include` contains more than three names |\n| 403 | `SCOPE_DENIED` | The key lacks the `calendar` 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 | `MISSING_API_KEY` | The `X-Api-Key` header was not passed |\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**The search is limited to a single calendar and period.** The search filters only by `type`, `ownerId`, `from`, `to`, `section` — it does not cover event content (`name`, `importance`, `accessibility` and other fields). To select events by such fields, fetch the events for the required period and filter them on the application side.\n\n## See also\n\n- [Event list](\u002Fdocs\u002Fentities\u002Fcalendar-events\u002Flist)\n- [Filtering syntax](\u002Fdocs\u002Ffiltering)\n- [Related data](\u002Fdocs\u002Fincludes)\n- [Batch](\u002Fdocs\u002Fbatch)\n- [Limits and optimization](\u002Fdocs\u002Foptimization)\n","2026-10-27",{},1794739321828]