[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Fbooking-wait-list\u002Fbooking":3,"docs-tabs-entities\u002Fbooking-wait-list\u002Fbooking":6},{"content":4,"lastmod":5},"# Book from the wait list\n\n`POST \u002Fv1\u002Fbooking-wait-list\u002F:id\u002Fbooking`\n\nCreates a booking from a wait list record: the record's clients move to the new booking, and the record itself is removed from the wait list.\n\nFields go at the root of the JSON, without a `fields` wrapper. Messages to the client about the booking depend on the `is*NotificationOn` switches of the [booking resource](\u002Fdocs\u002Fentities\u002Fbooking-resources\u002Fget).\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|----------|\n| `id` (path) | number | yes | Wait list record identifier. List: [`GET \u002Fv1\u002Fbooking-wait-list`](\u002Fdocs\u002Fentities\u002Fbooking-wait-list\u002Flist) |\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|----------|\n| `resourceIds` | number[] | yes | Identifiers of the resources the booking reserves. The array cannot be empty. List: [`GET \u002Fv1\u002Fbooking-resources`](\u002Fdocs\u002Fentities\u002Fbooking-resources\u002Flist) |\n| `datePeriod.from.timestamp` | number | yes | Booking start, Unix time in seconds |\n| `datePeriod.from.timezone` | string | yes | Time zone of the start in IANA format, e.g. `UTC` |\n| `datePeriod.to.timestamp` | number | yes | Booking end, Unix time in seconds. Must be later than the start |\n| `datePeriod.to.timezone` | string | yes | Time zone of the end in IANA format |\n\nThe body accepts no other fields. The booking name and description are set by [updating the booking](\u002Fdocs\u002Fentities\u002Fbookings\u002Fupdate).\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fbooking-wait-list\u002F27\u002Fbooking\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"resourceIds\": [49],\n    \"datePeriod\": {\n      \"from\": { \"timestamp\": 1795158000, \"timezone\": \"UTC\" },\n      \"to\": { \"timestamp\": 1795161600, \"timezone\": \"UTC\" }\n    }\n  }'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fbooking-wait-list\u002F27\u002Fbooking\" \\\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\": [49],\n    \"datePeriod\": {\n      \"from\": { \"timestamp\": 1795158000, \"timezone\": \"UTC\" },\n      \"to\": { \"timestamp\": 1795161600, \"timezone\": \"UTC\" }\n    }\n  }'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fbooking-wait-list\u002F27\u002Fbooking', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    resourceIds: [49],\n    datePeriod: {\n      from: { timestamp: 1795158000, timezone: 'UTC' },\n      to: { timestamp: 1795161600, timezone: 'UTC' },\n    },\n  }),\n})\n\nconst { 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\u002Fbooking-wait-list\u002F27\u002Fbooking', {\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: [49],\n    datePeriod: {\n      from: { timestamp: 1795158000, timezone: 'UTC' },\n      to: { timestamp: 1795161600, timezone: 'UTC' },\n    },\n  }),\n})\n\nconst { data } = await res.json()\nconsole.log('Booking ID:', data.id)\n```\n\n## Response fields\n\nOn success, the HTTP status is `201 Created` and the response contains the card of the new booking — the same as [`GET \u002Fv1\u002Fbookings\u002F:id`](\u002Fdocs\u002Fentities\u002Fbookings\u002Fget) returns.\n\n| Field | Type | Description |\n|------|-----|----------|\n| `success` | boolean | `true` on success |\n| `data.id` | number | Booking identifier. The booking's clients are returned by [`GET \u002Fv1\u002Fbookings\u002F:id\u002Fclients`](\u002Fdocs\u002Fentities\u002Fbookings\u002Fclients) |\n| `data.name` | string \\| null | Booking name |\n| `data.description` | string \\| null | Booking description |\n| `data.resourceIds` | number[] | Identifiers 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    \"datePeriod\": {\n      \"from\": \"2026-11-20T07:00:00+00:00\",\n      \"to\": \"2026-11-20T08:00:00+00:00\"\n    },\n    \"description\": null,\n    \"id\": 49,\n    \"name\": null,\n    \"resourceIds\": [\n      49\n    ]\n  }\n}\n```\n\n## Error response example\n\n404 — there is no wait list record with this `id`, for example because it has already been moved to a booking:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"ENTITY_NOT_FOUND\",\n    \"message\": \"Booking record not found\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 404 | `ENTITY_NOT_FOUND` | There is no wait list record with this `id`, including one already moved to a booking. Message `Booking record not found` |\n| 400 | `MISSING_REQUIRED_FIELDS` | `resourceIds` or `datePeriod` is missing, or `resourceIds` is an empty array. Message `resourceIds and datePeriod are required` |\n| 400 | `INVALID_PARAMS` | The body contains a field other than `resourceIds` and `datePeriod`. Message `Only resourceIds and datePeriod can be written` |\n| 400 | `INVALID_PARAMS` | `resourceIds` contains a value that is not a positive integer. Message `resourceIds must contain positive integers` |\n| 400 | `INVALID_PARAMS` | `from` or `to` has no `timestamp` or `timezone`. Message `datePeriod requires from\u002Fto with a finite timestamp and timezone` |\n| 400 | `INVALID_PARAMS` | The time zone is not in IANA format. Message `timezone must be an IANA timezone` |\n| 400 | `INVALID_PARAMS` | The body is not a JSON object. Message `Body must contain resourceIds and datePeriod` |\n| 400 | `INVALID_PARAMS` | `id` is not a positive integer. Message `id must be a canonical positive safe integer` |\n| 422 | `BITRIX_ERROR` | A resource from `resourceIds` does not exist. Message `Some resources were not found` with the resource IDs, `b24Code` `1038` |\n| 422 | `BITRIX_ERROR` | The booking end is earlier than the start. Message `Invalid date period` |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is not passed |\n| 401 | `TOKEN_MISSING` | The key has no Bitrix24 tokens |\n| 403 | `SCOPE_DENIED` | The key does not have the `booking` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is in read-only mode |\n| 429 | `RATE_LIMITED` | Request rate exceeded. The effective cap is in the `x-ratelimit-limit` header |\n| 502 | `BITRIX_RESPONSE_INVALID` | Bitrix24 returned a response of an unexpected shape. If this happened while re-reading the booking after creation, the booking has already been created and the record removed from the wait list — find the booking in the [list of bookings](\u002Fdocs\u002Fentities\u002Fbookings\u002Flist) before retrying |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**A rejected request does not remove the record.** On a `400` or `422` response, the record stays in the wait list, and the move can be retried.\n\n**The booking card does not return the note.** The record's note moves to the booking, but the booking card has no field for it, and `description` stays `null`. When the [booking is moved back to the wait list](\u002Fdocs\u002Fentities\u002Fbookings\u002Fwait-list), the note returns to the new wait list record.\n\n## See also\n\n- [Move a booking to the wait list](\u002Fdocs\u002Fentities\u002Fbookings\u002Fwait-list)\n- [Wait list clients](\u002Fdocs\u002Fentities\u002Fbooking-wait-list\u002Fclients)\n- [Get a booking](\u002Fdocs\u002Fentities\u002Fbookings\u002Fget)\n- [List booking resources](\u002Fdocs\u002Fentities\u002Fbooking-resources\u002Flist)\n- [Errors](\u002Fdocs\u002Ferrors)\n","2026-10-16",{},1795000273492]