POST JSON to one address, get JSON back. The channel is a field. Everything else — sessions, retries, cascades, media transcoding — happens behind the endpoint.
The API host is provisioned per workspace and issued with your credentials — it is not the same host that serves this website. Endpoint names and payload shapes below are the production contract; a live sandbox is provided during onboarding.
# one call, any channel — only "source" changes curl -X POST https://WORKSPACE.api.touch-api.com/v1/sendMessage \ -H "Content-Type: application/json" \ -d '{ "source": "whatsapp", "login": "12025550188", "token": "tk_live_…", "msg": { "to": "12025550143", "text": "Your order is on the way." }, "fallback": ["sms", "voice"] }'
// npm i @touch-api/sdk import { Touch } from '@touch-api/sdk'; const tx = new Touch(process.env.TOUCH_TOKEN); const r = await tx.send({ source: 'whatsapp', login: '12025550188', msg: { to: '12025550143', text: 'Your order is on the way.' }, fallback: ['sms', 'voice'], }); console.log(r.id, r.delivered_via, r.status);
# pip install touchapi from touchapi import Touch tx = Touch("tk_live_…") r = tx.send( source="whatsapp", login="12025550188", msg={"to": "12025550143", "text": "Your order is on the way."}, fallback=["sms", "voice"], ) print(r.id, r.delivered_via, r.status)
{
"id": "msg_7c41be09",
"status": "delivered",
"delivered_via": "whatsapp",
"attempts": [
{ "leg": "whatsapp", "ok": true, "ms": 287 }
],
"account": "12025550188"
}
Tokens are scoped to a single account and can be rotated without dropping the underlying session. Workspace-level keys exist for provisioning endpoints only.
| Token type | Scope | Can do | Rotation |
|---|---|---|---|
| tk_test_ | Test contour | Every endpoint against mock sessions | anytime |
| tk_live_ | One account | Send, read, set state on that account | anytime |
| tk_admin_ | Workspace | Provision, retire, configure accounts | anytime |
| tk_ro_ | Workspace | Read-only reporting and state | anytime |
Inbound messages, receipts and state changes arrive at your webhook in the same envelope regardless of the network behind them. Payloads are signed; retries follow a fixed backoff curve with a 72-hour window.
Each delivery carries an event id and an attempt counter, so your handler can be idempotent without a database round-trip on every call.
const crypto = require('node:crypto'); function verify(rawBody, header, secret) { const [ts, sig] = header.split(',').map(p => p.split('=')[1]); const expected = crypto .createHmac('sha256', secret) .update(`${ts}.${rawBody}`) .digest('hex'); const ok = crypto.timingSafeEqual( Buffer.from(expected), Buffer.from(sig) ); const fresh = Date.now() - Number(ts) * 1000 < 300_000; return ok && fresh; }
| Component | State | Uptime 90d | p95 | Last incident |
|---|---|---|---|---|
| API core | operational | 100% | 48 ms | 16 days ago |
| WhatsApp (Cloud + personal) | operational | 100% | 290 ms | 6 days ago |
| Telegram (bot + personal) | operational | 100% | 120 ms | 21 days ago |
| SMS & email | operational | 100% | 410 ms | 11 days ago |
| Social connectors | operational | 100% | 380 ms | 34 days ago |
| Webhook dispatcher | operational | 100% | 180 ms | in progress |
| Partner panel | operational | 100% | 130 ms | 48 days ago |