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:
imWho 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 |
Description |
|
LAST_ID |
Identifier of the last notification on the previous page — the Do not pass it for the first page. Pass it together with |
|
LAST_TYPE |
Type of the last notification on the previous page. Allowed values:
Do not pass it for the first page. Pass it together with If you pass |
|
LIMIT |
Number of notifications per page. Default is Do not pass |
|
CONVERT_TEXT |
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.
- Request the first page without
LAST_IDandLAST_TYPE - Take the last element of the
notificationsarray. Pass itsidinLAST_ID. If itsnotify_typeequals1, passLAST_TYPE=1, otherwiseLAST_TYPE=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 |
Description |
|
result |
Object with notifications and their authors (detailed description) |
|
time |
Information about the execution time of the request |
Result Object
|
Name |
Description |
|
total_count |
Total number of the user's notifications |
|
total_unread_count |
Number of unread notifications |
|
chat_id |
Identifier of the user's system notification chat |
|
notifications |
Array of notifications on the page (detailed description) |
|
users |
Array of notification authors on the page (detailed description). System notifications with |
If the user has no notifications, result contains only the empty notifications and users arrays.
Notification Object
|
Name |
Description |
|
id |
Identifier of the notification. Use the |
|
chat_id |
Identifier of the user's system notification chat |
|
author_id |
Identifier of the notification author. For system notifications — |
|
date |
Date and time the notification was created |
|
notify_type |
Type of notification. Possible values:
Use the value of the last element to choose |
|
notify_module |
Identifier of the module that sent the notification |
|
notify_event |
Code of the notification event |
|
notify_tag |
Notification tag or an empty string |
|
notify_sub_tag |
Additional notification tag or an empty string |
|
notify_title |
Title of the notification or an empty string |
|
setting_name |
Notification type code in the format |
|
text |
Text of the notification. Formatting is passed as BB codes, for example |
|
params |
Additional parameters of the notification, for example an |
|
notify_read |
Read status of the notification. Possible values: |
|
notify_buttons |
JSON string with the notification buttons. The field is present only in notifications with |
Users Object
|
Name |
Description |
|
id |
Identifier of the user |
|
active |
User's activity status |
|
name |
User's full name |
|
first_name |
User's first name |
|
last_name |
User's last name |
|
work_position |
User's position or |
|
color |
User's color in hex format |
|
avatar |
Link to the avatar or an empty string |
|
avatar_hr |
Link to the high-resolution avatar or an empty string |
|
gender |
User's gender. Possible values: |
|
birthday |
Birthday in |
|
extranet |
Extranet user status |
|
network |
Bitrix24 Network user status |
|
bot |
Bot status |
|
connector |
Open Channels user status |
|
external_auth_id |
External authorization code |
|
internal_account |
Internal account flag: |
|
intranet_user |
Employee flag: the user has a department and an internal account |
|
status |
User's status |
|
idle |
Always |
|
last_activity_date |
User's last activity date or |
|
mobile_last_date |
Always |
|
desktop_last_date |
Always |
|
absent |
User's absence end date or |
|
departments |
Array of department identifiers |
|
phones |
User's phones (detailed description) or |
|
bot_data |
Bot data or |
|
type |
User type. Possible values: |
|
website |
User's website |
|
email |
User's email |
Phones Object
The object contains only the phones that are filled in.
|
Name |
Description |
|
work_phone |
Work phone |
|
personal_mobile |
Mobile phone |
|
inner_phone |
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 |
Description |
|
error |
String error code. It consists of digits, Latin letters, and underscores. It may arrive empty — in that case only |
|
error_description |
Error message for the developer. Do not show it to the end user without processing |
Possible Error Codes
|
Status |
Code |
Description |
Value |
|
|
|
Parameters LAST_ID and LAST_TYPE should be used together |
Only one parameter from the pair |
|
|
|
Last notification ID can't be string |
The |
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 |
Description |
|
|
|
An internal server error has occurred. Retry the call, and if the error persists, contact the server administrator or Bitrix24 technical support |
|
|
|
The server returned an unexpected response. Retry the call, and if the error persists, contact the server administrator or Bitrix24 technical support |
|
|
|
The request intensity limit has been exceeded |
|
|
|
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 |
|
|
|
The request contains no authorization data: neither an access token nor a webhook code was passed |
|
|
|
Methods are called over the HTTPS protocol only |
|
|
|
The REST API is blocked due to overload. This is a manual individual block. To have it lifted, contact Bitrix24 technical support |
|
|
|
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 — |
|
|
|
No active webhook with the specified user identifier and secret code was 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 |
|
|
|
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 |
|
|
|
The access token has expired |
|
|
|
The application is installed, but the Bitrix24 administrator has granted access to it only to specific users |
|
|
|
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
- Send Notification im.notify
- Send Personal Notification im.notify.personal.add
- Send System Notification im.notify.system.add
- Get Notification Type Schema im.notify.schema.get
- Read the list of notifications im.notify.read.list
- Read or Mark Notification as Unread im.notify.read
- Read All Notifications im.notify.read.all
- Responding to Notifications with Quick Response im.notify.answer
- Interacting with Notification Buttons im.notify.confirm
- Delete Notification im.notify.delete
- Searching Notification History im.notify.history.search