Get Notifications im.notify.get

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: im

Who can execute the method: any user

The method im.notify.get returns the current user's notifications page by page.

Method Parameters

Required parameters are marked with *

Name
Type

Description

LAST_ID
integer

Identifier of the last notification on the previous page — the id field of the last element in the notifications array. The method returns notifications with an identifier less than LAST_ID.

Do not pass it for the first page. Pass it together with LAST_TYPE, otherwise the method returns the LAST_ID_AND_LAST_TYPE error. The value must contain digits only, otherwise the method returns the LAST_ID_STRING error

LAST_TYPE
integer

Type of the last notification on the previous page. Allowed values:

  • 1 — the last notification requires confirmation, its notify_type field equals 1
  • 3 — the last notification is a regular one, its notify_type field equals 2 or 4

Do not pass it for the first page. Pass it together with LAST_ID.

If you pass 1 when the last notification was a regular one, the method returns regular notifications from the beginning of the list, and they are repeated. For other values, the method returns an empty notifications array

LIMIT
integer

Number of notifications per page. Default is 50, maximum is 50. The method reduces a larger value to 50.

Do not pass 0 or negative values: the method will not return regular notifications

CONVERT_TEXT
string

The method accepts the parameter but ignores it

How to Retrieve All Notifications

The method sorts notifications by descending creation date, then by descending id. Notifications that require confirmation go on the page first, then the method fills the rest of the page with regular notifications.

  1. Request the first page without LAST_ID and LAST_TYPE
  2. Take the last element of the notifications array. Pass its id in LAST_ID. If its notify_type equals 1, pass LAST_TYPE = 1, otherwise LAST_TYPE = 3
  3. Repeat step 2 until the method returns fewer notifications than LIMIT

The response does not contain a ready-made cursor for the next page: calculate LAST_ID and LAST_TYPE from the last element.

Code Examples

How to Use Examples in Documentation

curl -X POST \
          -H "Content-Type: application/json" \
          -H "Accept: application/json" \
          -d '{"LAST_ID":1500,"LAST_TYPE":3,"LIMIT":20}' \
          https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/im.notify.get
        
