zyptos
Start free

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.

Base URL
https://zyptos.com/api/v1

Authentication

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
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.

ScopeAllows
contacts:readRead contacts
contacts:writeCreate and update contacts
messages:readRead conversations and messages
messages:sendSend messages
templates:readRead templates
broadcasts:writeCreate 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.

Send a template
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.

400 Bad Request
{
  "error": {
    "code": "validation_error",
    "message": "The request has invalid or missing fields.",
    "details": [{ "path": "phone", "message": "Invalid input: expected string, received undefined" }]
  }
}
StatuscodeWhen
400validation_errorInvalid JSON, missing or invalid fields, wrong number of template variables
401unauthorizedMissing, malformed, unknown or revoked key
403forbiddenThe key lacks the required scope
403workspace_inactiveThe workspace is suspended or cancelled
404not_foundNo such resource in this workspace, or no such endpoint
409opted_outTemplate to a contact who opted out
422no_whatsapp_numberNo connected WhatsApp number
422window_closedFree text outside the 24-hour window
422template_not_approvedUnknown, unapproved or authentication template
429rate_limitedToo many requests (see Retry-After)
503sending_pausedSending 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

get/me

Get 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

FieldTypeDescription
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

Example
curl "https://zyptos.com/api/v1/me" \
  -H "Authorization: Bearer $ZYPTOS_API_KEY"
get/usage

Get 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

FieldTypeDescription
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

Example
curl "https://zyptos.com/api/v1/usage" \
  -H "Authorization: Bearer $ZYPTOS_API_KEY"

Messages

post/messagesmessages:send

Send 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

FieldTypeDescription
type*"text"
tostringRecipient phone number. Creates the contact if it's new.max 24 chars
contact_idstring (uuid)Recipient contact id (instead of `to`)
text*object
text.body*stringmax 4096 chars
text.preview_urlbooleanShow a link preview for the first URLdefault true

or template

FieldTypeDescription
type*"template"
tostringRecipient phone number. Creates the contact if it's new.max 24 chars
contact_idstring (uuid)Recipient contact id (instead of `to`)
template*object
template.name*stringTemplate name as approved by Metamax 512 chars
template.language*stringTemplate language code, e.g. en or en_USmax 15 chars
template.variablesstring[]Values for {{1}}, {{2}}… in orderdefault [] · max 20 items
template.header_media_urlstring (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

Example
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." }
}'
get/messages/{id}messages:read

Get a message

Poll this, or subscribe to the message.status webhook, to follow a message from queued to sent, delivered and read.

Parameters

FieldTypeDescription
id*pathstring (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

Example
curl "https://zyptos.com/api/v1/messages/<id>" \
  -H "Authorization: Bearer $ZYPTOS_API_KEY"

Contacts

get/contactscontacts:read

List contacts

Newest first. Filter by search text, tag or opt-out state.

Parameters

FieldTypeDescription
pagequeryintegerPage number, from 1default 1 · 1–10000
limitqueryintegerItems per page (1–100)default 50 · 1–100
qquerystringMatches name, profile name, phone or emailmax 100 chars
tagquerystringOnly 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

Example
curl "https://zyptos.com/api/v1/contacts" \
  -H "Authorization: Bearer $ZYPTOS_API_KEY"
post/contactscontacts:write

Create 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

FieldTypeDescription
phone*stringPhone number with country code, e.g. +91 98765 43210 or 919876543210max 24 chars
namestringmax 120 chars
emailstring (email)
tagsstring[]max 50 items
attributesmap<string, string>Custom key/value fields
opted_outboolean

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

Example
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" }
}'
get/contacts/{id}contacts:read

Get a contact

Parameters

