Get Event by ID calendar.event.getbyid

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

The calendar.event.getbyid method retrieves information about a calendar event by its identifier.

Method Parameters

Required parameters are marked with *

Name
type

Description

id*
integer

Identifier of the event.

You can obtain the identifier using the calendar.event.get or calendar.event.get.nearest methods

Code Examples

How to Use Examples in Documentation

curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{"id":324}' \
        https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/calendar.event.getbyid
        
curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{"id":324,"auth":"**put_access_token_here**"}' \
        https://**put_your_bitrix24_address**/rest/calendar.event.getbyid
        
// 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 CalendarEventResult = {
          ID: string
          PARENT_ID: string
          DELETED: string
          CAL_TYPE: string
          OWNER_ID: string
          NAME: string
          DATE_FROM: string
          DATE_TO: string
          DESCRIPTION: string
          EVENT_TYPE: string
          TZ_FROM: string
          TZ_TO: string
          SECTION_ID: string
          CREATED_BY: string
          ACCESSIBILITY: string
          IMPORTANCE: string
          IS_MEETING: boolean
          MEETING_STATUS: string
          COLOR: string
          LOCATION: string
        }
        
        try {
          const response = await $b24.actions.v2.call.make<CalendarEventResult>({
            method: 'calendar.event.getbyid',
            params: {
              id: 324,
            },
            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('Event:', result.ID, result.NAME, result.DATE_FROM, result.DATE_TO)
          }
        } 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 getCalendarEventById() {
            try {
              // Initialize the SDK inside a Bitrix24 frame
              const $b24 = await B24Js.initializeB24Frame()
        
              const response = await $b24.actions.v2.call.make({
                method: 'calendar.event.getbyid',
                params: {
                  id: 324,
                },
                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('Event:', result.ID, result.NAME, result.DATE_FROM, result.DATE_TO)
            } catch (error) {
              // Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
              console.error(error)
            }
          }
        
          document.addEventListener('DOMContentLoaded', getCalendarEventById)
        </script>
        
from b24pysdk.errors import BitrixAPIError, BitrixSDKException
        
        try:
            bitrix_response = client.calendar.event.getbyid(
                bitrix_id=324,
            ).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.getbyid',
                    [
                        'id' => 324
                    ]
                );
        
            $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 event by ID: ' . $e->getMessage();
        }
        
BX24.callMethod(
            'calendar.event.getbyid',
            {
                id: 324
            }
        );
        
require_once('crest.php');
        
        $result = CRest::call(
            'calendar.event.getbyid',
            [
                'id' => 324
            ]
        );
        
        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.getbyid", b24.Params{
        	"id": 324,
        })
        if err != nil {
        	return fmt.Errorf("calendar.event.getbyid: %w", err)
        }
        
        var item struct {
        	ID       b24.ID `json:"ID"`
        	ParentID b24.ID `json:"PARENT_ID"`
        	Deleted  string `json:"DELETED"`
        	CalType  string `json:"CAL_TYPE"`
        	OwnerID  b24.ID `json:"OWNER_ID"`
        	Name     string `json:"NAME"`
        }
        if err := json.Unmarshal(res.Result, &item); err != nil {
        	return fmt.Errorf("parse response: %w", err)
        }
        fmt.Println(item.ID, item.ParentID)
        

Response Handling

HTTP status: 200

