Another system (a website, Make, Zapier or your own server) works with your workspace through the API: it adds and updates leads, sends WhatsApp messages, launches broadcasts and keeps customers in sync.
The routes are the same ones the app's own screens use, so every check, automation and history entry applies exactly as when a member acts.
This page is built from the API's code: the parameters, fields and errors here are what the server accepts and returns.
An OpenAPI 3.1 document (JSON) with every route, field and error.
Import into Postman, Make and Zapier
OpenAPI
http://127.0.0.1:44011/api/v1/public/openapi.json
Postman: Import → Link, and paste the document's address. You get a collection with every request; set the key once under Authorization → Bearer Token.
Make: the HTTP module → Make a request, with the address and fields from this page, and an Authorization: Bearer header with the key.
Zapier: Webhooks by Zapier → Custom Request, with the address, the fields and the Authorization header.
Any tool that reads OpenAPI (code generators, API clients) can read the document straight from its address.
Authentication
Making a key
In Settings → API, an owner or admin makes a key and picks its scopes.
The key is shown once: keep it somewhere safe (an environment variable on your server, a secret in Make). We store only its fingerprint.
Revoke a key that leaked or isn't needed on the same screen: it stops working at once.
On every request
Send the key in the Authorization header. No cookie and no Origin are needed.
HTTP
Authorization: Bearer ak_<id>_<secret>
What a key can do
A key acts as the member who made it: their permissions and the data they see, always as they are now. A member who leaves or loses a permission takes it from the key too.
A key reaches only the routes its scopes open (below, by scope). Everything else answers 403 core.auth.scope_denied. A key never reaches members, roles, settings or other keys.
Phone numbers come back masked unless the member may see full numbers.
Every change is in the audit log under the member, marked "via API key" with the key's name.
Limits
Up to 300 requests a minute per key. Past that: 429 core.rate_limited with a Retry-After header (seconds to wait).
Quick check
This request returns the key's workspace, member and scopes.
The workspace's lists: statuses, sources, custom fields, organizations, campaigns and channels. The keys and ids to send when creating or changing a lead.
Member permissionscrm.leads.read
Parameters
No parameters.
Request
curl
curl -X GET "https://app.allchatai.io/api/v1/crm/catalog" \
-H "Authorization: Bearer $ALLCHAT_API_KEY"
Every field the workspace defined, across the system: which records carry it (areas: lead, customer, contact, product, deal, task, project, candidate, job, of the modules that are on), its type and options. A record's customFields use these keys. Only fields the key's member may see.
An example built from the answer's shape; the values are illustrative.
Possible errors
400core.validation
401core.auth.bad_api_key
403core.auth.scope_denied
429core.rate_limited
GET/v1/crm/customers
Search customers
Customers: one per phone number, over all of that person's leads (and customers known only from an upload). Needs a member who may see full phone numbers.
Member permissionscrm.leads.readcore.phones.view
Parameters
Name
In
Type
Required
Notes
q
query
string≤ 100
No
Search: name, phone digits, email.
adv
query
string≤ 8000
No
Advanced rules as JSON, as on the customers screen.
has
query
with_leads | no_leads | left_sync
No
with_leads: people with a lead; no_leads: customers known only from an upload.
view
query
active | archived
No
active: only active customers, as the workspace defines them (Settings → Customers). archived: the customers in the archive (needs crm.customers.archive); every other view leaves them out.
Scope leads.write: create and change leads, add notes, save customers' details.
POST/v1/crm/leads
Create a lead
A new lead, through the CRM's usual creation: the block list, duplicate flags, routing and the "lead created" automations. phone in international form (E.164). status is a status key from the catalog (left out: the workspace's starting status). customFields by field key.
Member permissionscrm.leads.write
Parameters
Name
In
Type
Required
Notes
name
body
string1–200
Yes
firstName
body
string | null1–100
No
lastName
body
string | null1–100
No
company
body
string | null≤ 200
No
phone
body
string
Yes
International form (E.164), e.g. +972541234567.
email
body
email | null
No
status
body
string1–80
No
A status key from GET /v1/crm/catalog; left out: the workspace's starting status.
ownerId
body
uuid | null
No
The member (membership id) to assign it to.
customFields
body
object
No
Values by custom field key (GET /v1/crm/catalog: fields).
Change the fields sent (status, agent, name, company, organization, campaign, channel, custom fields; at least one). customFields are merged; null clears a field. Changing phone or email needs the crm.leads.contact.edit permission. A lead another system syncs is read-only.
Member permissionscrm.leads.write
Parameters
Name
In
Type
Required
Notes
ref
path
string
Yes
The lead number (digits, "1042"; "#1042" and "L-1042" work too).
Create or update the customer's own details. A property left out stays as it is; null clears it. The customer must exist (a lead or earlier details with that phone).
Member permissionscrm.customers.editcore.phones.view
Parameters
Name
In
Type
Required
Notes
key
path
string
Yes
The customer's phone: its last 9 digits, or the whole number (0541234567, +972541234567).
A message to a number. WhatsApp's rule: free text only within 24 hours of the customer's last message; outside it, an approved template (templateId + templateParams). text with templateId sends the text when it can, the template otherwise. The do-not-contact list, the customer's opt-out and the line's state are checked like any send. Send an Idempotency-Key so a retry never sends twice.
Member permissionsinbox.conversations.reply
Parameters
Name
In
Type
Required
Notes
Idempotency-Key
header
string≤ 200
No
Your own id for this request (up to 200 visible ASCII characters). The same key again sends nothing and answers 200 with duplicate: true.
phone
body
string6–30
Yes
International, or local in the workspace's country.
text
body
string1–4096
No
Free text: only inside the 24-hour window.
templateId
body
uuid
No
An approved template (GET /v1/inbox/send/options).
templateParams
body
string[]≤ 20
No
The template's variables, in order.
templateHeader
body
string[]≤ 1
No
Optional: a text header's variable (templates whose header is text with {{1}}).
templateHeaderLink
body
string≤ 2000
No
An image / video / document header: the media's public https link (required for such a template).
templateButtons
body
string[]≤ 10
No
The end of each dynamic link button's link (what replaces {{1}}), in the buttons' order (required when the template has them).
lineId
body
uuid
No
Optional: by default the line the customer last talked to, else the first active line.
Stamps customers by phone the way a bot's "set field" and "add tag" do: their bot fields (a flow reads them as {{field.<key>}}), first / last name and tags. For a system that sends through POST /v1/inbox/send and wants the flow that answers the customer's reply to know what was sent (a lead number, a broadcast number, a personal link). A field key not yet defined is created as a text field named after it; fields alone only makes sure the keys exist. Nothing is sent.
Member permissionsbots.use
Parameters
Name
In
Type
Required
Notes
fields
body
string[]≤ 50
No
Field keys to make sure exist (a-z, 0-9, _): the missing ones are created as text fields.
contacts
body
object[]≤ 100
No
Up to 100 customers: { phone, firstName?, lastName?, fields?: { key: value or null to clear }, addTags? }.
Scope messages.read: read a customer's WhatsApp conversation by phone number.
GET/v1/inbox/thread
A customer's WhatsApp conversation
The most recent WhatsApp conversation with a number and its latest messages, oldest first: its state, line, who handles it, and whether the 24-hour window is open (free text may be sent). Only a conversation the key's member may see in the inbox; none (or one they may not see) answers conversation: null with no messages. No phone numbers and no media links in the answer. Every line the number talked with is in lines (most recent first); lineId reads that line's conversation.
Member permissionsinbox.conversations.read
Parameters
Name
In
Type
Required
Notes
phone
query
string6–30
Yes
The customer's number: international, or local in the workspace's country.
limit
query
integer1–200 · = 60
No
How many of the latest messages (1-200, default 60).
lineId
query
uuid
No
One of the answer's lines: that line's conversation instead of the most recent one.
Request
curl
curl -X GET "https://app.allchatai.io/api/v1/inbox/thread" \
-H "Authorization: Bearer $ALLCHAT_API_KEY"
Who asked not to be messaged here (wrote stop, tapped a button, or a member or an import added them), oldest first. For a system that sends through this API and keeps its own do-not-message list: read the new ones every few minutes (since, then each page's next as cursor). Our own sends already honour them.
Member permissionsinbox.conversations.read
Parameters
Name
In
Type
Required
Notes
since
query
date-time
No
Only opt-outs after this time (ISO). Ignored with cursor.
cursor
query
string≤ 200
No
The previous page's next.
limit
query
integer1–1000 · = 500
No
Page size (1-1000, default 500).
Request
curl
curl -X GET "https://app.allchatai.io/api/v1/inbox/opt-outs" \
-H "Authorization: Bearer $ALLCHAT_API_KEY"
Launch a broadcast built in the app (its audience, template and variables are set there, with the checks before launch). Now, or at a time (up to 90 days ahead) to schedule it.
Member permissionscampaigns.managecrm.leads.read
Parameters
Name
In
Type
Required
Notes
id
path
uuid
Yes
The broadcast's id.
at
body
date-time | null= null
No
When to send: an ISO time in UTC (ending in Z); null or left out: now.
Scope mcp: an MCP server through which Claude, ChatGPT or Cursor work with the member's assistant tools.
POST/v1/mcp
MCP server (for AI clients)
The Model Context Protocol server: AI clients (Claude, ChatGPT, Cursor...) use the member's assistant tools. Streamable HTTP, JSON-RPC 2.0, JSON responses only: initialize, ping, tools/list, tools/call. A tool that changes something returns a preview first and runs only when called again with confirmed: true.
The same MCP server at the workspace's own address (its slug), so an AI client can hold one connector per workspace. Only that workspace's API key or OAuth token is accepted here; another workspace's answers 401.
Parameters
Name
In
Type
Required
Notes
workspace
path
string
Yes
The workspace's address name (its slug), as Settings → Claude & ChatGPT shows it.
Addresses another system sends to without an API key. The address itself (with its token) is the credential: keep it like a password.
Lead webhook
Settings → Connections → Webhook (or each channel's own address in Settings → Leads) gives an address. Send each lead to it from a form, a landing page, Make or Zapier.
JSON or form fields. The fields below are recognized by name (other spellings too). Map any other field to a custom field in the connection's settings; the rest stays in the connection's log.
external_id with the same phone updates that lead instead of making a new one. With a signing secret on the connection, every request must be signed.
Signature: optional (required once the connection has a signing secret)
Address
POST https://app.allchatai.io/api/v1/hooks/webhook/{token}
Fields it recognizes
Field
What
Also read from
name
The person's name.
full_name, fullname, שם, שם מלא, your-name
first_name
First name (with last_name, when no name is sent).
firstname, fname, שם פרטי
last_name
Last name.
lastname, lname, surname, שם משפחה
phone
Phone: international, or local in the workspace's country.
401integrations.webhook_bad_signature: a missing or wrong signature.
404integrations.webhook_unknown: an unknown or disabled address.
Automation webhook
An automation whose trigger is a webhook has its own address (shown in the automation). Each request runs it with the fields sent.
The trigger says which fields to read and which one holds the lead's phone. The answer's accepted says whether the automation's conditions matched and it runs.
Signature: none
Address
POST https://app.allchatai.io/api/v1/hooks/automations/{token}
200`accepted`: whether the automation's conditions matched and it runs.
404integrations.webhook_unknown: an unknown address, or the automation is off.
Customer sync from another system
Settings → Connections → "Customer sync from another system" gives an address and needs a signing secret.
Send events: customers, the sender's own leads, notes and calls (with recordings). Every request is signed. Resending is always safe: an event older than what we hold is skipped. A bad event is refused alone; the rest apply.
What arrives is read-only in the workspace, marked with the connection's name.
Signature: required
Address
POST https://app.allchatai.io/api/v1/hooks/customer-sync/{token}
401integrations.webhook_bad_signature: a missing or wrong signature.
404integrations.webhook_unknown: an unknown or disabled address.
Customer sync: what we hold
The same address with /query at the end, signed the same way. Returns, a page at a time, what was applied (by key and your hash) and what was refused, so the sender can resend what's missing. ts is your clock: a query more than 5 minutes off is refused.
Signature: required
Address
POST https://app.allchatai.io/api/v1/hooks/customer-sync/{token}/query
200The page: { kind, items: [{ key, hash, state, code }], next, pendingDeliveries } (op state); see docs for deals and orders.
401integrations.webhook_bad_signature.
422crm.sync.stale_query: `ts` is more than 5 minutes off.
HMAC signature
The signature is an HMAC-SHA256 of the exact bytes of the request body, with the connection's signing secret, hex-encoded, in the X-Signature header with the sha256= prefix. Sign the same text you send (not an object serialized again).
Node.js
import { createHmac } from "node:crypto";
const body = JSON.stringify({ events: [/* ... */] });
const signature = "sha256=" + createHmac("sha256", process.env.ALLCHAT_SIGNING_SECRET)
.update(body)
.digest("hex");
await fetch("https://app.allchatai.io/api/v1/hooks/customer-sync/<token>", {
method: "POST",
headers: { "Content-Type": "application/json", "X-Signature": signature },
body, // exactly the bytes that were signed
});
Python
import hashlib, hmac, json, os, requests
body = json.dumps({"events": [...]}).encode()
signature = "sha256=" + hmac.new(
os.environ["ALLCHAT_SIGNING_SECRET"].encode(), body, hashlib.sha256
).hexdigest()
requests.post(
"https://app.allchatai.io/api/v1/hooks/customer-sync/<token>",
data=body, # exactly the bytes that were signed
headers={"Content-Type": "application/json", "X-Signature": signature},
)
Changelog
This page and an OpenAPI 3.1 document, built from the code: every route an API key reaches, the webhooks and the errors.
Lead numbers are digits only ("1042"). Older links with "L-1042" still work.