FieldTypeDescription
id*pathstring (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

Example
curl "https://zyptos.com/api/v1/contacts/<id>" \
  -H "Authorization: Bearer $ZYPTOS_API_KEY"
patch/contacts/{id}contacts:write

Update 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

FieldTypeDescription
id*pathstring (uuid)Resource id

Request body

FieldTypeDescription
namestring | null
emailstring (email) | null
tagsstring[]max 50 items
attributesmap<string, string>Custom key/value fields
opted_outboolean

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

Example
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

get/templatestemplates:read

List 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

FieldTypeDescription
pagequeryintegerPage number, from 1default 1 · 1–10000
limitqueryintegerItems per page (1–100)default 50 · 1–100
statusquery"APPROVED" | "PENDING" | "REJECTED" | "PAUSED" | "DISABLED"
languagequerystringmax 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

Example
curl "https://zyptos.com/api/v1/templates" \
  -H "Authorization: Bearer $ZYPTOS_API_KEY"

Conversations

get/conversationsmessages:read

List conversations

One conversation per contact and number, most recent activity first.

Parameters

FieldTypeDescription
pagequeryintegerPage number, from 1default 1 · 1–10000
limitqueryintegerItems 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

Example
curl "https://zyptos.com/api/v1/conversations" \
  -H "Authorization: Bearer $ZYPTOS_API_KEY"
get/conversations/{id}/messagesmessages:read

List messages in a conversation

Newest first.

Parameters

FieldTypeDescription
id*pathstring (uuid)Resource id
pagequeryintegerPage number, from 1default 1 · 1–10000
limitqueryintegerItems 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

Example
curl "https://zyptos.com/api/v1/conversations/<id>/messages" \
  -H "Authorization: Bearer $ZYPTOS_API_KEY"

Broadcasts

post/broadcastsbroadcasts:write

Create 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

FieldTypeDescription
namestringmax 120 chars
template*object
template.name*stringTemplate name as approved by Metamax 512 chars
template.language*stringTemplate language code, e.g. en or en_USmax 15 chars
template.variablesstring[]Values for {{1}}, {{2}}… in orderdefault [] · max 20 items
template.header_media_urlstring (uri)Public https link for an IMAGE, VIDEO or DOCUMENT header
audience*object | object | objectExactly 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

Example
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" }
}'
get/broadcasts/{id}broadcasts:write

Get a broadcast

Includes per-status recipient counts.

Parameters

FieldTypeDescription
id*pathstring (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

Example
curl "https://zyptos.com/api/v1/broadcasts/<id>" \
  -H "Authorization: Bearer $ZYPTOS_API_KEY"

Objects

Message

FieldTypeDescription
id*string (uuid)
conversation_id*string (uuid) | null
contact_id*string (uuid) | null
direction*"in" | "out"
type*stringtext, template, image, video, audio, document, sticker, location, interactive, button, reaction…
text*string | nullText 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 | nullMeta'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

FieldTypeDescription
id*string (uuid)
phone*stringWhatsApp ID: international number without '+', e.g. 919876543210
name*string | null
profile_name*string | nullName from the customer's WhatsApp profile
email*string | null
tags*string[]
attributes*map<string, string>
opted_out*booleanTrue after the contact replied STOP, or when set by you. Opted-out contacts never receive templates or broadcasts.
source*stringwhatsapp, manual, csv or api
last_inbound_at*string (date-time) | null
created_at*string (date-time)ISO 8601 timestamp (UTC)

Template

FieldTypeDescription
id*string (uuid)
name*string
language*string
category*string | nullMARKETING, UTILITY or AUTHENTICATION
status*stringAPPROVED, PENDING, REJECTED, PAUSED or DISABLED
body*stringBody text with {{1}}, {{2}} placeholders
variables*integerNumber of body placeholders to fill when sending-9007199254740991–9007199254740991
header_format*string | nullTEXT, IMAGE, VIDEO or DOCUMENT when the template has a header
rejected_reason*string | null
updated_at*string (date-time)ISO 8601 timestamp (UTC)

Conversation

FieldTypeDescription
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*booleanTrue 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

FieldTypeDescription
id*string (uuid)
name*string
template*object
template.name*string
template.language*string
status*stringqueued, 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

FieldTypeDescription
error*object
error.code*stringStable machine-readable code
error.message*stringHuman-readable explanation
error.detailsobject[]Per-field problems for validation_error
error.details[].path*string
error.details[].message*string