Developers
API reference
REST API for Zyptos: authentication, errors, rate limits and every v1 endpoint.
Overview
The Zyptos API is a JSON REST API for your workspace: send WhatsApp messages, manage contacts, read templates and conversations, and start broadcasts. The machine-readable spec is at /api/v1/openapi.json (OpenAPI 3.1). To use the same operations from an AI assistant, connect the MCP server.
https://zyptos.com/api/v1Authentication
Create a key in the app under Settings > New API key (owners and admins). Keys look like zk_live_…, are shown once and stored only as a hash. Send the key as a Bearer token. Revoking a key in Settings stops it immediately.
curl https://zyptos.com/api/v1/me \
-H "Authorization: Bearer $ZYPTOS_API_KEY"Each key has scopes. A request outside the key's scopes gets 403.
| Scope | Allows |
|---|---|
contacts:read | Read contacts |
contacts:write | Create and update contacts |
messages:read | Read conversations and messages |
messages:send | Send messages |
templates:read | Read templates |
broadcasts:write | Create and read broadcasts |
Send your first message
Templates can be sent any time (except to opted-out contacts). Free text needs the contact's 24-hour window to be open.
curl -X POST https://zyptos.com/api/v1/messages \
-H "Authorization: Bearer $ZYPTOS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "template",
"to": "+91 98765 43210",
"template": { "name": "order_update", "language": "en", "variables": ["Asha", "#1042"] }
}'The response is 202 Accepted with the message in status queued. It moves to sent, delivered and read as Meta reports; follow it with GET /messages/{id} or the message.status webhook.
Errors
Errors use HTTP status codes and one JSON shape. Branch on code; message is for humans.
{
"error": {
"code": "validation_error",
"message": "The request has invalid or missing fields.",
"details": [{ "path": "phone", "message": "Invalid input: expected string, received undefined" }]
}
}| Status | code | When |
|---|---|---|
| 400 | validation_error | Invalid JSON, missing or invalid fields, wrong number of template variables |
| 401 | unauthorized | Missing, malformed, unknown or revoked key |
| 403 | forbidden | The key lacks the required scope |
| 403 | workspace_inactive | The workspace is suspended or cancelled |
| 404 | not_found | No such resource in this workspace, or no such endpoint |
| 409 | opted_out | Template to a contact who opted out |
| 422 | no_whatsapp_number | No connected WhatsApp number |
| 422 | window_closed | Free text outside the 24-hour window |
| 422 | template_not_approved | Unknown, unapproved or authentication template |
| 429 | rate_limited | Too many requests (see Retry-After) |
| 503 | sending_paused | Sending is paused platform-wide, or the queue is unavailable (service_unavailable) |
Rate limits
Each key can make 120 requests per minute. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (Unix seconds). Over the limit you get 429 with Retry-After. Message delivery itself is paced by WhatsApp and your number's messaging limit; for large sends, use broadcasts.
Pagination
List endpoints take page (from 1) and limit (1–100, default 50) and return data, page, limit, total and has_more. Timestamps are ISO 8601 in UTC; phone numbers are digits with country code and no plus sign.
Testing
There is no sandbox yet. Use a test number you own, or contacts who expect your messages.Workspace
/meGet the current workspace
Returns the workspace the key belongs to, the key's scopes and the connected WhatsApp numbers. Works with any valid key.
Response 200
| Field | Type | Description |
|---|---|---|
| workspace* | object | |
| workspace.id* | string (uuid) | |
| workspace.name* | string | |
| workspace.plan* | string | |
| workspace.status* | string | |
| key* | object | |
| key.id* | string (uuid) | |
| key.name* | string | |
| key.scopes* | string[] | |
| numbers* | object[] | |
| numbers[].id* | string (uuid) | |
| numbers[].display_phone_number* | string | null | |
| numbers[].verified_name* | string | null | |
| numbers[].status* | string | |
| numbers[].quality_rating* | string | null | |
| numbers[].messaging_limit* | string | null |
Errors: 401 missing, invalid or revoked api key · 429 rate limit exceeded
curl "https://zyptos.com/api/v1/me" \
-H "Authorization: Bearer $ZYPTOS_API_KEY"/usageGet this month's usage
Message counts for the current calendar month (UTC): sent and received, failed, conversations with activity, billable messages by Meta pricing category, broadcasts created, plus the total number of contacts. Works with any valid key. Meta bills conversation charges directly; these are counts, not amounts.
Response 200
| Field | Type | Description |
|---|---|---|
| period* | object | |
| period.start* | string (date-time) | |
| period.end* | string (date-time) | |
| plan* | string | |
| messages* | object | |
| messages.sent* | integer | -9007199254740991–9007199254740991 |
| messages.received* | integer | -9007199254740991–9007199254740991 |
| messages.failed* | integer | -9007199254740991–9007199254740991 |
| billable_by_category* | map<string, integer> | Billable outgoing messages by Meta pricing category (marketing, utility, authentication, service…) |
| conversations_active* | integer | -9007199254740991–9007199254740991 |
| broadcasts_created* | integer | -9007199254740991–9007199254740991 |
| contacts_total* | integer | -9007199254740991–9007199254740991 |
Errors: 401 missing, invalid or revoked api key · 429 rate limit exceeded
curl "https://zyptos.com/api/v1/usage" \
-H "Authorization: Bearer $ZYPTOS_API_KEY"Messages
/messagesmessages:sendSend a message
Queues a text or template message from the workspace's connected number and returns it with status `queued` (202). Text messages are only allowed while the customer service window is open (24 hours after the contact's last message); outside it, send an approved template. Templates are never sent to opted-out contacts.
Request body
One of: text
| Field | Type | Description |
|---|---|---|
| type* | "text" | |
| to | string | Recipient phone number. Creates the contact if it's new.max 24 chars |
| contact_id | string (uuid) | Recipient contact id (instead of `to`) |
| text* | object | |
| text.body* | string | max 4096 chars |
| text.preview_url | boolean | Show a link preview for the first URLdefault true |
or template
| Field | Type | Description |
|---|---|---|
| type* | "template" | |
| to | string | Recipient phone number. Creates the contact if it's new.max 24 chars |
| contact_id | string (uuid) | Recipient contact id (instead of `to`) |
| template* | object | |
| template.name* | string | Template name as approved by Metamax 512 chars |
| template.language* | string | Template language code, e.g. en or en_USmax 15 chars |
| template.variables | string[] | Values for {{1}}, {{2}}… in orderdefault [] · max 20 items |
| template.header_media_url | string (uri) | Public https link for an IMAGE, VIDEO or DOCUMENT header |
Response 202
Returns a Message object.
Errors: 400 validation error · 401 missing, invalid or revoked api key · 403 key lacks the required scope, or the workspace is suspended · 409 contact opted out (templates) · 422 no connected number, window closed, or template not approved · 429 rate limit exceeded · 503 sending paused or queue unavailable
curl -X POST "https://zyptos.com/api/v1/messages" \
-H "Authorization: Bearer $ZYPTOS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "text",
"to": "+91 98765 43210",
"text": { "body": "Your order is out for delivery." }
}'/messages/{id}messages:readGet a message
Poll this, or subscribe to the message.status webhook, to follow a message from queued to sent, delivered and read.
Parameters
| Field | Type | Description |
|---|---|---|
| id*path | string (uuid) | Resource id |
Response 200
Returns a Message object.
Errors: 400 validation error · 401 missing, invalid or revoked api key · 403 key lacks the required scope, or the workspace is suspended · 404 not found · 429 rate limit exceeded
curl "https://zyptos.com/api/v1/messages/<id>" \
-H "Authorization: Bearer $ZYPTOS_API_KEY"Contacts
/contactscontacts:readList contacts
Newest first. Filter by search text, tag or opt-out state.
Parameters
| Field | Type | Description |
|---|---|---|
| pagequery | integer | Page number, from 1default 1 · 1–10000 |
| limitquery | integer | Items per page (1–100)default 50 · 1–100 |
| qquery | string | Matches name, profile name, phone or emailmax 100 chars |
| tagquery | string | Only contacts with this tagmax 40 chars |
| opted_outquery | "true" | "false" | Filter by opt-out state |
Response 200
A page of Contact objects in data, with page, limit, total and has_more.
Errors: 400 validation error · 401 missing, invalid or revoked api key · 403 key lacks the required scope, or the workspace is suspended · 429 rate limit exceeded
curl "https://zyptos.com/api/v1/contacts" \
-H "Authorization: Bearer $ZYPTOS_API_KEY"/contactscontacts:writeCreate or update a contact
Upserts by phone number: if the number already exists in the workspace, the given fields are merged into it (tags are added, not replaced) and 200 is returned instead of 201.
Request body
| Field | Type | Description |
|---|---|---|
| phone* | string | Phone number with country code, e.g. +91 98765 43210 or 919876543210max 24 chars |
| name | string | max 120 chars |
| string (email) | ||
| tags | string[] | max 50 items |
| attributes | map<string, string> | Custom key/value fields |
| opted_out | boolean |
Response 201
Returns a Contact object.
Errors: 400 invalid phone number or fields · 401 missing, invalid or revoked api key · 403 key lacks the required scope, or the workspace is suspended · 429 rate limit exceeded
curl -X POST "https://zyptos.com/api/v1/contacts" \
-H "Authorization: Bearer $ZYPTOS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone": "+91 98765 43210",
"name": "Asha Verma",
"email": "asha@example.com",
"tags": ["vip"],
"attributes": { "city": "Pune" }
}'/contacts/{id}contacts:readGet a contact
Parameters
| Field | Type | Description |
|---|---|---|
| id*path | string (uuid) | Resource id |
Response 200
Returns a Contact object.
Errors: 400 validation error · 401 missing, invalid or revoked api key · 403 key lacks the required scope, or the workspace is suspended · 404 not found · 429 rate limit exceeded
curl "https://zyptos.com/api/v1/contacts/<id>" \
-H "Authorization: Bearer $ZYPTOS_API_KEY"/contacts/{id}contacts:writeUpdate a contact
Only the fields you send change. `tags` and `attributes` replace the stored values; send null for name or email to clear them.
Parameters
| Field | Type | Description |
|---|---|---|
| id*path | string (uuid) | Resource id |
Request body
| Field | Type | Description |
|---|---|---|
| name | string | null | |
| string (email) | null | ||
| tags | string[] | max 50 items |
| attributes | map<string, string> | Custom key/value fields |
| opted_out | boolean |
Response 200
Returns a Contact object.
Errors: 400 validation error · 401 missing, invalid or revoked api key · 403 key lacks the required scope, or the workspace is suspended · 404 not found · 429 rate limit exceeded
curl -X PATCH "https://zyptos.com/api/v1/contacts/<id>" \
-H "Authorization: Bearer $ZYPTOS_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "tags": ["vip", "repeat"], "opted_out": false }'Templates
/templatestemplates:readList message templates
Templates synced from Meta for this workspace's numbers (refreshed every 6 hours, on status webhooks, and when you press Sync in the app).
Parameters
| Field | Type | Description |
|---|---|---|
| pagequery | integer | Page number, from 1default 1 · 1–10000 |
| limitquery | integer | Items per page (1–100)default 50 · 1–100 |
| statusquery | "APPROVED" | "PENDING" | "REJECTED" | "PAUSED" | "DISABLED" | |
| languagequery | string | max 15 chars |
Response 200
A page of Template objects in data, with page, limit, total and has_more.
Errors: 400 validation error · 401 missing, invalid or revoked api key · 403 key lacks the required scope, or the workspace is suspended · 429 rate limit exceeded
curl "https://zyptos.com/api/v1/templates" \
-H "Authorization: Bearer $ZYPTOS_API_KEY"Conversations
/conversationsmessages:readList conversations
One conversation per contact and number, most recent activity first.
Parameters
| Field | Type | Description |
|---|---|---|
| pagequery | integer | Page number, from 1default 1 · 1–10000 |
| limitquery | integer | Items per page (1–100)default 50 · 1–100 |
| statusquery | "open" | "closed" |
Response 200
A page of Conversation objects in data, with page, limit, total and has_more.
Errors: 400 validation error · 401 missing, invalid or revoked api key · 403 key lacks the required scope, or the workspace is suspended · 429 rate limit exceeded
curl "https://zyptos.com/api/v1/conversations" \
-H "Authorization: Bearer $ZYPTOS_API_KEY"/conversations/{id}/messagesmessages:readList messages in a conversation
Newest first.
Parameters
| Field | Type | Description |
|---|---|---|
| id*path | string (uuid) | Resource id |
| pagequery | integer | Page number, from 1default 1 · 1–10000 |
| limitquery | integer | Items per page (1–100)default 50 · 1–100 |
Response 200
A page of Message objects in data, with page, limit, total and has_more.
Errors: 400 validation error · 401 missing, invalid or revoked api key · 403 key lacks the required scope, or the workspace is suspended · 404 not found · 429 rate limit exceeded
curl "https://zyptos.com/api/v1/conversations/<id>/messages" \
-H "Authorization: Bearer $ZYPTOS_API_KEY"Broadcasts
/broadcastsbroadcasts:writeCreate a broadcast
Sends an approved template to many contacts. Opted-out contacts are skipped when the audience is resolved. Sends go through the platform's rate-limited broadcast queue (20 messages per second by default), and Meta's own per-number messaging limit still applies. Variables may use {{name}} and {{phone}}, filled per contact.
Request body
| Field | Type | Description |
|---|---|---|
| name | string | max 120 chars |
| template* | object | |
| template.name* | string | Template name as approved by Metamax 512 chars |
| template.language* | string | Template language code, e.g. en or en_USmax 15 chars |
| template.variables | string[] | Values for {{1}}, {{2}}… in orderdefault [] · max 20 items |
| template.header_media_url | string (uri) | Public https link for an IMAGE, VIDEO or DOCUMENT header |
| audience* | object | object | object | Exactly one of: { all: true }, { tag }, or { contact_ids } |
Response 202
Returns a Broadcast object.
Errors: 400 validation error · 401 missing, invalid or revoked api key · 403 key lacks the required scope, or the workspace is suspended · 422 no connected number, template not approved, or no matching contacts · 429 rate limit exceeded
curl -X POST "https://zyptos.com/api/v1/broadcasts" \
-H "Authorization: Bearer $ZYPTOS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Diwali offer",
"template": { "name": "diwali_offer", "language": "en", "variables": ["{{name}}"] },
"audience": { "tag": "vip" }
}'/broadcasts/{id}broadcasts:writeGet a broadcast
Includes per-status recipient counts.
Parameters
| Field | Type | Description |
|---|---|---|
| id*path | string (uuid) | Resource id |
Response 200
Returns a Broadcast object.
Errors: 400 validation error · 401 missing, invalid or revoked api key · 403 key lacks the required scope, or the workspace is suspended · 404 not found · 429 rate limit exceeded
curl "https://zyptos.com/api/v1/broadcasts/<id>" \
-H "Authorization: Bearer $ZYPTOS_API_KEY"Objects
Message
| Field | Type | Description |
|---|---|---|
| id* | string (uuid) | |
| conversation_id* | string (uuid) | null | |
| contact_id* | string (uuid) | null | |
| direction* | "in" | "out" | |
| type* | string | text, template, image, video, audio, document, sticker, location, interactive, button, reaction… |
| text* | string | null | Text body or media caption |
| template* | object | null | |
| media* | object | null | |
| status* | "queued" | "sent" | "delivered" | "read" | "failed" | "received" | string | |
| error* | string | null | |
| wa_message_id* | string | null | Meta's message id (wamid), once sent |
| broadcast_id* | string (uuid) | null | |
| sent_at* | string (date-time) | null | |
| delivered_at* | string (date-time) | null | |
| read_at* | string (date-time) | null | |
| created_at* | string (date-time) | ISO 8601 timestamp (UTC) |
Contact
| Field | Type | Description |
|---|---|---|
| id* | string (uuid) | |
| phone* | string | WhatsApp ID: international number without '+', e.g. 919876543210 |
| name* | string | null | |
| profile_name* | string | null | Name from the customer's WhatsApp profile |
| email* | string | null | |
| tags* | string[] | |
| attributes* | map<string, string> | |
| opted_out* | boolean | True after the contact replied STOP, or when set by you. Opted-out contacts never receive templates or broadcasts. |
| source* | string | whatsapp, manual, csv or api |
| last_inbound_at* | string (date-time) | null | |
| created_at* | string (date-time) | ISO 8601 timestamp (UTC) |
Template
| Field | Type | Description |
|---|---|---|
| id* | string (uuid) | |
| name* | string | |
| language* | string | |
| category* | string | null | MARKETING, UTILITY or AUTHENTICATION |
| status* | string | APPROVED, PENDING, REJECTED, PAUSED or DISABLED |
| body* | string | Body text with {{1}}, {{2}} placeholders |
| variables* | integer | Number of body placeholders to fill when sending-9007199254740991–9007199254740991 |
| header_format* | string | null | TEXT, IMAGE, VIDEO or DOCUMENT when the template has a header |
| rejected_reason* | string | null | |
| updated_at* | string (date-time) | ISO 8601 timestamp (UTC) |
Conversation
| Field | Type | Description |
|---|---|---|
| id* | string (uuid) | |
| status* | "open" | "closed" | string | |
| unread* | integer | -9007199254740991–9007199254740991 |
| preview* | string | null | |
| last_message_at* | string (date-time) | null | |
| last_inbound_at* | string (date-time) | null | |
| window_open* | boolean | True while free-form replies are allowed (24 hours after the customer's last message) |
| contact* | object | |
| contact.id* | string (uuid) | |
| contact.phone* | string | |
| contact.name* | string | null |
Broadcast
| Field | Type | Description |
|---|---|---|
| id* | string (uuid) | |
| name* | string | |
| template* | object | |
| template.name* | string | |
| template.language* | string | |
| status* | string | queued, sending, completed or cancelled |
| total* | integer | -9007199254740991–9007199254740991 |
| stats* | object | |
| stats.pending* | integer | -9007199254740991–9007199254740991 |
| stats.sent* | integer | -9007199254740991–9007199254740991 |
| stats.delivered* | integer | -9007199254740991–9007199254740991 |
| stats.read* | integer | -9007199254740991–9007199254740991 |
| stats.failed* | integer | -9007199254740991–9007199254740991 |
| stats.skipped* | integer | -9007199254740991–9007199254740991 |
| created_at* | string (date-time) | ISO 8601 timestamp (UTC) |
| started_at* | string (date-time) | null | |
| completed_at* | string (date-time) | null |
Error
| Field | Type | Description |
|---|---|---|
| error* | object | |
| error.code* | string | Stable machine-readable code |
| error.message* | string | Human-readable explanation |
| error.details | object[] | Per-field problems for validation_error |
| error.details[].path* | string | |
| error.details[].message* | string |