{
            "result": {
                "ID": "1265",
                "PARENT_ID": "1265",
                "DELETED": "N",
                "CAL_TYPE": "user",
                "OWNER_ID": "1",
                "NAME": "Event Name",
                "DATE_FROM": "12/11/2024 05:59:00 pm",
                "DATE_TO": "12/11/2024 06:59:00 pm",
                "ORIGINAL_DATE_FROM": null,
                "TZ_FROM": "Europe/Riga",
                "TZ_TO": "Europe/Riga",
                "TZ_OFFSET_FROM": "7200",
                "TZ_OFFSET_TO": "7200",
                "DATE_FROM_TS_UTC": "1733932740",
                "DATE_TO_TS_UTC": "1733936340",
                "DT_SKIP_TIME": "N",
                "DT_LENGTH": 3600,
                "EVENT_TYPE": null,
                "CREATED_BY": "1",
                "DATE_CREATE": "12/05/2024 01:48:41 pm",
                "TIMESTAMP_X": "12/05/2024 01:48:41 pm",
                "DATE_CREATE_ISO": "2024-12-05T13:48:41+02:00",
                "TIMESTAMP_X_ISO": "2024-12-05T13:48:41+02:00",
                "DESCRIPTION": "Description for event",
                "PRIVATE_EVENT": "",
                "ACCESSIBILITY": "free",
                "IMPORTANCE": "normal",
                "IS_MEETING": true,
                "MEETING_STATUS": "H",
                "MEETING_HOST": "1",
                "MEETING": {
                    "HOST_NAME": "User Name",
                    "NOTIFY": false,
                    "REINVITE": false,
                    "ALLOW_INVITE": false,
                    "HIDE_GUESTS": false,
                    "MEETING_CREATOR": 1,
                    "LANGUAGE_ID": "de",
                    "MAIL_FROM": ""
                },
                "LOCATION": "test location",
                "REMIND": [
                    {
                        "type": "min",
                        "count": 50
                    }
                ],
                "COLOR": "#9dcf00",
                "RRULE": {
                    "FREQ": "WEEKLY",
                    "BYDAY": {
                        "MO": "MO",
                        "WE": "WE"
                    },
                    "INTERVAL": 1,
                    "UNTIL": "12/24/2024",
                    "~UNTIL": "12/24/2024",
                    "UNTIL_TS": 1734998400
                },
                "EXDATE": "11/28/2024;12/05/2024;12/12/2024;12/19/2024;12/26/2024",
                "DAV_XML_ID": "20241211T155900Z-534185204b362e9be7e261e92ccd9078@b24evo.lan",
                "G_EVENT_ID": "",
                "DAV_EXCH_LABEL": "",
                "CAL_DAV_LABEL": "",
                "VERSION": "1",
                "ATTENDEES_CODES": [
                    "U1"
                ],
                "RECURRENCE_ID": 1272,
                "RELATIONS": {
                    "ORIGINAL_RECURSION_ID": 1271,
                    "COMMENT_XML_ID": "EVENT_1271_12/23/2024"
                },
                "SECTION_ID": "4",
                "SYNC_STATUS": null,
                "UF_CRM_CAL_EVENT": [
                    "CO_1",
                    "L_5"
                ],
                "UF_WEBDAV_CAL_EVENT": false,
                "SECTION_DAV_XML_ID": null,
                "DATE_FROM_FORMATTED": "Wed Dec 11 2024 17:59:00",
                "DATE_TO_FORMATTED": "Wed Dec 11 2024 18:59:00",
                "IS_DAYLIGHT_SAVING_TZ": "N",
                "SECT_ID": "4",
                "OPTIONS": null,
                "ATTENDEE_LIST": [
                    {
                        "id": 1,
                        "entryId": "1265",
                        "status": "H"
                    }
                ],
                "COLLAB_ID": null,
                "~RRULE_DESCRIPTION": "every week on: Mon, Wed, from 12/11/2024 to 12/24/2024",
                "attendeesEntityList": [
                    {
                        "entityId": "user",
                        "id": 1
                    }
                ],
                "~DESCRIPTION": "Description for event",
                "~USER_OFFSET_FROM": 7200,
                "~USER_OFFSET_TO": 7200
            },
            "time": {
                "start": 1733406529.495513,
                "finish": 1733406529.744687,
                "duration": 0.2491741180419922,
                "processing": 0.0327458381652832,
                "date_start": "2024-12-05T13:48:49+00:00",
                "date_finish": "2024-12-05T13:48:49+00:00"
            }
        }
        

Returned Data

Name
type

Description

result
object

Calendar event (detailed description).

If no event with the passed id exists, null

time
time

Information about the request execution time

Event Object

Name
type

Description

ID
string

Event identifier

PARENT_ID
string

Identifier of the parent event

ACTIVE
string

Flag indicating whether the event is active. Possible values:

  • Y — event is active
  • N — event is inactive

The calendar.event.getbyid method does not return this field

DELETED
string

Flag indicating whether the event is deleted. Possible values:

  • Y — event is deleted
  • N — event is not deleted

The Y value is returned only in the calendar.event.get response when the modified_since parameter is passed

CAL_TYPE
string

Type of calendar in which the event is located

