---
title: "Mass messaging"
description: "Filter contacts in CRM, personalise a template, send IM notifications to assigned managers."
canonical_url: "https://bitrix24.github.io/b24jssdk/docs/examples/mass-messaging"
last_updated: "2026-06-02"
---
# Mass messaging

> Filter contacts in CRM, personalise a template, send IM notifications to assigned managers.

## What it does

Reads up to 100 contacts that match a filter, builds a personal greeting from a template, and sends each one as a system IM notification (`im.notify`) to the contact's assigned manager. Pauses between sends to respect rate limits.

## Stack

Node.js 18+. No external dependencies.

## Environment

```bash
export B24_HOOK='https://your.bitrix24.com/rest/1/secret'
```

## Run

```bash
npx tsx 02-mass-messaging.ts
```

## Source

The full file is published in the skill at [`skills/b24jssdk-recipes/examples/02-mass-messaging.ts`](https://github.com/bitrix24/b24jssdk/blob/main/skills/b24jssdk-recipes/examples/02-mass-messaging.ts).

## Notes

- `im.notify` requires the IM module to be enabled on the portal.
- The example sends to the **assigned manager** of each contact, not to the contact directly. To DM the contact instead, use `imopenlines.crm.message.add` (Open Channels).
- For thousands of contacts use `actions.v2.fetchList.make` and split the sends across `actions.v2.batchByChunk.make` instead of a sleep loop.

## Sitemap

See the full [sitemap](/b24jssdk/sitemap.md) for all pages.