curl -X POST \
          -H "Content-Type: application/json" \
          -H "Accept: application/json" \
          -d '{"LAST_ID":1500,"LAST_TYPE":3,"LIMIT":20,"auth":"**put_access_token_here**"}' \
          https://**put_your_bitrix24_address**/rest/im.notify.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
        
        type NotificationItem = {
          id: number
          chat_id: number
          author_id: number
          date: ISODate
          notify_type: number
          notify_module: string
          notify_event: string
          notify_tag: string
          notify_sub_tag: string
          notify_title: string
          setting_name: string
          text: string
          params: object | null
          notify_read: 'Y' | 'N'
          notify_buttons?: string
        }
        
        type UserItem = {
          id: number
          active: boolean
          name: string
          first_name: string
          last_name: string
          work_position: string | null
          color: string
          avatar: string
          avatar_hr: string
          gender: 'M' | 'F'
          birthday: string
          extranet: boolean
          network: boolean
          bot: boolean
          connector: boolean
          external_auth_id: string
          internal_account: boolean
          intranet_user: boolean
          status: string
          idle: ISODate | false
          last_activity_date: ISODate | false
          mobile_last_date: ISODate | false
          desktop_last_date: ISODate | false
          absent: ISODate | false
          departments: number[]
          phones: Record<string, string> | false
          bot_data: object | null
          type: string
          website: string
          email: string
        }
        
        // Shape of the payload returned in result (match the "response handling" section of the page)
        // total_count, total_unread_count and chat_id are absent when the user has no notifications
        type ImNotifyGetResult = {
          total_count?: number
          total_unread_count?: number
          chat_id?: number
          notifications: NotificationItem[]
          users: UserItem[]
        }
        
        try {
          const response = await $b24.actions.v2.call.make<ImNotifyGetResult>({
            method: 'im.notify.get',
            params: {
              LAST_ID: 1500,
              LAST_TYPE: 3,
              LIMIT: 20,
            },
            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('Notifications on page:', result.notifications.length)
        
            // Cursor for the next page is built from the last notification
            const last = result.notifications.at(-1)
            if (last && result.notifications.length === 20) {
              console.info('Next page:', { LAST_ID: last.id, LAST_TYPE: last.notify_type === 1 ? 1 : 3 })
            }
          }
        } 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 getNotifications() {
            try {
              // Initialize the SDK inside a Bitrix24 frame
              const $b24 = await B24Js.initializeB24Frame()
        
              const response = await $b24.actions.v2.call.make({
                method: 'im.notify.get',
                params: {
                  LAST_ID: 1500,
                  LAST_TYPE: 3,
                  LIMIT: 20,
                },
                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('Notifications on page:', result.notifications.length)
        
              // Cursor for the next page is built from the last notification
              const last = result.notifications.at(-1)
              if (last && result.notifications.length === 20) {
                console.info('Next page:', { LAST_ID: last.id, LAST_TYPE: last.notify_type === 1 ? 1 : 3 })
              }
            } catch (error) {
              // Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
              console.error(error)
            }
          }
        
          document.addEventListener('DOMContentLoaded', getNotifications)
        </script>
        
from b24pysdk.errors import BitrixAPIError, BitrixSDKException
        
        try:
            bitrix_response = client.im.notify.get(
                last_id=1500,
                last_type=3,
                limit=20,
            ).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(
                'im.notify.get',
                [
                    'LAST_ID' => 1500,
                    'LAST_TYPE' => 3,
                    'LIMIT' => 20,
                ]
            );
        
            $result = $response->getResponseData()->getResult();
        
            print_r($result);
        } catch (Throwable $exception) {
            echo $exception->getMessage();
        }
        
BX24.callMethod(
            'im.notify.get',
            {
                LAST_ID: 1500,
                LAST_TYPE: 3,
                LIMIT: 20,
            },
            function(result) {
                if (result.error()) {
                    console.error(result.error().ex);
                } else {
                    console.log(result.data());
                }
            }
        );
        
require_once('crest.php');
        
        $result = CRest::call(
            'im.notify.get',
            [
                'LAST_ID' => 1500,
                'LAST_TYPE' => 3,
                'LIMIT' => 20,
            ]
        );
        
        if (!empty($result['error'])) {
            echo 'Error: ' . $result['error_description'];
        } else {
            var_dump($result['result']);
        }
        
// client and ctx are already created — see the Go SDK section
        res, err := client.Core().Call(ctx, "im.notify.get", b24.Params{
        	"LAST_ID":   1500,
        	"LAST_TYPE": 3,
        	"LIMIT":     20,
        }, b24.WithIdempotent())
        if err != nil {
        	return fmt.Errorf("im.notify.get: %w", err)
        }
        
        var item struct {
        	TotalCount       int `json:"total_count"`
        	TotalUnreadCount int `json:"total_unread_count"`
        	ChatID           int `json:"chat_id"`
        	Notifications    []struct {
        		ID         int    `json:"id"`
        		NotifyType int    `json:"notify_type"`
        		Text       string `json:"text"`
        	} `json:"notifications"`
        }
        if err := json.Unmarshal(res.Result, &item); err != nil {
        	return fmt.Errorf("parse response: %w", err)
        }
        fmt.Println(item.TotalCount, item.TotalUnreadCount, len(item.Notifications))
        
        // The next page cursor is built from the last notification
        if n := len(item.Notifications); n == 20 {
        	last := item.Notifications[n-1]
        	lastType := 3
        	if last.NotifyType == 1 {
        		lastType = 1
        	}
        	fmt.Println("LAST_ID:", last.ID, "LAST_TYPE:", lastType)
        }
        

Response Handling

HTTP Status: 200

{
            "result": {
                "total_count": 34,
                "total_unread_count": 13,
                "chat_id": 2535,
                "notifications": [
                    {
                        "id": 1499,
                        "chat_id": 2535,
                        "author_id": 0,
                        "date": "2026-11-10T14:30:11+01:00",
                        "notify_type": 4,
                        "notify_module": "rest",
                        "notify_event": "rest_notify",
                        "notify_tag": "",
                        "notify_sub_tag": "",
                        "notify_title": "",
                        "setting_name": "rest|rest_notify",
                        "text": "Invoice [B]#42[/B] has been paid",
                        "params": {
                            "ATTACH": [
                                {
                                    "ID": 1794317528,
                                    "BLOCKS": [
                                        {
                                            "MESSAGE": "Amount: 15,000 EUR"
                                        }
                                    ],
                                    "DESCRIPTION": "",
                                    "COLOR": "#29619b",
                                    "COLOR_TOKEN": "base"
                                }
                            ]
                        },
                        "notify_read": "N"
                    },
                    {
                        "id": 1497,
                        "chat_id": 2535,
                        "author_id": 15,
                        "date": "2026-11-10T14:29:54+01:00",
                        "notify_type": 2,
                        "notify_module": "rest",
                        "notify_event": "rest_notify",
                        "notify_tag": "",
                        "notify_sub_tag": "",
                        "notify_title": "",
                        "setting_name": "rest|rest_notify",
                        "text": "Check the contract by the end of the day",
                        "params": null,
                        "notify_read": "N"
                    }
                ],
                "users": [
                    {
                        "id": 15,
                        "active": true,
                        "name": "Klaus Weber",
                        "first_name": "Klaus",
                        "last_name": "Weber",
                        "work_position": null,
                        "color": "#58cc47",
                        "avatar": "https://cdn.bitrix24.com/b1234567/main/avatar.png",
                        "avatar_hr": "https://cdn.bitrix24.com/b1234567/main/avatar.png",
                        "gender": "M",
                        "birthday": "",
                        "extranet": false,
                        "network": false,
                        "bot": false,
                        "connector": false,
                        "external_auth_id": "socservices",
                        "internal_account": true,
                        "intranet_user": false,
                        "status": "online",
                        "idle": false,
                        "last_activity_date": "2026-11-10T14:28:38+01:00",
                        "mobile_last_date": false,
                        "desktop_last_date": false,
                        "absent": false,
                        "departments": [],
                        "phones": {
                            "personal_mobile": "4915112345678"
                        },
                        "bot_data": null,
                        "type": "user",
                        "website": "",
                        "email": ""
                    }
                ]
            },
            "time": {
                "start": 1794317458,
                "finish": 1794317458.62455,
                "duration": 0.6245501041412354,
                "processing": 0,
                "date_start": "2026-11-10T14:30:58+01:00",
                "date_finish": "2026-11-10T14:30:58+01:00",
                "operating_reset_at": 1794317940,
                "operating": 0.120635986328125
            }
        }
        

Returned Data

Name
Type

Description

result
object

Object with notifications and their authors (detailed description)

time
time

Information about the execution time of the request

Result Object

Name
Type

Description

total_count
integer

Total number of the user's notifications

total_unread_count
integer

Number of unread notifications

chat_id
integer

Identifier of the user's system notification chat

notifications
array

Array of notifications on the page (detailed description)

users
array

Array of notification authors on the page (detailed description). System notifications with author_id = 0 are not included in the array

If the user has no notifications, result contains only the empty notifications and users arrays.

Notification Object

Name
Type

Description

id
integer

Identifier of the notification. Use the id of the last element as LAST_ID for the next page

chat_id
integer

Identifier of the user's system notification chat

author_id
integer

Identifier of the notification author. For system notifications — 0

date
datetime

Date and time the notification was created

notify_type
integer

Type of notification. Possible values:

  • 1 — notification with buttons, requires confirmation
  • 2 — personal notification from a user
  • 4 — system notification

Use the value of the last element to choose LAST_TYPE for the next page

notify_module
string

Identifier of the module that sent the notification

notify_event
string

Code of the notification event

notify_tag
string

Notification tag or an empty string

notify_sub_tag
string

Additional notification tag or an empty string

notify_title
string

Title of the notification or an empty string

setting_name
string

Notification type code in the format MODULE|EVENT. The list of codes is returned by the im.notify.schema.get method

text
string

Text of the notification. Formatting is passed as BB codes, for example [B]...[/B]

params
object

Additional parameters of the notification, for example an ATTACH attachment, or null

notify_read
string

Read status of the notification. Possible values: Y — read, N — unread

notify_buttons
string

JSON string with the notification buttons. The field is present only in notifications with notify_type = 1

Users Object

Name
Type

Description

id
integer

Identifier of the user

active
boolean

User's activity status

name
string

User's full name

first_name
string

User's first name

last_name
string

User's last name

work_position
string

User's position or null

color
string

User's color in hex format

avatar
string

Link to the avatar or an empty string

avatar_hr
string

Link to the high-resolution avatar or an empty string

gender
string

User's gender. Possible values: M — male, F — female

birthday
string

Birthday in DD-MM format or an empty string

extranet
boolean

Extranet user status

network
boolean

Bitrix24 Network user status

bot
boolean

Bot status

connector
boolean

Open Channels user status

external_auth_id
string

External authorization code

internal_account
boolean

Internal account flag: external_auth_id does not belong to external authorization types

intranet_user
boolean

Employee flag: the user has a department and an internal account

status
string

User's status

idle
boolean

Always false in this method

last_activity_date
datetime

User's last activity date or false

mobile_last_date
boolean

Always false in this method

desktop_last_date
boolean

Always false in this method

absent
datetime

User's absence end date or false

departments
array

Array of department identifiers

phones
object

User's phones (detailed description) or false if the user has no phones

bot_data
object

Bot data or null

type
string

User type. Possible values: user, bot, extranet, collaber, guest

website
string

User's website

email
string

User's email

Phones Object

The object contains only the phones that are filled in.

Name
Type

Description

work_phone
string

Work phone

personal_mobile
string

Mobile phone

inner_phone
string

Internal phone

Error Handling

HTTP Status: 400

{
            "error": "LAST_ID_AND_LAST_TYPE",
            "error_description": "Parameters LAST_ID and LAST_TYPE should be used together."
        }
        

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

LAST_ID_AND_LAST_TYPE

Parameters LAST_ID and LAST_TYPE should be used together

Only one parameter from the pair LAST_ID and LAST_TYPE was passed

400

LAST_ID_STRING

Last notification ID can't be string

The LAST_ID value contains characters other than digits, for example abc or -5

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