Send a WhatsApp message from your own system.
One request sends a message. A test key checks everything a live key checks, then stops: nothing is sent, nothing is charged, and no WhatsApp number needs to be connected yet.
curl https://sema.datacare.co.ke/api/v1/messages \
-H "Authorization: Bearer $SEMA_KEY" \
-H "Idempotency-Key: order-4171" \
-H "Content-Type: application/json" \
-d '{
"to": "254799999002",
"type": "text",
"text": { "body": "Your order is ready for collection." }
}'{
"id": "0b1c25a4-33e7-414a-b413-0c492fb50a4a",
"status": "queued",
"to": "254799999002",
"type": "text",
"created_at": "2026-09-22T19:23:06.938Z"
}With a test key, the number 254799999002 comes back read. 254799999001 fails, 254799999003 is refused because the reply window is closed, 254799999004 is refused for low credit and 254799999005 is refused because that person opted out. Any other number comes back delivered.
Start in three steps
- Make a test key in Settings, API keys, as an owner or admin.
- Send to the number that comes back read, and handle each outcome above.
- Connect your WhatsApp number, make a live key, and swap it in.
Keys and scopes
Each key is made for one system and ticks only what that system needs: sending, reading, contacts, templates, one-time codes, webhooks, campaigns or what the AI answers from. A key is shown once and stored only as a hash. Each has its own limit of requests a minute. Keys in the reference.
Test keys and live keys
Every response says "mode": "test" or "mode": "live", so your integration can refuse to start with the wrong kind. A test key cannot read your real customers.
Retries that never send twice
Every send carries an Idempotency-Key. Send the same key with the same body and you get the first answer back. Send it with a different body and you get a 409. A key is remembered for seven days. Sending in the reference.
Many at once
Check the balance first, then send a batch in one request. Batches in the reference.
One-time codes
Confirm a phone number at checkout or sign-in. Sema makes a six-digit code, sends it through your approved authentication template and tells you whether the code your customer typed is right. A code lasts ten minutes, five wrong tries kill it, and nobody at your business can read it. With a test key the code is always 000000. One-time codes in the reference.
Signed webhooks
Rather than asking what happened, be told. Each delivery carries a sema-signature header you check with your signing secret. There are 15 events:
message.receivedA customer sent you a messagemessage.deliveredA message you sent reached the phonemessage.readThey read itmessage.failedIt could not be deliveredcontact.opted_outSomebody asked to stop hearing from youpayment.receivedA customer paid you by M-Pesa from a conversation, confirmed with M-Pesa itselfmessage.sentA message you sent left for WhatsApptemplate.status_changedMeta approved, rejected, paused or disabled a templatedeal.createdA deal was added to the pipeline: `data` is the dealdeal.stage_changedA deal moved to another stage: `data` is the deal, with `from_stage`deal.wonA deal was won: `data` is the dealdeal.lostA deal was lost: `data` is the deal, with its `lost_reason`appointment.bookedAn appointment was booked: `data` is the appointmentappointment.changedAn appointment was confirmed, moved, cancelled or marked: `data` is the appointmentlead.capturedSema learnt who a customer is, whether or not it made a deal: `data` is {source (lead_form, website_chat or assistant), conversation_id, contact {id, wa_id, name, email}, form {id, name, welcomed}, asked, page}
OpenAPI
The whole API is described at /api/v1/openapi.json. Point Postman, Insomnia or your own generator at it. A test fails if the file stops matching the routes. A TypeScript client, @sema/client, is built from it but is not on npm yet, so until it is, generate your own from the file.
MCP, for AI assistants
Sema has an MCP server at https://sema.datacare.co.ke/api/mcp. An assistant works with the same key and the same scopes, is offered only the tools those scopes allow and asks you before it sends or starts anything. Connecting an assistant.
Zapier, Make, n8n and other tools
A webhook or an HTTP step in the tool can send and receive through Sema with an API key. Sema’s own Zapier and n8n apps are not published yet. All integrations.
What it costs
Each message is charged at one all-in price, the same as one sent from the inbox. Work out your own month.