[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Fbookings\u002Fcreate":3,"docs-tabs-entities\u002Fbookings\u002Fcreate":6},{"content":4,"lastmod":5},"\n## Create a booking\n\n`POST \u002Fv1\u002Fbookings`\n\nCreates a new booking on the Bitrix24 account. Fields are passed flat at the root of the JSON.\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|---------|\n| `resourceIds` | number[] | yes | Ids of the resources the booking reserves. The array cannot be empty. The identifiers come from [List booking resources](\u002Fdocs\u002Fentities\u002Fbooking-resources\u002Flist) |\n| `datePeriod` | object | yes | Booking period |\n| `datePeriod.from.timestamp` | number | yes | Period start, Unix seconds |\n| `datePeriod.from.timezone` | string | yes | Time zone of the start in IANA format, e.g. `UTC` |\n| `datePeriod.to.timestamp` | number | yes | Period end, Unix seconds |\n| `datePeriod.to.timezone` | string | yes | Time zone of the end in IANA format |\n| `name` | string | no | Booking name. May be `null` |\n| `description` | string | no | Booking description. May be `null` |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fbookings\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"resourceIds\": [1],\n    \"datePeriod\": {\n      \"from\": { \"timestamp\": 1780132384, \"timezone\": \"UTC\" },\n      \"to\":   { \"timestamp\": 1780135984, \"timezone\": \"UTC\" }\n    },\n    \"name\": \"Meeting room for the demo\",\n    \"description\": \"Meeting room booking\"\n  }'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fbookings\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"resourceIds\": [1],\n    \"datePeriod\": {\n      \"from\": { \"timestamp\": 1780132384, \"timezone\": \"UTC\" },\n      \"to\":   { \"timestamp\": 1780135984, \"timezone\": \"UTC\" }\n    },\n    \"name\": \"Meeting room for the demo\",\n    \"description\": \"Meeting room booking\"\n  }'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fbookings', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    resourceIds: [1],\n    datePeriod: {\n      from: { timestamp: 1780132384, timezone: 'UTC' },\n      to:   { timestamp: 1780135984, timezone: 'UTC' },\n    },\n    name: 'Meeting room for the demo',\n    description: 'Meeting room booking',\n  }),\n})\n\nconst { success, data } = await res.json()\nconsole.log('Booking ID:', data.id)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fbookings', {\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    resourceIds: [1],\n    datePeriod: {\n      from: { timestamp: 1780132384, timezone: 'UTC' },\n      to:   { timestamp: 1780135984, timezone: 'UTC' },\n    },\n    name: 'Meeting room for the demo',\n    description: 'Meeting room booking',\n  }),\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\nThe full object of the created booking is returned.\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data.id` | number | Id of the created booking |\n| `data.name` | string \\| null | Booking name |\n| `data.description` | string \\| null | Booking description |\n| `data.resourceIds` | number[] | Ids of the reserved resources |\n| `data.datePeriod` | object | Booking period: `from` and `to` are ISO 8601 date-time strings |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"id\": 27,\n    \"name\": \"Meeting room for the demo\",\n    \"description\": \"Meeting room booking\",\n    \"resourceIds\": [1],\n    \"datePeriod\": {\n      \"from\": \"2026-05-30T09:13:04+00:00\",\n      \"to\": \"2026-05-30T10:13:04+00:00\"\n    }\n  }\n}\n```\n\n## Error response example\n\n422 — required fields not passed:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"Required fields: resourceIds, datePeriod\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|--------------|---------|\n| 422 | `BITRIX_ERROR` | Required fields `resourceIds` and\u002For `datePeriod` not passed. Message: `Required fields: resourceIds, datePeriod` |\n| 422 | `BITRIX_ERROR` | An empty `resourceIds` array was passed. Message: `Empty resource collection` |\n| 403 | `SCOPE_DENIED` | The API key does not have the `booking` scope |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header was not passed |\n| 401 | `TOKEN_MISSING` | The API key has no configured tokens |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## See also\n\n- [Bookings](\u002Fdocs\u002Fentities\u002Fbookings)\n- [Update a booking](\u002Fdocs\u002Fentities\u002Fbookings\u002Fupdate)\n- [Get a booking](\u002Fdocs\u002Fentities\u002Fbookings\u002Fget)\n- [Delete a booking](\u002Fdocs\u002Fentities\u002Fbookings\u002Fdelete)\n- [Batch](\u002Fdocs\u002Fbatch)\n","2026-10-16",{},1794739319524]