Para agentes de IA: markdown desta página — /docs-content-en/entities/calendar-resources.md índice da documentação — /llms.txt
Os artigos da documentação estão disponíveis atualmente em inglês.
Calendar resources
Calendar resources are named objects booked in the Bitrix24 calendar, such as a hall or a meeting room. Through the API you create, rename and delete resources and get their occupied intervals by ID.
Bitrix24 API: calendar.resource.*
Scope: calendar
Create calendar resource
POST /v1/calendar-resources
Creates a calendar resource with the specified name.
The request body is flat — no fields wrapper.
Request fields (body)
| Field | Type | Required | Description |
|---|---|---|---|
Fieldname |
Typestring | Requiredyes | DescriptionResource name |
Examples
curl — personal key
curl -X POST "https://vibecode.bitrix24.com/v1/calendar-resources" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "Meeting room 2"}'
curl — OAuth application
curl -X POST "https://vibecode.bitrix24.com/v1/calendar-resources" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "Meeting room 2"}'
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/calendar-resources', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ name: 'Meeting room 2' }),
})
const { success, data } = await res.json()
console.log('Resource ID:', data.id)
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/calendar-resources', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({ name: 'Meeting room 2' }),
})
const { success, data } = await res.json()
Response fields
A successful creation returns HTTP status 201 Created.
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | DescriptionAlways true on success |
Fielddata.id |
Typenumber | DescriptionID of the created resource. The resource name and creator are returned by GET /v1/calendar-resources |
Response example
{
"success": true,
"data": {
"id": 285
}
}
Error response example
400 — empty request body:
{
"success": false,
"error": {
"code": "EMPTY_CREATE_BODY",
"message": "Request body is empty — provide at least one field to create calendarResource."
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeEMPTY_CREATE_BODY |
DescriptionThe request body is empty — pass name |
| HTTP400 | CodeREADONLY_FIELD |
DescriptionThe body contains a read-only field — id or createdBy |
| HTTP422 | CodeBITRIX_ERROR |
Descriptionname is an empty string. Message: the required parameter name is not set |
| HTTP403 | CodeWRITE_BLOCKED_READONLY_KEY |
DescriptionThe API key is in read-only mode — writes are forbidden |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe API key does not have the calendar scope |
| HTTP403 | CodeBITRIX_ACCESS_DENIED |
DescriptionBitrix24 denied the key owner permission to create the resource |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe API key has no configured tokens |
| HTTP401 | CodeMISSING_API_KEY |
DescriptionThe X-Api-Key header was not passed |
| HTTP429 | CodeRATE_LIMITED |
DescriptionRate limit exceeded |
| HTTP502 | CodeBITRIX_UNAVAILABLE |
DescriptionBitrix24 is unavailable or returned a malformed response |
| HTTP503 | CodeBITRIX_TIMEOUT |
DescriptionBitrix24 did not respond in time |
Full list of common API errors — Errors.
Known specifics
Several resources in one call. POST /v1/calendar-resources/batch with the create action creates resources in a batch: {"action": "create", "items": [{"name": "Meeting room 2"}]}. The IDs of the created resources are returned in data.results[].id.