CRM & ERP · Automation robot + relay
Bitrix24 + Sendjade
Message leads and customers from Bitrix24 CRM automation rules.
Works with the live APIWhat you can automate
- Greet a new lead as soon as it is created
- Remind a customer about an unpaid invoice
- Notify a manager group when a deal closes
Before you start
- A Sendjade account with a connected instance (status Authorized). See Getting started.
- Your **idInstance** (shown on the instance page in the console) and **apiTokenInstance** (shown once when you created the instance; press Generate new token if you lost it). Use a spare number while testing.
- Bitrix24 with CRM Automation (robots) on your plan.
Set it up
Host the relay
Bitrix24 robots do not always let you control the request body. Run this small relay so the token stays on your server and the body is the simple shape below.
// relay.mjs: a tiny server for tools that cannot build the JSON body (or that you do not want holding the token). // Run it anywhere you can host Node 20+ (a VPS, Render, Fly.io). Keep SENDJADE_* and RELAY_SECRET in its environment. import express from 'express'; const app = express(); app.use(express.json()); app.post('/send', async (req, res) => { if (req.query.secret !== process.env.RELAY_SECRET) return res.sendStatus(401); // shared secret in the URL const { to, text, ref } = req.body; if (!to || !text) return res.status(400).json({ error: 'to and text are required' }); const r = await fetch('https://api.sendjade.com/waInstance' + process.env.SENDJADE_ID_INSTANCE + '/sendMessage/' + process.env.SENDJADE_TOKEN_INSTANCE, { method: 'POST', headers: { 'Content-Type': 'application/json', ...(ref && { 'Idempotency-Key': String(ref) }) }, body: JSON.stringify({ chatId: String(to).replace(/\D/g, ''), message: text }), }); res.status(r.status).send(await r.text()); // 200 { "idMessage": "..." } = accepted for sending }); app.listen(8080);Add a webhook robot
In the lead or deal Automation panel add a Webhook robot. Method POST, URL = your relay with
?secret=....Map the fields
Send JSON with the phone and a message built from CRM fields.
{ "to": "{=Document:PHONE}", "text": "Hello {=Document:NAME}, thanks for your enquiry.", "ref": "{=Document:ID}" }
Test it
Create a test lead with your own phone number; the robot fires and the message arrives.
Troubleshooting
The merge fields appear literally
Field codes differ per entity. Pick them from the robot's field selector instead of typing them.
I get 401 unauthorized
The idInstance or token in the URL is wrong. Copy both again from the console. Generating a new token makes the old one stop working immediately.
I get 409 instance_not_connected
The instance is not Authorized yet. Open it in the console, press Connect and scan the QR code.
I get 400 invalid_chat_id
Use international format with digits only, e.g. 2348012345678 (or 2348012345678@c.us). Remove spaces, dashes and the leading zero of the local number.
I get 422 recipient_opted_out
That person replied STOP (or was added to the opt-out list). Sendjade refuses to message them. Remove the number from Opt-outs only if they asked to hear from you again.
I get 429 daily_limit_reached or rate_limited
The number reached its 24-hour sending cap (default 500) or you are calling too fast. The cap protects your number from restriction. Slow down, and raise the cap only if your volume is genuine.
Ask AI to help me integrate Bitrix24
Copy this prompt into ChatGPT, Claude or any assistant. It already knows Sendjade’s API, so the answer matches our endpoints.
The prompt is plain text that you copy yourself. Never paste real keys into an assistant; use placeholders.