OWNER_ID
string

Identifier of the calendar owner:

  • id of the user for the calendar type user
  • id of the group for the calendar type group

NAME
string

Event name

DATE_FROM
datetime

Start date of the event

DATE_TO
datetime

End date of the event

ORIGINAL_DATE_FROM
datetime

Start date of the original event for recurring events

TZ_FROM
string

Timezone of the event start date.

The calendar.event.get.nearest method does not return this field

TZ_TO
string

Timezone of the event end date.

The calendar.event.get.nearest method does not return this field

TZ_OFFSET_FROM
string

Time offset of the event start time relative to UTC in seconds.

The calendar.event.get.nearest method does not return this field

TZ_OFFSET_TO
string

Time offset of the event end time relative to UTC in seconds.

The calendar.event.get.nearest method does not return this field

DATE_FROM_TS_UTC
string

Start date and time of the event in timestamp format.

Despite the field name, the value is shifted by the server time zone offset, so it cannot be read as UTC time. The exact start time is defined by the DATE_FROM and TZ_FROM fields

DATE_TO_TS_UTC
string

End date and time of the event in timestamp format.

Despite the field name, the value is shifted by the server time zone offset, so it cannot be read as UTC time. The exact end time is defined by the DATE_TO and TZ_TO fields

DT_SKIP_TIME
string

Flag indicating that the event lasts all day. Possible values:

  • Y — all day
  • N — not all day

DT_LENGTH
integer

Duration of the event in seconds

EVENT_TYPE
string

Type of event

CREATED_BY
string

Identifier of the user who created the event

DATE_CREATE
datetime

Date the event was created

TIMESTAMP_X
datetime

Date the event was modified

DATE_CREATE_ISO
string

Date the event was created, in ISO 8601 format with the account time zone offset, for example 2026-10-08T10:27:29+03:00.

The field is not returned if the creation date is empty

TIMESTAMP_X_ISO
string

Date the event was modified, in ISO 8601 format with the account time zone offset.

Pass this value to the modified_since parameter of the calendar.event.get method to retrieve events modified since that moment. All occurrences of a recurring event have the same value. The field is not returned if the modification date is empty

DESCRIPTION
string

Description of the event

DT_FROM
string

Service field. Returned with the null value

The calendar.event.getbyid method does not return this field

DT_TO
string

Service field. Returned with the null value

The calendar.event.getbyid method does not return this field

PRIVATE_EVENT
string

Mark indicating that the event is private. Possible values:

  • Y — private
  • N or an empty string — not private

ACCESSIBILITY
string

Availability of participants during the event. Possible values:

  • busy — occupied
  • absent — away
  • quest — undecided
  • free — free

IMPORTANCE
string

Importance of the event. Possible values:

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

IS_MEETING
boolean

Indicator of a meeting with event participants. Possible values:

  • true — meeting with participants
  • false — event without participants

MEETING_STATUS
string

Status of participation in the event. Possible values:

  • Y — accepted
  • N — declined
  • Q — invited but not yet responded
  • H — event organizer

MEETING_HOST
string

Identifier of the user hosting the event

MEETING
object

Meeting settings (detailed description)

LOCATION
string

Identifier or name of the event location

REMIND
array

Array of objects describing event reminders (detailed description)

COLOR
string

Background color of the event

TEXT_COLOR
string

Text color of the event. If no color is set, an empty string

The calendar.event.getbyid method does not return this field

RRULE
object

Recurrence of the event in the form of an object in terms of the iCalendar standard (detailed description). For a non-recurring event, an empty string

EXDATE
string

List of exception dates from the recurrence rule

DAV_XML_ID
string

Synchronization identifier

G_EVENT_ID
string

Synchronization identifier

DAV_EXCH_LABEL
string

Exchange synchronization identifier

CAL_DAV_LABEL
string

Synchronization identifier

VERSION
string

Version of event changes

ATTENDEES_CODES
array

Identifiers of event participants

RECURRENCE_ID
string

Identifier of the original event when editing only the current one

RELATIONS
object

Object for recurring events with information about relationships to the original event (detailed description). For a non-recurring event, an empty string

SECTION_ID
string

Identifier of the calendar in which the event is located

SYNC_STATUS
string

Synchronization status of the event

UF_CRM_CAL_EVENT
array

