Add Event calendar.event.add

Choose a tool for developing with an AI agent:

  • use Alaio Vibecode to build an app for Bitrix24 from a task description without knowing any programming language. The agent writes the code and deploys the app to a server, with no manual hosting setup
  • use the MCP server to develop a REST API integration in your own project. The agent refers to the official REST documentation

Scope: calendar

Who can execute the method: any user

This method adds a new event to the calendar.

Method Parameters

Required parameters are marked with *

Name
type

Description

type*
string

Calendar type:

  • user — user calendar
  • group — group calendar
  • company_calendar — company calendar

ownerId*
integer

Identifier of the calendar owner.

For the company calendar, the ownerId parameter is set to 0

from*
datetime|date

Start date and time of the event.

You can specify a date without time. To do this, pass the value Y in the skip_time parameter

to*
datetime|date

End date of the event.

You can specify a date without time. To do this, pass the value Y in the skip_time parameter

from_ts
integer

Date and time in timestamp format. Can be used instead of the from parameter

to_ts
integer

Date and time in timestamp format. Can be used instead of the to parameter

section*
integer

Calendar identifier.

This parameter is required if auto_detect_section is passed and not equal to Y

auto_detect_section
string

Auto-detection mode for the section.

Possible values:

  • Y — enable auto-detection of the section
  • N — use the provided section

If the parameter is not passed, the method attempts to auto-detect the section

name*
string

Event name

skip_time
string

Pass the date value without time in the from and to parameters. Possible values:

  • Y — use only the date
  • N — use date and time

Date format according to ISO-8601

timezone_from
string

Timezone of the event start date and time. Default is the current user's timezone.

The value should be passed as a string, for example, Europe/Riga.

Timezone handling features

timezone_to
string

Timezone of the event end date and time. Default value is the current user's timezone.

The value should be passed as a string, for example, Europe/Riga.

Timezone handling features

description
text

Event description

color
string

Background color of the event.

The # symbol in the color must be passed in unicode format — %23

text_color
string

Text color of the event.

The # symbol in the color must be passed in unicode format — %23

accessibility
string

Availability during the event time:

  • busy — busy
  • absent — absent
  • quest — tentative
  • free — free

importance
string

Event importance:

  • high — high
  • normal — medium
  • low — low

private_event
string

Mark indicating that the event is private. Possible values:

  • Y — private
  • N — not private

rrule
object

Recurrence of the event in the form of an object according to the iCalendar standard. The structure is described below

is_meeting
string

Indicator of a meeting with event participants. Possible values:

  • Y — meeting with participants
  • N — meeting without participants

For a meeting with participants, pass the list of attendees in attendees

location
string

Venue

remind
array

Array of objects describing reminders for the event. The structure is described below

attendees
array

List of identifiers of event participants.

If you do not pass this parameter for a meeting with participants, the attendee will be the user on whose behalf the method is executed

meeting
object

Object with meeting parameters. The structure is described below

crm_fields
array

Array of CRM object identifiers to link to the event. To link objects, list their identifiers with prefixes:

  • CO_ — company
  • C_ — contact
  • L_ — lead
  • D_ — deal

Event Organizer

The event organizer is the user on whose behalf the calendar.event.add method is executed.

The parameter table does not include a special host parameter because the calendar.event.add method does not use it to assign the organizer. The host parameter is used in the calendar.event.update method so that a user who is not the organizer can update a meeting by specifying the current organizer.

You can retrieve the current organizer identifier in the response of the calendar.event.getbyid and calendar.event.get methods in the MEETING_HOST field.

Timezone Handling Features

When working with event dates and times, you can use two approaches:

  1. Full date format with timezone.

    Use the ISO-8601 format with timezone specified in the from and to parameters:

    • 2025-03-20T15:00:00+02:00 — with offset
    • 2025-08-05T10:00:00+11:00 — with offset
    • 2025-08-04T23:00:00Z — with UTC specified

    The timezone_from and timezone_to parameters are ignored, as the timezone is already specified in the date.

  2. Simple date format with separate timezone parameters.

    Use the simple format in the from and to parameters:

    • 2025-03-20 15:00:00
    • 2025-08-05 10:00:00
    • 2025-08-05T10:00:00

    Specify the timezone in the timezone_from and timezone_to parameters:

    • Europe/Berlin
    • America/New_York
    • Asia/Tokyo

    If only timezone_from is specified, its value will be used for timezone_to as well.

