Quickstart

Create a key and send your first WhatsApp message in five minutes.

Create a key

An owner or admin creates keys in Settings, API keys. Give it a name and the scopes conversations:read, messages:read and messages:write. The key is shown once, so store it in your secret manager right away.

export OMNIO_API_KEY="omn_..."

Find a conversation

A conversation opens when a customer writes to your WhatsApp number. List the latest one.

curl "https://api.omnio.sawego.com/v1/conversations?limit=1" \
  -H "Authorization: Bearer $OMNIO_API_KEY"

window is open while the customer wrote in the last 24 hours. Outside it only a template goes through, see Templates and the 24 h window.

Send a message

Every send carries an Idempotency-Key, so a retry after a timeout never sends twice. The API answers 202 with the message in queued.

curl -X POST https://api.omnio.sawego.com/v1/messages \
  -H "Authorization: Bearer $OMNIO_API_KEY" \
  -H "Idempotency-Key: 9f1c2b7e-5d4a-4e8b-a3c6-1f0e2d9b8a77" \
  -H "Content-Type: application/json" \
  -d '{"conversation_id": "b1c7e0a4-52a3-4a3c-8d0e-6c1b9e5f7a20", "type": "text", "content": {"text": "Your order 4821 ships Thursday."}}'
{
  "message_id": "3c5e7a90-8d1b-4e26-a4f7-5b9d0c2e1a68",
  "conversation_id": "b1c7e0a4-52a3-4a3c-8d0e-6c1b9e5f7a20",
  "seq": 43,
  "direction": "outbound",
  "source": "api",
  "type": "text",
  "status": "queued"
}

Follow the status

The message moves to submitted, sent, delivered and read. Read it back with Get message, or register a webhook for message.status_updated and let Omnio tell you. Next, read Authentication and Webhooks.

NextAuthentication and scopes