Array of identifiers of CRM objects linked to the event, for example CO_1 or L_5. If there are no links, null

UF_WEBDAV_CAL_EVENT
array

Array of identifiers of files linked to the event

SECTION_DAV_XML_ID
array

Synchronization identifier of the event calendar

DATE_FROM_FORMATTED
string

Formatted start date of the event

DATE_TO_FORMATTED
string

Formatted end date of the event

IS_DAYLIGHT_SAVING_TZ
string

Flag indicating daylight saving time in the TZ_FROM time zone. Possible values:

  • Y — the time zone observes daylight saving time
  • N — no daylight saving time

SECT_ID
string

Identifier of the calendar in which the event is located

OPTIONS
object

Additional parameters of an event with a category, for example the category identifier CATEGORY_ID and the number of participants ATTENDEES_COUNT. For a regular event, null

ATTENDEE_LIST
array

Array of objects describing event participants and their participation statuses (detailed description)

COLLAB_ID
integer

Identifier of the collaboration in which the event was created

~RRULE_DESCRIPTION
string

Text description of the event recurrence rule

attendeesEntityList
array

Array of objects describing users — event participants (detailed description)

~DESCRIPTION
string

Description of the event

~USER_OFFSET_FROM
integer

Time offset of the event start time relative to the current user's timezone

~USER_OFFSET_TO
integer

Time offset of the event end time relative to the current user's timezone

DT_FROM_TS
integer

Start date and time of the event in timestamp format, adjusted to the current user's time zone.

Only the calendar.event.get.nearest method returns this field

DT_TO_TS
integer

End date and time of the event in timestamp format, adjusted to the current user's time zone.

Only the calendar.event.get.nearest method returns this field

~URL
string

Link to the event in the calendar.

Only the calendar.event.get.nearest method returns this field

~WEEK_DAY
string

Abbreviated name of the day of the week on which the event starts.

Only the calendar.event.get.nearest method returns this field

~detailUrl
string

Link to the event built from the template in the detailUrl parameter.

Only the calendar.event.get.nearest method returns this field, if the detailUrl parameter is passed

~FROM_TO_HTML
string

Date and time of the event as a display string, for example 11/20/2026, 10:00 am - 11:00 am.

Only the calendar.event.get.nearest method returns this field

MEETING Object

Name
type

Description

HOST_NAME
string

Name of the user hosting the event

NOTIFY
boolean

Flag for notifying about confirmation or decline of participants

REINVITE
boolean

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

ALLOW_INVITE
boolean

Flag allowing participants to invite others to the event

HIDE_GUESTS
boolean

Flag for hiding the list of participants

MEETING_CREATOR
integer

Identifier of the event creator

LANGUAGE_ID
string

Language identifier for event notifications

MAIL_FROM
string

Sender's address for notifications

REMIND Object

Name
type

Description

type
string

Time type of the reminder

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

count
integer

Numerical value of the time interval

RRULE Object

Name
type

Description

FREQ
string

Frequency of recurrence

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

BYDAY
object

Days of the week

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

INTERVAL
integer

Interval between recurrences

UNTIL
date

End date of recurrences

~UNTIL
date

End date of recurrences. Technical field

UNTIL_TS
integer

End date of recurrences in timestamp format

RELATIONS Object

Name
type

Description

ORIGINAL_RECURSION_ID
integer

Identifier of the original event for recurring events created when editing

COMMENT_XML_ID
string

Identifier of the original event for single events created when editing from recurring ones

ATTENDEE_LIST Objects

Name
type

Description

id
integer

Identifier of the user

entryId
string

Identifier of the event

status
string

Status of the event participant. Possible values:

  • Y — accepted
  • N — declined
  • Q — invited but not yet responded
  • H — event organizer

attendeesEntityList Object

Name
type

Description

entityId
string

Event participant object type

id
integer

Identifier of the event participant

Error Handling

HTTP status: 400

{
            "error": "",
            "error_description": "The mandatory parameter \"id\" is not specified for the method \"calendar.event.getbyid\""
        }
        

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

Status

Code

Description

Value

400

Empty value

The mandatory parameter "id" is not specified for the method "calendar.event.getbyid"

The required parameter id was not provided

400

Empty value

Access denied

Access to the method is prohibited for external users

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

Continue Learning