Get Calendar List calendar.section.get
If you are developing integrations for Bitrix24 using AI tools (Codex, Claude Code, Cursor), connect to the MCP server so that the assistant can utilize the official REST documentation.
Scope:
calendarWho can execute the method: any user
This method retrieves a list of calendars.
Method Parameters
Required parameters are marked with *
|
Name |
Description |
|
type* |
Calendar type:
|
|
ownerId* |
Identifier of the calendar owner. This parameter can be omitted if the calendar type is For the |
Code Examples
How to Use Examples in Documentation
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"type":"user","ownerId":1}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/calendar.section.get
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"type":"user","ownerId":1,"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/calendar.section.get
// This snippet is an ES module: top-level await requires type="module" or a bundler.
// $b24 is an already-initialized SDK instance (see the SDK "Get started" guide).
import { Text } from '@bitrix24/b24jssdk'
import type { B24Frame, ISODate } from '@bitrix24/b24jssdk'
declare const $b24: B24Frame
// Shape of each CalendarSection returned in result[]
type CalendarSection = {
ID: string
NAME: string
GAPI_CALENDAR_ID: string | null
DESCRIPTION: string
COLOR: string
TEXT_COLOR: string
EXPORT: { ALLOW: boolean }
CAL_TYPE: string
OWNER_ID: string
CREATED_BY: string
DATE_CREATE: ISODate | null
TIMESTAMP_X: ISODate | null
CAL_DAV_CON: string | null
SYNC_TOKEN: string | null
PAGE_TOKEN: string | null
EXTERNAL_TYPE: string
ACCESS: Record<string, number>
IS_COLLAB: boolean
PERM: {
view_time: boolean
view_title: boolean
view_full: boolean
add: boolean
edit: boolean
edit_section: boolean
access: boolean
}
}
try {
// calendar.section.get returns a single page (max 50 records). For the whole result set
// use a list helper: $b24.actions.v2.callList.make() returns every record as one
// array, $b24.actions.v2.fetchList.make() yields them in chunks (async generator).
// NOTE: the list helpers do not accept `order` (it is excluded from their params, so
// passing it is a TS error) — keep this call.make + `start` variant when sort matters.
const response = await $b24.actions.v2.call.make<CalendarSection[]>({
method: 'calendar.section.get',
params: {
type: 'user',
ownerId: 1,
start: 0,
},
requestId: Text.getUuidRfc4122()
})
// The payload is available only on a successful response
if (!response.isSuccess) {
console.error(response.getErrorMessages().join('; '))
} else {
const result = response.getData()!.result
console.info('Sections count:', result.length, 'first section:', result[0])
}
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
<!-- Load the SDK (UMD build); it is exposed as the global B24Js -->
<script src="https://unpkg.com/@bitrix24/b24jssdk@1/dist/umd/index.min.js"></script>
<script>
async function getCalendarSections() {
try {
// Initialize the SDK inside a Bitrix24 frame
const $b24 = await B24Js.initializeB24Frame()
// calendar.section.get returns a single page (max 50 records). For the whole result set
// use a list helper: $b24.actions.v2.callList.make() returns every record as one
// array, $b24.actions.v2.fetchList.make() yields them in chunks (async generator).
// NOTE: the list helpers do not accept `order` (it is excluded from their params, so
// passing it is a TS error) — keep this call.make + `start` variant when sort matters.
const response = await $b24.actions.v2.call.make({
method: 'calendar.section.get',
params: {
type: 'user',
ownerId: 1,
start: 0,
},
requestId: B24Js.Text.getUuidRfc4122()
})
// The payload is available only on a successful response
if (!response.isSuccess) {
console.error(response.getErrorMessages().join('; '))
return
}
const result = response.getData().result
console.info('Sections count:', result.length, 'first section:', result[0])
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
}
document.addEventListener('DOMContentLoaded', getCalendarSections)
</script>
try {
$response = $b24Service
->core
->call(
'calendar.section.get',
[
'type' => 'user',
'ownerId' => 1
]
);
$result = $response
->getResponseData()
->getResult();
echo 'Success: ' . print_r($result, true);
// Your logic for processing data
processData($result);
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error getting calendar section: ' . $e->getMessage();
}
BX24.callMethod(
'calendar.section.get',
{
type: 'user',
ownerId: 1
}
);
require_once('crest.php');
$result = CRest::call(
'calendar.section.get',
[
'type' => 'user',
'ownerId' => 1
]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
Response Handling
HTTP Status: 200
{
"result": [
{
"ID": "190",
"NAME": "New Section",
"GAPI_CALENDAR_ID": null,
"DESCRIPTION": "Description for section",
"COLOR": "#9cbeee",
"TEXT_COLOR": "#283000",
"EXPORT": {
"ALLOW": true
},
"CAL_TYPE": "user",
"OWNER_ID": "1",
"CREATED_BY": "1",
"DATE_CREATE": "2024-12-10 06:36:00",
"TIMESTAMP_X": "2024-12-10 06:36:00",
"CAL_DAV_CON": null,
"SYNC_TOKEN": null,
"PAGE_TOKEN": null,
"EXTERNAL_TYPE": "local",
"ACCESS": {
"D114": 17,
"G2": 13,
"U2": 15,
"U1": 19
},
"IS_COLLAB": false,
"PERM": {
"view_time": true,
"view_title": true,
"view_full": true,
"add": true,
"edit": true,
"edit_section": true,
"access": true
}
},
{
"ID": "191",
...
}
{
"ID": "192",
...
}
],
"time": {
"start": 1733828946.418185,
"finish": 1733828946.650208,
"duration": 0.23202300071716309,
"processing": 0.0054471492767333984,
"date_start": "2024-12-08T11:09:06+00:00",
"date_finish": "2024-12-08T11:09:06+00:00"
}
}
Returned Data
|
Name |
Description |
|
result |
Array of calendars |
|
ID |
Calendar identifier |
|
NAME |
Calendar name |
|
GAPI_CALENDAR_ID |
Synchronization identifier |
|
DESCRIPTION |
Calendar description |
|
COLOR |
Calendar color |
|
TEXT_COLOR |
Text color in the calendar |
|
EXPORT |
Object with calendar export parameters |
|
CAL_TYPE |
Calendar type |
|
OWNER_ID |
Identifier of the calendar owner. For the user calendar type |
|
CREATED_BY |
Identifier of the calendar creator |
|
DATE_CREATE |
Calendar creation date |
|
TIMESTAMP_X |
Calendar modification date |
|
CAL_DAV_CON |
Synchronization identifier |
|
SYNC_TOKEN |
Synchronization identifier |
|
PAGE_TOKEN |
Synchronization identifier |
|
EXTERNAL_TYPE |
Provider type for synchronization |
|
ACCESS |
Object containing access data for the calendar. The object key is the access permission identifier. You can obtain the name of the access permission using the access.name method. Determine access rights for the current user using the user.access method. The object value contains a numerical identifier of the access permission. Access permission identifiers differ across different accounts. Currently, only the portal administrator in the on-premise version of Bitrix24 can retrieve all identifiers. |
|
IS_COLLAB |
Flag indicating whether the calendar belongs to a collaboration |
|
PERM |
Object containing access permissions for the current user to the calendar |
EXPORT Object
|
Name |
Description |
|
ALLOW |
Calendar export is allowed |
PERM Object
|
Name |
Description |
|
view_time |
View calendar event times |
|
view_title |
View calendar event titles |
|
view_full |
Full access to event information in the calendar |
|
add |
Add events to the calendar |
|
edit |
Edit events in the calendar |
|
edit_section |
Edit the calendar |
|
access |
Full access to the calendar |
Error Handling
HTTP Status: 400
{
"error": "",
"error_description": "The required parameter "type" for the method "calendar.section.get" is not set"
}
|
Name |
Description |
|
error |
String error code. It may consist of digits, Latin letters, and underscores |
|
error_description |
Textual description of the error. The description is not intended to be shown to the end user in its raw form |
Possible Error Codes
|
Code |
Error Message |
Description |
|
Empty string |
The required parameter "type" for the method "calendar.section.get" is not set |
The required parameter |
|
Empty string |
The required parameter "ownerId" for the method "calendar.section.get" is not set |
The required parameter |
|
Empty string |
Access denied |
Access to the method is prohibited for external users |
Statuses and System Error Codes
HTTP Status: 20x, 40x, 50x
The errors described below may occur when calling any method.
|
Status |
Code |
Description |
|
|
|
An internal server error has occurred. Please contact the server administrator or Bitrix24 technical support |
|
|
|
An internal server error has occurred. Please contact the server administrator or Bitrix24 technical support |
|
|
|
The request intensity limit has been exceeded |
|
|
|
The current method is not permitted for calls using batch |
|
|
|
The maximum length of parameters passed to the batch method has been exceeded |
|
|
|
Invalid access token or webhook code |
|
|
|
The HTTPS protocol is required for method calls |
|
|
|
The REST API is blocked due to overload. This is a manual individual block; please contact Bitrix24 technical support to lift it |
|
|
|
The REST API is only available on commercial plans |
|
|
|
The user associated with the access token or webhook used to call the method lacks the necessary permissions |
|
|
|
The manifest is not available |
|
|
|
The request requires higher privileges than those provided by the webhook token |
|
|
|
The provided access token has expired |
|
|
|
The user does not have access to the application. This means that the application is installed, but the portal administrator has restricted access to this application to specific users only |
|
|
|
The public part of the site is closed. To open the public part of the site on an on-premise installation, disable the "Temporary closure of the public part of the site" option. Path to the setting: Desktop > Settings > Product Settings > Module Settings > Main Module > Temporary closure of the public part of the site |
Continue Learning
- Calendar: Overview of Methods
- Add Calendar calendar.section.add
- Update Calendar calendar.section.update
- Delete Calendar calendar.section.delete