One API for all of ChatFlow: chats and messages on WhatsApp, Instagram, Messenger, Telegram and TikTok, contacts, deals, publishing, and webhooks that tell your system the moment something happens. The channel is a field on the data, so a WhatsApp-only integration simply ignores the rest.
curl https://chatflow.biz/api/v1/channels \
-H "Authorization: Bearer cfk_…"curl -X POST https://chatflow.biz/api/v1/conversations/CONVERSATION_ID/messages \
-H "Authorization: Bearer cfk_…" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 9b2f…" \
-d '{"text":"Your order is ready"}'https://chatflow.biz/api/v1. JSON in and out, ISO 8601 dates.Authorization: Bearer cfk_…. The same keys work for AI agents (MCP). A key belongs to one organization.429 with Retry-After.403 read_only_key).Every error has the same shape: {"error": {"code": "…", "message": "…"}}. The message is written for people — show it to your user.
| 400 | invalid_request, request_failed: bad input, or the channel refused (the message says why) |
| 401 | unauthorized: missing, invalid, expired or revoked key |
| 402 | API_LOCKED, MESSAGE_CAP…: the plan does not include this, or a plan limit is reached |
| 403 | read_only_key, sending_disabled: see keys above |
| 404 | not_found: no such record in your organization |
| 429 | rate_limited: retry after a minute |
Lists take ?limit= (1–100, default 25) and ?cursor=, and return {"data": [...], "nextCursor": "…" | null}. Pass nextCursor back as cursor until it is null. With a channel filter a page may hold fewer items than limit — keep going until nextCursor is null.
| GET /channels | Connected accounts: id, channel (whatsapp, instagram, messenger, telegram, tiktok, threads, x), label, capabilities |
| GET /channels/{id}/templates | Approved WhatsApp templates (official WhatsApp connection only). ?status=all lists every template with its review status |
Your customers create message templates inside your product, without Meta's WhatsApp Manager. ChatFlow sends each one to Meta for review (usually minutes, at most 24 hours) and tells your webhook the verdict with template.status_changed. Official WhatsApp (Cloud API) only;{id} in the path is the channel id from GET /channels.
| POST /channels/{id}/templates | Create and send for review. Answers 201 with the template, status usually PENDING |
| GET /channels/{id}/templates/{templateId} | One template with its status and, when rejected, Meta's reason |
| PATCH /channels/{id}/templates/{templateId} | Change texts and buttons (fields left out stay). Meta reviews it again. Approved, rejected or paused only; an approved one once a day, 10 times in 30 days, category locked |
| DELETE /channels/{id}/templates/{templateId} | Delete this language of the template. The name of an approved one is blocked for 30 days |
POST /v1/channels/CHANNEL_ID/templates
{
"name": "order_ready", // a-z, 0-9 and _ ; cannot change later
"language": "ru", // ru, kk, en_US, en_GB, uz, ky_KG, tr, uk, az, ka, de, fr, es, it, pt_BR, ar, ko, id, zh_CN
"category": "UTILITY", // UTILITY (orders, bookings, payments) or MARKETING
"headerText": "Order update", // optional, up to 60, no variables
"body": "Hello {{1}}! Order {{2}} is ready.", // up to 1024; {{1}}..{{n}} in a row
"bodyExamples": ["Aigerim", "#1042"], // one example per variable — Meta requires them
"footer": "ChatFlow Shop", // optional, up to 60
"buttons": [ // optional, up to 10: 2 URL, 1 PHONE_NUMBER
{ "type": "QUICK_REPLY", "text": "Thanks" },
{ "type": "URL", "text": "Track", "url": "https://shop.example/track" },
{ "type": "PHONE_NUMBER", "text": "Call us", "phone": "+77011234567" }
]
}Template object:
{
"id": "1689556908129832", "name": "order_ready", "language": "ru", "category": "UTILITY",
"status": "PENDING" | "APPROVED" | "REJECTED" | "PAUSED" | "DISABLED" | "IN_APPEAL",
"rejectedReason": "INVALID_FORMAT" | null, "rejectionDetail": "Meta's words, when given" | null,
"headerText": "Order update", "body": "Hello {{1}}! …", "bodyExamples": ["Aigerim", "#1042"],
"footer": "ChatFlow Shop", "buttons": [ … ], "paramCount": 2, "headerMedia": null,
"editable": true
}400 invalid_template with the reason, at once.400 meta_refused with Meta's words. Show them to your customer.editable: false marks templates made in WhatsApp Manager with parts the API cannot keep.APPROVED, send it: { "template": { "name", "language", "params" } } to POST /conversations/{id}/messages or POST /messages.| GET /contacts | All contacts, newest first. ?channel=, or ?query= to search by name or phone |
| GET /contacts/{id} | One contact with its conversationIds |
| POST /contacts | {phone, name?, channelId?} — a WhatsApp contact. channelId is required when several WhatsApp numbers are connected |
| GET /conversations | Chats, most recently active first. ?channel=, ?status=open|closed|archived, ?updatedSince=<ISO date> |
| GET /conversations/{id} | One chat |
| PATCH /conversations/{id} | {assignedTo?, labelIds?, contactName?, notes?} |
| GET /conversations/{id}/messages | Messages, newest first, with media links |
| POST /conversations/{id}/messages | Reply in the chat — the chat's own channel is used |
| POST /messages | {to, channelId?, name?, …} — first message to a new WhatsApp number |
| POST /media | {contentType} — get an upload URL for a file to send or publish |
A send body is one of:
{ "text": "Hello!" }
{ "mediaUrl": "<mediaUrl from POST /v1/media>", "caption": "Invoice", "fileName": "invoice.pdf" }
{ "template": { "name": "order_ready", "language": "ru", "params": ["Aigerim", "#1042"] } }Idempotency-Key header with text and media: a retry with the same key is never sent twice.Message object:
{
"id": "…", "conversationId": "…", "direction": "inbound" | "outbound",
"text": "…", "status": "queued" | "sent" | "delivered" | "read" | "failed",
"sentBy": "customer" | "employee" | "ai" | "system",
"media": { "type": "image", "mime": "image/jpeg", "fileName": null, "url": "https://…" } | null,
"createdAt": "2026-10-30T09:12:00.000Z"
}| GET /pipelines | Pipelines and stages (columnId is the stageId below) |
| GET /deals | ?query=, ?archived=true |
| GET /deals/{id} | One deal |
| POST /deals | {phone, title, stageId, name?, value?, assignedTo?} — finds or creates the client by phone |
| PATCH /deals/{id} | {stageId?, title?, notes?, value?, assignedTo?, archived?} |
| GET /team | Employees and labels — ids for assignedTo and labelIds |
| GET /instagram/comments | ?mediaId=, ?unrepliedOnly=true |
| POST /instagram/comments/{id}/reply | {text} |
| POST /instagram/comments/{id}/hide | {hidden: true|false} |
| GET /instagram/insights | Account and post statistics. ?account=, ?postLimit= |
POST /posts with channel, kind and the fields for that kind. account picks the account when several are connected. Files are public URLs or mediaUrls from POST /media.
| threads | kind text: text |
| x | kind text: text, imageUrls? (Pro and Max) |
kind photo / reel / carousel / story: imageUrl / videoUrl / items / mediaUrl + type, caption? | |
| tiktok | kind video / video_draft / photo_draft: videoUrl / photoUrls, caption? |
| GET /threads/insights | Threads account and post statistics. ?account=, ?postLimit= |
| GET /tiktok/posts | Posts published to TikTok. ?limit= |
| GET /usage | Messages used and limits for this organization |
ChatFlow POSTs events to your HTTPS address as they happen. Add one in Settings → Webhooks (with a delivery log and a test button) or over the API:
| GET /webhooks | Your webhooks |
| POST /webhooks | {url, events?, channels?, description?} — the response has a secret, shown only once |
| DELETE /webhooks/{id} | Remove |
| channel.connected | A channel was connected through a connect link; channel says which |
| message.received | A customer wrote (any channel) |
| message.sent | An outbound message was created — by an employee, the AI, the API or a campaign |
| message.status_changed | An outbound message became sent, delivered, read or failed: {message, previousStatus, error}; for failed, error is {code, detail} from Meta (e.g. 131042) |
| conversation.created | A new chat appeared |
| deal.created | A new deal |
| deal.updated | A deal changed; changed lists what (stage, title, value, assignedTo, notes, archived, …) |
| template.status_changed | Meta approved, rejected or paused a WhatsApp template: {template, previousStatus}; previousStatus is null when Meta decided at once, in its answer to the create call |
Leave events empty for all of them; channels: ["whatsapp"] sends only WhatsApp events.
POST https://your-system.example/chatflow
X-ChatFlow-Event: message.received
X-ChatFlow-Delivery: <unique id, for de-duplication>
X-ChatFlow-Signature: t=1761815520,v1=<hex>
{
"id": "evt_…", "type": "message.received", "createdAt": "2026-10-30T09:12:00.000Z",
"data": {
"message": { …message object… },
"conversation": { "id": "…", "channel": "whatsapp", "channelId": "…" },
"contact": { "id": "…", "name": "Aigerim", "phone": "77010001122" }
}
} Check the signature — HMAC-SHA256 of <t>.<raw body> with your secret must equal v1:
import crypto from "node:crypto";
function verify(secret, header, rawBody) {
const { t, v1 } = Object.fromEntries(header.split(",").map((p) => p.split("=")));
const expected = crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
return Math.abs(Date.now() / 1000 - Number(t)) < 300 &&
crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(v1));
}Answer 2xx within 10 seconds. Otherwise ChatFlow retries after 1 min, 5 min, 30 min, 2 h, 6 h and 12 h, then marks the delivery failed. Order is not guaranteed. Media in message.received may still be downloading (url: null) — fetch the message later.
If you run your own CRM or service, you can offer ChatFlow's channels to your customers behind your product, with one API key and one webhook for all of them. Each customer is a separate organization, so their data stays apart. Register as a partner, pay for instances, and manage everything in your cabinet at /partner: a dashboard with counters, customers, keys, webhooks and billing.
Nobody makes links by hand. When a client presses "Connect WhatsApp" in your product:
connectUrl.returnUrl with ?status=connected added (declined or error if it didn't work), and your webhook receives channel.connected.X-ChatFlow-Client: their id or your own externalId.curl -X POST https://chatflow.biz/api/v1/partner/clients \
-H "Authorization: Bearer cfk_YOUR_PARTNER_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "Clinic Astana", "externalId": "crm-1042",
"channels": ["whatsapp"],
"returnUrl": "https://your-crm.example/whatsapp/done"}'
{ "id": "…", "externalId": "crm-1042", "connectUrl": "https://chatflow.biz/connect/cfl_…", … }Add one webhook with your partner key and no header. It receives the events of all your clients, and each event has a data.client object saying whose it is. To connect another channel later, or if a link expired, ask for a new link: POST /partner/clients/crm-1042/connect-link. If you've used all your paid instances, connectUrl is null.
curl https://chatflow.biz/api/v1/conversations \
-H "Authorization: Bearer cfk_YOUR_PARTNER_KEY" \
-H "X-ChatFlow-Client: crm-1042"| POST /partner/clients | {name, externalId?, channels?, returnUrl?} — returns the connectUrl. Your own reference in externalId also protects against duplicates (409) when you retry, and works in place of id everywhere. The response also has an apiKey just for this customer, if you prefer separate keys |
| GET /partner/clients | All your customers, with connected accounts and messages sent |
| GET /partner/clients/{id} | One customer |
| PATCH /partner/clients/{id} | {name?, suspended?} — a suspended customer's API access and events stop until you resume them |
| POST /partner/clients/{id}/api-key | Replace that customer's own key |
| POST /partner/clients/{id}/connect-link | {channels?, returnUrl?} — one of whatsapp, telegram, instagram, threads, tiktok, tiktokBusiness or more; all of them if left out |
| POST /partner/clients/{id}/whatsapp/complete | {code, wabaId, phoneNumberId?, isCoexistence?} — finish a WhatsApp signup you ran in your own window, from your server, straight away: code works once and Meta gives it 30 seconds. Your domain must first be added to our Meta app, so ask us. Sends channel.connected |
| GET /partner/usage | The dashboard's counters: customers with WhatsApp, customers who used WhatsApp in the last 30 days, numbers, other channels, messages, instances |
no_free_instances when all are in use.AI tools (Claude, ChatGPT, Cursor) connect through the MCP server instead. · Privacy · Terms
Questions, a custom plan or help getting connected? Write or call ChatFlow's CEO directly.
WhatsApp+7 702 732 62 04yernur@fastdev.org