Priority of timezone parameter processing:

  • Highest priority. If the from and to parameters specify the full format with timezone, the timezone_from and timezone_to parameters are ignored
  • Medium priority. If a simple date format is used and the timezone_from and timezone_to parameters are specified, they are used
  • Lowest priority. If the date format is simple and timezone parameters are not specified, the current user's timezone is used

rrule Parameter

Name
type

Description

FREQ
string

Recurrence frequency

  • DAILY — daily
  • WEEKLY — weekly
  • MONTHLY — monthly
  • YEARLY — yearly

COUNT
integer

Number of recurrences

INTERVAL
integer

Interval between recurrences

BYDAY
array

Days of the week

  • SU — Sunday
  • MO — Monday
  • TU — Tuesday
  • WE — Wednesday
  • TH — Thursday
  • FR — Friday
  • SA — Saturday

UNTIL
date

End date of recurrences

remind Parameter

Name
type

Description

type
string

Time type of reminder

  • min — minutes
  • hour – hours
  • day — days

count
integer

Numerical value of the time interval

meeting Parameter

Name
type

Description

notify
boolean

Flag for notification of confirmation or refusal by participants

reinvite
boolean

Flag for requesting re-confirmation of participation when editing the event

allow_invite
boolean

Flag for allowing participants to invite others to the event

hide_guests
boolean

Flag for hiding the list of participants

Code Examples

How to Use Examples in Documentation

curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{"type":"user","ownerId":2,"name":"New Event Name","description":"Description for event","from":"2024-06-14","to":"2024-06-14","skip_time":"Y","section":5,"color":"#9cbe1c","text_color":"#283033","accessibility":"absent","importance":"normal","is_meeting":"Y","private_event":"N","remind":[{"type":"min","count":20}],"location":"New York","attendees":[1,2,3],"meeting":{"notify":true,"reinvite":false,"allow_invite":false,"hide_guests":false},"rrule":{"FREQ":"WEEKLY","BYDAY":["MO","WE"],"COUNT":10,"INTERVAL":1},"crm_fields":["C_5","L_11"]}' \
        https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/calendar.event.add
        
curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{"type":"user","ownerId":2,"name":"New Event Name","description":"Description for event","from":"2024-06-14","to":"2024-06-14","skip_time":"Y","section":5,"color":"#9cbe1c","text_color":"#283033","accessibility":"absent","importance":"normal","is_meeting":"Y","private_event":"N","remind":[{"type":"min","count":20}],"location":"New York","attendees":[1,2,3],"meeting":{"notify":true,"reinvite":false,"allow_invite":false,"hide_guests":false},"rrule":{"FREQ":"WEEKLY","BYDAY":["MO","WE"],"COUNT":10,"INTERVAL":1},"crm_fields":["C_5","L_11"],"auth":"**put_access_token_here**"}' \
        https://**put_your_bitrix24_address**/rest/calendar.event.add
        
