Searching Notification History im.notify.history.search
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.history.search searches the current user's notifications by text, type, date, and author.
Method Parameters
Required parameters are marked with *
|
Name |
Description |
|
SEARCH_TEXT |
Text to search for in the notification text. The search is case-insensitive. If no other filters are passed, the length without leading and trailing spaces must be at least |
|
SEARCH_TYPE |
Notification type in the format Ignored if |
|
SEARCH_TYPES |
Array of notification types, for example If the array contains one element, the |
|
SEARCH_DATE |
Date and time in RFC 3339 format, for example Ignored if |
|
SEARCH_DATE_FROM |
Start of the period in RFC 3339 format. Pass it together with If you pass only |
|
SEARCH_DATE_TO |
End of the period in RFC 3339 format. Pass it together with |
|
SEARCH_AUTHORS |
Array of notification author identifiers, for example You can retrieve user identifiers with the user.get method |
|
GROUP_TAG |
Notification group for additional filtering. Allowed values:
Works only together with other filters |
|
LAST_ID |
Identifier of the last notification on the previous page — the Do not pass it for the first page. The value must contain digits only, otherwise the method returns the |
|
LIMIT |
Number of notifications per page. Default is Do not pass |
|
CONVERT_TEXT |
The method accepts the parameter but ignores it |
Pass at least one filter: SEARCH_TEXT of at least 3 characters, SEARCH_TYPE, SEARCH_TYPES, SEARCH_DATE, SEARCH_AUTHORS, or the SEARCH_DATE_FROM and SEARCH_DATE_TO pair. Otherwise, the method returns the SEARCH_TEXT_ERROR error. Multiple filters are combined with the AND condition.
How to Retrieve All Search Results
The method sorts notifications by descending creation date, then by descending id.
- Request the first page without
LAST_ID. The response contains thetotal_resultsfield — the total number of found notifications - For the next page, pass the same filters and
LAST_ID=idof the last element of thenotificationsarray. Thetotal_resultsfield is absent on these pages - Repeat step 2 until the method returns fewer notifications than
LIMIT
Code Examples
How to Use Examples in Documentation
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"SEARCH_TEXT":"invoice","SEARCH_TYPE":"rest|rest_notify","SEARCH_DATE_FROM":"2026-11-01T00:00:00+01:00","SEARCH_DATE_TO":"2026-11-10T00:00:00+01:00","LIMIT":20}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/im.notify.history.search
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"SEARCH_TEXT":"invoice","SEARCH_TYPE":"rest|rest_notify","SEARCH_DATE_FROM":"2026-11-01T00:00:00+01:00","SEARCH_DATE_TO":"2026-11-10T00:00:00+01:00","LIMIT":20,"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/im.notify.history.search
// This snippet is an ES module: top-level await requires type="module" or a bundler.
// $b24 is an already-initialized SDK instance (see the SDK "Get started" guide).
import { Text } from '@bitrix24/b24jssdk'
import type { B24Frame, ISODate } from '@bitrix24/b24jssdk'
declare const $b24: B24Frame
// Shape of the payload returned in result (match the "response handling" section of the page)
// total_results is returned only on the first page (without LAST_ID)
type NotifyHistorySearchResult = {
chat_id: number
notifications: Array<{
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
}>
users: Array<{
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: false
last_activity_date: ISODate | false
mobile_last_date: false
desktop_last_date: false
absent: ISODate | false
departments: number[]
phones: Record<string, string> | false
bot_data: object | null
type: string
website: string
email: string
}>
total_results?: number
}
try {
const response = await $b24.actions.v2.call.make<NotifyHistorySearchResult>({
method: 'im.notify.history.search',
params: {
SEARCH_TEXT: 'invoice',
SEARCH_TYPE: 'rest|rest_notify',
SEARCH_DATE_FROM: '2026-11-01T00:00:00+01:00',
SEARCH_DATE_TO: '2026-11-10T00:00:00+01:00',
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('Found:', result.total_results, 'On page:', result.notifications.length)
// Pass the id of the last notification as LAST_ID to get the next page
const last = result.notifications.at(-1)
if (last && result.notifications.length === 20) {
console.info('Next page LAST_ID:', last.id)
}
}
} 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 searchNotifyHistory() {
try {
// Initialize the SDK inside a Bitrix24 frame
const $b24 = await B24Js.initializeB24Frame()
const response = await $b24.actions.v2.call.make({
method: 'im.notify.history.search',
params: {
SEARCH_TEXT: 'invoice',
SEARCH_TYPE: 'rest|rest_notify',
SEARCH_DATE_FROM: '2026-11-01T00:00:00+01:00',
SEARCH_DATE_TO: '2026-11-10T00:00:00+01:00',
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('Found:', result.total_results, 'On page:', result.notifications.length)
// Pass the id of the last notification as LAST_ID to get the next page
const last = result.notifications.at(-1)
if (last && result.notifications.length === 20) {
console.info('Next page LAST_ID:', last.id)
}
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
}
document.addEventListener('DOMContentLoaded', searchNotifyHistory)
</script>
from b24pysdk.errors import BitrixAPIError, BitrixSDKException
try:
bitrix_response = client.im.notify.history.search(
search_text="invoice",
search_type="rest|rest_notify",
search_date_from="2026-11-01T00:00:00+01:00",
search_date_to="2026-11-10T00:00:00+01:00",
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.history.search',
[
'SEARCH_TEXT' => 'invoice',
'SEARCH_TYPE' => 'rest|rest_notify',
'SEARCH_DATE_FROM' => '2026-11-01T00:00:00+01:00',
'SEARCH_DATE_TO' => '2026-11-10T00:00:00+01:00',
'LIMIT' => 20,
]
);
$result = $response->getResponseData()->getResult();
print_r($result);
} catch (Throwable $exception) {
echo $exception->getMessage();
}
BX24.callMethod(
'im.notify.history.search',
{
SEARCH_TEXT: 'invoice',
SEARCH_TYPE: 'rest|rest_notify',
SEARCH_DATE_FROM: '2026-11-01T00:00:00+01:00',
SEARCH_DATE_TO: '2026-11-10T00:00:00+01:00',
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.history.search',
[
'SEARCH_TEXT' => 'invoice',
'SEARCH_TYPE' => 'rest|rest_notify',
'SEARCH_DATE_FROM' => '2026-11-01T00:00:00+01:00',
'SEARCH_DATE_TO' => '2026-11-10T00:00:00+01:00',
'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.history.search", b24.Params{
"SEARCH_TEXT": "invoice",
"SEARCH_TYPE": "rest|rest_notify",
"SEARCH_DATE_FROM": "2026-11-01T00:00:00+01:00",
"SEARCH_DATE_TO": "2026-11-10T00:00:00+01:00",
"LIMIT": 20,
}, b24.WithIdempotent())
if err != nil {
return fmt.Errorf("im.notify.history.search: %w", err)
}
var item struct {
ChatID int `json:"chat_id"`
TotalResults int `json:"total_results"`
Notifications []struct {
ID int `json:"id"`
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.TotalResults, len(item.Notifications))
// Pass the id of the last notification in LAST_ID for the next page
if n := len(item.Notifications); n == 20 {
fmt.Println("LAST_ID:", item.Notifications[n-1].ID)
}
Response Handling
HTTP Status: 200
{
"result": {
"chat_id": 2535,
"notifications": [
{
"id": 44021,
"chat_id": 2535,
"author_id": 15,
"date": "2026-11-10T14:37:49+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 invoice [B]#42[/B]",
"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:36:42+01:00",
"mobile_last_date": false,
"desktop_last_date": false,
"absent": false,
"departments": [],
"phones": {
"personal_mobile": "4915112345678"
},
"bot_data": null,
"type": "user",
"website": "",
"email": ""
}
],
"total_results": 1
},
"time": {
"start": 1794317871,
"finish": 1794317871.341717,
"duration": 0.341717004776001,
"processing": 0,
"date_start": "2026-11-10T14:37:51+01:00",
"date_finish": "2026-11-10T14:37:51+01:00",
"operating_reset_at": 1794318420,
"operating": 0
}
}
Returned Data
|
Name |
Description |
|
result |
Object with the search results (detailed description). If the user does not have a system notification chat yet, or only |
|
time |
Information about the request execution time |
Result Object
|
Name |
Description |
|
chat_id |
Identifier of the user's system notification chat |
|
notifications |
Array of found notifications on the page (detailed description). If nothing is found, an empty array |
|
users |
Array of authors of the found notifications (detailed description). System notifications with |
|
total_results |
Total number of found notifications. Present only in the response to a request without |
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:
|
|
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 |
User Object
|
Name |
Description |
|
id |
Identifier of the user |
|
active |
User's active 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 |
External 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": "SEARCH_TEXT_ERROR",
"error_description": "SEARCH_TEXT can't be less than 3 symbols"
}
|
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 |
|
|
|
SEARCH_TEXT can't be less then 3 symbols |
No filter is passed, and |
|
|
|
Last notification ID can't be string |
The |
|
|
|
Incorrect date/time: abc |
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 Notifications im.notify.get
- 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