// 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 } from '@bitrix24/b24jssdk'
        
        declare const $b24: B24Frame
        
        // Shape of the payload returned in result (match the "response handling" section of the page)
        type CalendarEventAddResult = number
        
        try {
          const response = await $b24.actions.v2.call.make<CalendarEventAddResult>({
            method: 'calendar.event.add',
            params: {
              type: 'user',
              ownerId: 2,
              name: 'New Event Name',
              description: 'Description for event',
              from: '2024-06-14',
              to: '2024-06-14',
              skip_time: 'Y',
              section: 5,
              color: '#9cbe1c',
              text_color: '#283033',
              accessibility: 'absent',
              importance: 'normal',
              is_meeting: 'Y',
              private_event: 'N',
              remind: [
                { type: 'min', count: 20 },
              ],
              location: 'London',
              attendees: [1, 2, 3],
              meeting: {
                notify: true,
                reinvite: false,
                allow_invite: false,
                hide_guests: false,
              },
              rrule: {
                FREQ: 'WEEKLY',
                BYDAY: ['MO', 'WE'],
                COUNT: 10,
                INTERVAL: 1,
              },
              crm_fields: ['C_5', 'L_11'],
            },
            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('Created event ID:', result)
          }
        } 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 addCalendarEvent() {
            try {
              // Initialize the SDK inside a Bitrix24 frame
              const $b24 = await B24Js.initializeB24Frame()
        
              const response = await $b24.actions.v2.call.make({
                method: 'calendar.event.add',
                params: {
                  type: 'user',
                  ownerId: 2,
                  name: 'New Event Name',
                  description: 'Description for event',
                  from: '2024-06-14',
                  to: '2024-06-14',
                  skip_time: 'Y',
                  section: 5,
                  color: '#9cbe1c',
                  text_color: '#283033',
                  accessibility: 'absent',
                  importance: 'normal',
                  is_meeting: 'Y',
                  private_event: 'N',
                  remind: [
                    { type: 'min', count: 20 },
                  ],
                  location: 'London',
                  attendees: [1, 2, 3],
                  meeting: {
                    notify: true,
                    reinvite: false,
                    allow_invite: false,
                    hide_guests: false,
                  },
                  rrule: {
                    FREQ: 'WEEKLY',
                    BYDAY: ['MO', 'WE'],
                    COUNT: 10,
                    INTERVAL: 1,
                  },
                  crm_fields: ['C_5', 'L_11'],
                },
                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('Created event ID:', result)
            } catch (error) {
              // Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
              console.error(error)
            }
          }
        
          document.addEventListener('DOMContentLoaded', addCalendarEvent)
        </script>
        
from b24pysdk.errors import BitrixAPIError, BitrixSDKException
        
        try:
            bitrix_response = client.calendar.event.add(
                type="user",
                owner_id=2,
                name="New Event Name",
                description="Description for event",
                from_date="2024-06-14",
                to="2024-06-14",
                skip_time="Y",
                section=5,
                color="#9cbe1c",
                text_color="#283033",
                accessibility="absent",
                importance="normal",
                is_meeting="Y",
                private_event="N",
                remind=[
                    {
                        "type": "min",
                        "count": 20,
                    },
                ],
                location="London",
                attendees=[
                    1,
                    2,
                    3,
                ],
                host=2,
                meeting={
                    "notify": True,
                    "reinvite": False,
                    "allow_invite": False,
                    "hide_guests": False,
                },
                rrule={
                    "FREQ": "WEEKLY",
                    "BYDAY": [
                        "MO",
                        "WE",
                    ],
                    "COUNT": 10,
                    "INTERVAL": 1,
                },
                crm_fields=[
                    "C_5",
                    "L_11",
                ],
            ).response
            result = bitrix_response.result
            print(result)
        except BitrixAPIError as error:
            print(
                "Bitrix API error",
                f"error: {error.error}",
                f"error_description: {error.error_description}",
                sep="\n",
            )
        except BitrixSDKException as error:
            print(f"Bitrix SDK error: {error.message}")
        except Exception as error:
            print(f"Unexpected error: {error}")
        
try {
            $response = $b24Service
                ->core
                ->call(
                    'calendar.event.add',
                    [
                        'type'          => 'user',
                        'ownerId'       => 2,
                        'name'          => 'New Event Name',
                        'description'   => 'Description for event',
                        'from'          => '2024-06-14',
                        'to'            => '2024-06-14',
                        'skip_time'     => 'Y',
                        'section'       => 5,
                        'color'         => '#9cbe1c',
                        'text_color'    => '#283033',
                        'accessibility' => 'absent',
                        'importance'    => 'normal',
                        'is_meeting'    => 'Y',
                        'private_event' => 'N',
                        'remind'        => [
                            [
                                'type'  => 'min',
                                'count' => 20
                            ]
                        ],
                        'location'      => 'New York',
                        'attendees'     => [1, 2, 3],
                        'meeting'       => [
                            'notify'      => true,
                            'reinvite'    => false,
                            'allow_invite' => false,
                            'hide_guests' => false,
                        ],
                        'rrule'         => [
                            'FREQ'     => 'WEEKLY',
                            'BYDAY'    => ['MO', 'WE'],
                            'COUNT'    => 10,
                            'INTERVAL' => 1,
                        ],
                        'crm_fields'    => ['C_5', 'L_11']
                    ]
                );
        
            $result = $response
                ->getResponseData()
                ->getResult();
        
            echo 'Success: ' . print_r($result, true);
            // Your data processing logic here
            processData($result);
        
        } catch (Throwable $e) {
            error_log($e->getMessage());
            echo 'Error adding calendar event: ' . $e->getMessage();
        }
        
BX24.callMethod(
            'calendar.event.add',
            {
                type: 'user',
                ownerId: 2,
                name: 'New Event Name',
                description: 'Description for event',
                from: '2024-06-14',
                to: '2024-06-14',
                skip_time: 'Y',
                section: 5,
                color: '#9cbe1c',
                text_color: '#283033',
                accessibility: 'absent',
                importance: 'normal',
                is_meeting: 'Y',
                private_event: 'N',
                remind: [
                    {
                        type: 'min',
                        count: 20
                    }
                ],
                location: 'New York',
                attendees: [1, 2, 3],
                meeting: {
                    notify: true,
                    reinvite: false,
                    allow_invite: false,
                    hide_guests: false,
                },
                rrule: {
                    FREQ: 'WEEKLY',
                    BYDAY: ['MO', 'WE'],
                    COUNT: 10,
                    INTERVAL: 1,
                },
                crm_fields: ['C_5', 'L_11']
            }
        );
        
require_once('crest.php');
        
        $result = CRest::call(
            'calendar.event.add',
            [
                'type' => 'user',
                'ownerId' => 2,
                'name' => 'New Event Name',
                'description' => 'Description for event',
                'from' => '2024-06-14',
                'to' => '2024-06-14',
                'skip_time' => 'Y',
                'section' => 5,
                'color' => '#9cbe1c',
                'text_color' => '#283033',
                'accessibility' => 'absent',
                'importance' => 'normal',
                'is_meeting' => 'Y',
                'private_event' => 'N',
                'remind' => [
                    [
                        'type' => 'min',
                        'count' => 20
                    ]
                ],
                'location' => 'New York',
                'attendees' => [1, 2, 3],
                'meeting' => [
                    'notify' => true,
                    'reinvite' => false,
                    'allow_invite' => false,
                    'hide_guests' => false,
                ],
                'rrule' => [
                    'FREQ' => 'WEEKLY',
                    'BYDAY' => ['MO', 'WE'],
                    'COUNT' => 10,
                    'INTERVAL' => 1,
                ],
                'crm_fields' => ['C_5', 'L_11']
            ]
        );
        
        echo '<PRE>';
        print_r($result);
        echo '</PRE>';
        
// client and ctx are already created — see the Go SDK section
        res, err := client.Core().Call(ctx, "calendar.event.add", b24.Params{
        	"type":          "user",
        	"ownerId":       2,
        	"name":          "New Event Name",
        	"description":   "Description for event",
        	"from":          "2024-06-14",
        	"to":            "2024-06-14",
        	"skip_time":     "Y",
        	"section":       5,
        	"color":         "#9cbe1c",
        	"text_color":    "#283033",
        	"accessibility": "absent",
        	"importance":    "normal",
        	"is_meeting":    "Y",
        	"private_event": "N",
        	"remind": []b24.Params{
        		{
        			"type":  "min",
        			"count": 20,
        		},
        	},
        	"location":  "London",
        	"attendees": []int{1, 2, 3},
        	"meeting": b24.Params{
        		"notify":       true,
        		"reinvite":     false,
        		"allow_invite": false,
        		"hide_guests":  false,
        	},
        	"rrule": b24.Params{
        		"FREQ":     "WEEKLY",
        		"BYDAY":    []string{"MO", "WE"},
        		"COUNT":    10,
        		"INTERVAL": 1,
        	},
        	"crm_fields": []string{"C_5", "L_11"},
        })
        if err != nil {
        	return fmt.Errorf("calendar.event.add: %w", err)
        }
        
        var newID b24.ID
        if err := json.Unmarshal(res.Result, &newID); err != nil {
        	return fmt.Errorf("parse response: %w", err)
        }
        fmt.Println("id:", newID)
        

How to Add a Recurring Event to the Company Calendar

curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{"type":"company_calendar","ownerId":"","from":"2025-01-31T18:00:00","to":"2025-01-31T20:00:00","section":1,"name":"Important Meeting","skip_time":"N","timezone_from":"Europe/Berlin","timezone_to":"Europe/Berlin","description":"Event description","color":"#FF0000","text_color":"#000000","accessibility":"busy","importance":"high","private_event":"N","rrule":{"FREQ":"WEEKLY","COUNT":10,"INTERVAL":1,"BYDAY":["MO","WE","FR"]},"is_meeting":"Y","location":"Conference Room","remind":[{"type":"min","count":30}],"attendees":[29,93],"meeting":{"notify":true,"reinvite":false,"allow_invite":true,"hide_guests":false}}' \
        https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/calendar.event.add
        
curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{"type":"company_calendar","ownerId":"","from":"2025-01-31T18:00:00","to":"2025-01-31T20:00:00","section":1,"name":"Important Meeting","skip_time":"N","timezone_from":"Europe/Berlin","timezone_to":"Europe/Berlin","description":"Event description","color":"#FF0000","text_color":"#000000","accessibility":"busy","importance":"high","private_event":"N","rrule":{"FREQ":"WEEKLY","COUNT":10,"INTERVAL":1,"BYDAY":["MO","WE","FR"]},"is_meeting":"Y","location":"Conference Room","remind":[{"type":"min","count":30}],"attendees":[29,93],"meeting":{"notify":true,"reinvite":false,"allow_invite":true,"hide_guests":false},"auth":"**put_access_token_here**"}' \
        https://**put_your_bitrix24_address**/rest/calendar.event.add
        
// 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 } from '@bitrix24/b24jssdk'
        
        declare const $b24: B24Frame
        
        // Shape of the payload returned in result (match the "response handling" section of the page)
        type CalendarEventAddResult = number
        
        try {
          const response = await $b24.actions.v2.call.make<CalendarEventAddResult>({
            method: 'calendar.event.add',
            params: {
              type: 'company_calendar',
              ownerId: '',
              from: '2025-01-31T18:00:00',
              to: '2025-01-31T20:00:00',
              section: 1,
              name: 'Important Meeting',
              skip_time: 'N',
              timezone_from: 'Europe/Berlin',
              timezone_to: 'Europe/Berlin',
              description: 'Event description',
              color: '%23FF0000',
              text_color: '%23000000',
              accessibility: 'busy',
              importance: 'high',
              private_event: 'N',
              rrule: {
                FREQ: 'WEEKLY',
                COUNT: 10,
                INTERVAL: 1,
                BYDAY: ['MO', 'WE', 'FR'],
              },
              is_meeting: 'Y',
              location: 'Conference room',
              remind: [
                { type: 'min', count: 30 },
              ],
              attendees: [29, 93],
              meeting: {
                notify: true,
                reinvite: false,
                allow_invite: true,
                hide_guests: false,
              },
            },
            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('Created event ID:', result)
          }
        } 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 addCalendarEvent() {
            try {
              // Initialize the SDK inside a Bitrix24 frame
              const $b24 = await B24Js.initializeB24Frame()
        
              const response = await $b24.actions.v2.call.make({
                method: 'calendar.event.add',
                params: {
                  type: 'company_calendar',
                  ownerId: '',
                  from: '2025-01-31T18:00:00',
                  to: '2025-01-31T20:00:00',
                  section: 1,
                  name: 'Important Meeting',
                  skip_time: 'N',
                  timezone_from: 'Europe/Berlin',
                  timezone_to: 'Europe/Berlin',
                  description: 'Event description',
                  color: '%23FF0000',
                  text_color: '%23000000',
                  accessibility: 'busy',
                  importance: 'high',
                  private_event: 'N',
                  rrule: {
                    FREQ: 'WEEKLY',
                    COUNT: 10,
                    INTERVAL: 1,
                    BYDAY: ['MO', 'WE', 'FR'],
                  },
                  is_meeting: 'Y',
                  location: 'Conference room',
                  remind: [
                    { type: 'min', count: 30 },
                  ],
                  attendees: [29, 93],
                  meeting: {
                    notify: true,
                    reinvite: false,
                    allow_invite: true,
                    hide_guests: false,
                  },
                },
                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('Created event ID:', result)
            } catch (error) {
              // Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
              console.error(error)
            }
          }
        
          document.addEventListener('DOMContentLoaded', addCalendarEvent)
        </script>
        
from b24pysdk.errors import BitrixAPIError, BitrixSDKException
        
        try:
            bitrix_response = client.calendar.event.add(
                type="company_calendar",
                owner_id="",
                from_date="2025-01-31T18:00:00",
                to="2025-01-31T20:00:00",
                section=1,
                name="Important meeting",
                attendees=[
                    29,
                    93,
                ],
                host=1,
                skip_time="N",
                timezone_from="Europe/Berlin",
                timezone_to="Europe/Berlin",
                description="Event description",
                color="#FF0000",
                text_color="#000000",
                accessibility="busy",
                importance="high",
                private_event="N",
                is_meeting="Y",
                location="Conference room",
                remind=[
                    {
                        "type": "min",
                        "count": 30,
                    },
                ],
                meeting={
                    "notify": True,
                    "reinvite": False,
                    "allow_invite": True,
                    "hide_guests": False,
                },
                rrule={
                    "FREQ": "WEEKLY",
                    "COUNT": 10,
                    "INTERVAL": 1,
                    "BYDAY": [
                        "MO",
                        "WE",
                        "FR",
                    ],
                },
            ).response
            result = bitrix_response.result
            print(result)
        except BitrixAPIError as error:
            print(
                "Bitrix API error",
                f"error: {error.error}",
                f"error_description: {error.error_description}",
                sep="\n",
            )
        except BitrixSDKException as error:
            print(f"Bitrix SDK error: {error.message}")
        except Exception as error:
            print(f"Unexpected error: {error}")
        
try {
            $response = $b24Service
                ->core
                ->call(
                    'calendar.event.add',
                    [
                        'type'           => 'company_calendar',
                        'ownerId'        => '',
                        'from'           => '2025-01-31T18:00:00',
                        'to'             => '2025-01-31T20:00:00',
                        'section'        => 1,
                        'name'           => 'Important Meeting',
                        'skip_time'      => 'N',
                        'timezone_from'  => 'Europe/Berlin',
                        'timezone_to'    => 'Europe/Berlin',
                        'description'    => 'Event description',
                        'color'          => '%23FF0000',
                        'text_color'     => '%23000000',
                        'accessibility'  => 'busy',
                        'importance'     => 'high',
                        'private_event'  => 'N',
                        'rrule'          => [
                            'FREQ'     => 'WEEKLY',
                            'COUNT'    => 10,
                            'INTERVAL' => 1,
                            'BYDAY'    => ['MO', 'WE', 'FR']
                        ],
                        'is_meeting'     => 'Y',
                        'location'       => 'Conference Room',
                        'remind'         => [
                            ['type' => 'min', 'count' => 30]
                        ],
                        'attendees'      => [29, 93],
                        'meeting'        => [
                            'notify'       => true,
                            'reinvite'     => false,
                            'allow_invite' => true,
                            'hide_guests'  => false
                        ]
                    ]
                );
        
            $result = $response
                ->getResponseData()
                ->getResult();
        
            echo 'Event added successfully: ' . print_r($result, true);
        
        } catch (Throwable $e) {
            error_log($e->getMessage());
            echo 'Error adding event: ' . $e->getMessage();
        }
        
BX24.callMethod(
            'calendar.event.add',
            {
                type: 'company_calendar', // Calendar type: company calendar
                ownerId: '', // For the company calendar, ownerId is empty
                from: '2025-01-31T18:00:00', // Start date and time of the event
                to: '2025-01-31T20:00:00', // End date and time of the event
                section: 1, // Calendar identifier
                name: 'Important Meeting', // Event name
                skip_time: 'N', // Use date and time (N)
                timezone_from: 'Europe/Berlin', // Timezone of the event start
                timezone_to: 'Europe/Berlin', // Timezone of the event end
                description: 'Event description', // Event description
                color: '%23FF0000', // Background color of the event (red)
                text_color: '%23000000', // Text color of the event (black)
                accessibility: 'busy', // Availability during the event: busy
                importance: 'high', // Event importance: high
                private_event: 'N', // Event is not private
                rrule: { // Event recurrence parameters
                    FREQ: 'WEEKLY', // Recurrence frequency: weekly
                    COUNT: 10, // Number of recurrences
                    INTERVAL: 1, // Interval between recurrences
                    BYDAY: ['MO', 'WE', 'FR'] // Days of the week: Monday, Wednesday, Friday
                },
                is_meeting: 'Y', // Indicator of a meeting with participants
                location: 'Conference Room', // Venue
                remind: [ // Event reminders
                    { type: 'min', count: 30 } // Reminder 30 minutes before the event
                ],
                attendees: [29, 93], // List of identifiers of event participants
                meeting: { // Meeting parameters
                    notify: true, // Notification of confirmation or refusal by participants
                    reinvite: false, // Do not request re-confirmation of participation
                    allow_invite: true, // Allow participants to invite others
                    hide_guests: false // Do not hide the list of participants
                }
            },
            function(result) {
                if(result.error()) {
                    console.error(result.error()); // Error handling
                } else {
                    console.log('Event added successfully', result.data()); // Successful event addition
                }
            }
        );
        
require_once('crest.php');
        
        $result = CRest::call(
            'calendar.event.add',
            [
                'type' => 'company_calendar', // Calendar type: company calendar
                'ownerId' => '', // For the company calendar, ownerId is empty
                'from' => '2025-01-31T18:00:00', // Start date and time of the event
                'to' => '2025-01-31T20:00:00', // End date and time of the event
                'section' => 1, // Calendar identifier (replace with actual)
                'name' => 'Important Meeting', // Event name
                'skip_time' => 'N', // Use date and time (N)
                'timezone_from' => 'Europe/Berlin', // Timezone of the event start
                'timezone_to' => 'Europe/Berlin', // Timezone of the event end
                'description' => 'Event description', // Event description
                'color' => '#FF0000', // Background color of the event (red)
                'text_color' => '#000000', // Text color of the event (black)
                'accessibility' => 'busy', // Availability during the event: busy
                'importance' => 'high', // Event importance: high
                'private_event' => 'N', // Event is not private
                'rrule' => [ // Event recurrence parameters
                    'FREQ' => 'WEEKLY', // Recurrence frequency: weekly
                    'COUNT' => 10, // Number of recurrences
                    'INTERVAL' => 1, // Interval between recurrences
                    'BYDAY' => ['MO', 'WE', 'FR'] // Days of the week: Monday, Wednesday, Friday
                ],
                'is_meeting' => 'Y', // Indicator of a meeting with participants
                'location' => 'Conference Room', // Venue
                'remind' => [ // Event reminders
                    ['type' => 'min', 'count' => 30] // Reminder 30 minutes before the event
                ],
                'attendees' => [29, 93], // List of identifiers of event participants
                'meeting' => [ // Meeting parameters
                    'notify' => true, // Notification of confirmation or refusal by participants
                    'reinvite' => false, // Do not request re-confirmation of participation
                    'allow_invite' => true, // Allow participants to invite others
                    'hide_guests' => false // Do not hide the list of participants
                ]
            ]
        );
        
        if (isset($result['error'])) {
            echo 'Error: ' . $result['error_description']; // Error handling
        } else {
            echo 'Event added successfully: ';
            print_r($result['result']); // Successful event addition
        }
        
// client and ctx are already created — see the Go SDK section
        res, err := client.Core().Call(ctx, "calendar.event.add", b24.Params{
        	"type":          "company_calendar",
        	"ownerId":       "",
        	"from":          "2025-01-31T18:00:00",
        	"to":            "2025-01-31T20:00:00",
        	"section":       1,
        	"name":          "Important Meeting",
        	"skip_time":     "N",
        	"timezone_from": "Europe/Berlin",
        	"timezone_to":   "Europe/Berlin",
        	"description":   "Event description",
        	"color":         "#FF0000",
        	"text_color":    "#000000",
        	"accessibility": "busy",
        	"importance":    "high",
        	"private_event": "N",
        	"rrule": b24.Params{
        		"FREQ":     "WEEKLY",
        		"COUNT":    10,
        		"INTERVAL": 1,
        		"BYDAY":    []string{"MO", "WE", "FR"},
        	},
        	"is_meeting": "Y",
        	"location":   "Conference Room",
        	"remind": []b24.Params{
        		{
        			"type":  "min",
        			"count": 30,
        		},
        	},
        	"attendees": []int{29, 93},
        	"meeting": b24.Params{
        		"notify":       true,
        		"reinvite":     false,
        		"allow_invite": true,
        		"hide_guests":  false,
        	},
        })
        if err != nil {
        	return fmt.Errorf("calendar.event.add: %w", err)
        }
        
        var newID b24.ID
        if err := json.Unmarshal(res.Result, &newID); err != nil {
        	return fmt.Errorf("parse response: %w", err)
        }
        fmt.Println("id:", newID)
        

Response Handling

HTTP Status: 200

{
            "result": 1246,
            "time": {
                "start": 1733318565.183275,
                "finish": 1733318565.695058,
                "duration": 0.5117831230163574,
                "processing": 0.29406094551086426,
                "date_start": "2024-12-04T13:22:45+00:00",
                "date_finish": "2024-12-04T13:22:45+00:00"
            }
        }
        

Returned Data

Name
type

Description

result
integer

Identifier of the created event

Error Handling

HTTP Status: 400

{
            "error": "",
            "error_description": "The required parameter \"name\" for the method \"calendar.event.add\" is not set"
        }
        

Name
type

Description

error
string

String error code. It consists of digits, Latin letters, and underscores. It may arrive empty — in that case only error_description shows the reason

error_description
string

Error message for the developer. Do not show it to the end user without processing

Possible Error Codes

Code

Error Message

Description

Empty value

The required parameter "type" for the method "calendar.event.add" is not set

The required parameter type is not passed

Empty value

The required parameter "ownerId" for the method "calendar.event.add" is not set

The required parameter ownerId is not passed

Empty value

The required parameter "name" for the method "calendar.event.add" is not set

The required parameter name is not passed

Empty value

The required parameter "from" for the method "calendar.event.add" is not set

The required parameter from or from_ts is not passed

Empty value

The required parameter "to" for the method "calendar.event.add" is not set

The required parameter to or to_ts is not passed

Empty value

Invalid value for the parameter "name"

Incorrect data format in the name field

Empty value

Invalid value for the parameter "description"

Incorrect data format in the description field

Empty value

Access denied

Creation of events in the specified calendar is prohibited

Empty value

You specified an invalid calendar section ID or the user does not have access to it

An identifier of an inaccessible or non-existent calendar is passed

Empty value

The list of event links to CRM must be an array

Incorrect data format in the crm_fields field

Empty value

An error occurred while creating the event

Another error

Statuses and System Error Codes

HTTP Status: 4xx, 5xx

The errors described below are returned by the REST API itself, not by the logic of a specific method. They can arrive in response to any method.

Status

Code
Error Message

Description

500

INTERNAL_SERVER_ERROR
Internal server error

An internal server error has occurred. Retry the call, and if the error persists, contact the server administrator or Bitrix24 technical support

500

ERROR_UNEXPECTED_ANSWER
Server returned an unexpected response

The server returned an unexpected response. Retry the call, and if the error persists, contact the server administrator or Bitrix24 technical support

503

QUERY_LIMIT_EXCEEDED
Too many requests

The request intensity limit has been exceeded

429

OPERATION_TIME_LIMIT
Method is blocked due to operation time limit

The method is blocked because the request resource intensity limit has been exceeded. The block is lifted automatically once the accumulated execution time of the method no longer exceeds the limit

401

NO_AUTH_FOUND
Wrong authorization data

The request contains no authorization data: neither an access token nor a webhook code was passed

401

INVALID_REQUEST
Https required

Methods are called over the HTTPS protocol only

401

OVERLOAD_LIMIT
REST API is blocked due to overload

The REST API is blocked due to overload. This is a manual individual block. To have it lifted, contact Bitrix24 technical support

401

ACCESS_DENIED
REST is available only on commercial plans

REST API access is not active for this account. In Bitrix24 Cloud, check the current plan or trial status: Vibe+ plans include REST API access, while Essentials plans do not. A webhook receives a different error message — REST is available only by subscription

401

INVALID_CREDENTIALS
Invalid request credentials

No active webhook with the specified user identifier and secret code was found

404

ERROR_METHOD_NOT_FOUND
Method not found!

No method with this name was found. The name is misspelled, the method does not exist in the REST API, or it is unavailable without the required scope

401

insufficient_scope
The request requires higher privileges than provided by the webhook token

The request requires broader permissions than the token has: for a webhook these are the permissions granted to it, for an application it is the scope. For an application, the error message ends with provided by the access token

401

expired_token
The access token provided has expired

The access token has expired

401

user_access_error
The user does not have access to the application

The application is installed, but the Bitrix24 administrator has granted access to it only to specific users

403

PORTAL_DELETED
Portal was deleted

The public part of the site is closed. To open it 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