IKONIA
CX
← Documentation

API Reference

Send messages, pull conversations into your CRM, raise tickets from your helpdesk. Everything below is scoped to your organisation — a key can never read another tenant's data.

Getting a key

  1. Sign in and open Settings → API keys. You must be an admin.
  2. Click New key, name it after the system that will use it.
  3. Choose test while you build. Test keys behave identically but never deliver anything to a customer: every send, file and broadcast is recorded as usual and answers delivered: false, test_mode: true, but nothing leaves IkoniaCX.
  4. Grant only the scopes that integration needs.
  5. Copy the key immediately. It is shown once — we store only a hash and cannot recover it. Lost keys are revoked and replaced, not retrieved.

Authenticating

Send the key as a bearer token. Treat it like a password: server-side only, never in browser code, a mobile app, or a git repository.

curl https://cx.ikonia.co.za/api/v1/ping \
  -H "Authorization: Bearer ikx_live_your_key_here"

If your HTTP client cannot set Authorization, X-API-Key is accepted as an alternative.

/ping confirms which organisation the key resolved to — the first thing to check when something is not behaving:

{
  "ok": true,
  "organization": { "id": "…", "name": "Acme Ltd" },
  "environment": "live",
  "scopes": ["conversations:read", "messages:send"]
}

Scopes

Deny by default: a key can do only what it was granted. Sending scopes are separated from writing scopes on purpose — they cost money and reach real people, so a read-mostly integration cannot message anyone even if it is compromised.

conversations:readList and read conversations
conversations:writeClose, reopen and assign conversations
messages:readRead messages in a conversation
messages:sendSend a message to a customer
contacts:readList and read contacts
contacts:writeCreate and update contacts, manage groups
tickets:readList and read tickets
tickets:writeCreate and update tickets
broadcasts:sendSend a WhatsApp broadcast
webhooks:manageRegister and remove webhook endpoints

Endpoints

All read endpoints are live. Every list is cursor paginated and returns data, has_more and next_cursor.

GET/v1/ping—

Which organisation this key belongs to, and its scopes

GET/v1/conversationsconversations:read

List conversations across every channel

GET/v1/conversations/{id}conversations:read

One conversation with its contact and channel

GET/v1/conversations/{id}/messagesmessages:read

The transcript, oldest first, with the files on each message

GET/v1/messages/{id}/attachments/{n}messages:read

Download one file of a message

GET/v1/contactscontacts:read

List and search contacts

GET/v1/contacts/{id}contacts:read

One contact, including the groups it belongs to

GET/v1/contact-groupscontacts:read

Audiences, with member counts

GET/v1/ticketstickets:read

List tickets

GET/v1/tickets/{id}tickets:read

One ticket

GET/v1/contacts/{id}/conversationsconversations:read

Every conversation with one person, across all channels

POST/v1/messagesmessages:send

Send email or WhatsApp to a person — creates the contact and thread if needed

POST/v1/conversations/{id}/messagesmessages:send

Reply in an existing thread, with files if you like

PATCH/v1/conversations/{id}conversations:write

Close, reopen, or set the topic

POST/v1/contactscontacts:write

Create a contact, or return the existing match

PATCH/v1/contacts/{id}contacts:write

Update a contact

POST/v1/ticketstickets:write

Raise a ticket, optionally against a conversation

PATCH/v1/tickets/{id}tickets:write

Update status, priority or subject

POST/v1/contact-groupscontacts:write

Create a sending list (idempotent on name)

GET/v1/contact-groups/{id}/memberscontacts:read

Who is on the list, and how many have no phone

POST/v1/contact-groups/{id}/memberscontacts:write

Add members by id, email address or phone

DELETE/v1/contact-groups/{id}/memberscontacts:write

Remove members

GET/v1/whatsapp/templatesbroadcasts:send

Approved templates and how many variables each takes

POST/v1/whatsapp/templatesbroadcasts:send

Submit a template for WhatsApp approval

GET/v1/broadcastsbroadcasts:send

Broadcast history

POST/v1/broadcastsbroadcasts:send

Send an approved template to an audience

GET/v1/broadcasts/{id}broadcasts:send

Progress and failures

GET/v1/webhookswebhooks:manage

Registered endpoints and the events available

POST/v1/webhookswebhooks:manage

Register an endpoint — returns the signing secret once

GET/v1/webhooks/{id}webhooks:manage

One endpoint, with its last 20 delivery attempts

PATCH/v1/webhooks/{id}webhooks:manage

Change events, pause, or re-enable after failures

DELETE/v1/webhooks/{id}webhooks:manage

Remove an endpoint

Common query parameters:

limitRows per page, 1–100. Default 25.
cursorPass next_cursor from the previous response.
statusconversations: open, closed · tickets: open, pending, resolved, closed
channelconversations: gmail, facebook, instagram, whatsapp
searchcontacts: matches name, email, phone or company
group_idcontacts: only members of that group

Conversations

curl "https://cx.ikonia.co.za/api/v1/conversations?status=open&limit=25" \
  -H "Authorization: Bearer $IKONIACX_KEY"

Filters: status (open/closed), channel(gmail, facebook, instagram, whatsapp), limit (max 100),cursor.

{
  "data": [
    {
      "id": "…",
      "subject": "Where is my order?",
      "status": "open",
      "last_message_at": "2026-08-06T09:12:00Z",
      "contacts": { "name": "Jane Smith", "email": "jane@example.com" },
      "channels": { "provider": "gmail" }
    }
  ],
  "has_more": true,
  "next_cursor": "2026-08-06T09:12:00Z"
}

Webhooks

Rather than polling, register an endpoint and we will POST to it when something happens.

curl -X POST https://cx.ikonia.co.za/api/v1/webhooks   -H "Authorization: Bearer $IKONIACX_KEY"   -H "Content-Type: application/json"   -d '{
    "url": "https://your-app.example.com/hooks/ikoniacx",
    "events": ["message.received", "ticket.created"]
  }'

The response includes a secret shown once. Store it — every delivery is signed with it.

message.receivedA customer sent you something, on any channel
message.sentA message went out — from your API calls or from the app
conversation.closedA thread was closed
ticket.createdA ticket was raised
ticket.status_changedA ticket moved status

Verifying a delivery

Every request carries X-IkoniaCX-Signature: t=<unix>,v1=<hex>. The signature covers "<t>.<raw body>", so you must hash the body exactly as received — parse it only after verifying.

const crypto = require('crypto')

function verify(rawBody, header, secret) {
  const parts = Object.fromEntries(header.split(',').map(p => p.split('=')))
  const t = Number(parts.t)

  // Reject anything older than five minutes. The timestamp is INSIDE the
  // signed string, so a captured request cannot be re-stamped and replayed.
  if (Math.abs(Date.now() / 1000 - t) > 300) return false

  const expected = crypto.createHmac('sha256', secret)
    .update(t + '.' + rawBody).digest('hex')

  return crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1))
}

What we expect from you

Pagination

Cursor-based, not offset. New messages arrive constantly, so an offset page shifts under you between requests and rows are silently skipped or repeated. Pass next_cursor back as cursor until has_more is false.

# page through every contact
cursor=""
while :; do
  page=$(curl -s "https://cx.ikonia.co.za/api/v1/contacts?limit=100&cursor=$cursor" -H "Authorization: Bearer $IKONIACX_KEY")
  echo "$page" | jq -r '.data[].id'
  [ "$(echo "$page" | jq -r .has_more)" = "true" ] || break
  cursor=$(echo "$page" | jq -r .next_cursor)
done

The cursor is opaque — do not construct or parse one. It encodes both the sort value and the row id, which is what stops rows being skipped when several share a timestamp (common in imported data). An invalid cursor returns 400 invalid_cursor.

Idempotency

Required on every request that sends something. The header is any unique string you generate — one per message, reused unchanged on every retry of that message.

curl -X POST https://cx.ikonia.co.za/api/v1/conversations/{id}/messages \
  -H "Authorization: Bearer $IKONIACX_KEY" \
  -H "Idempotency-Key: 7f3a9c2e-4b1d-4e8a-9f2c-1a2b3c4d5e6f" \
  -H "Content-Type: application/json" \
  -d '{"content": "Your order ships today."}'

Reuse the same key when you retry. If a request times out you cannot tell whether it arrived — retrying with the same key returns the original result instead of sending a second message. Generating a fresh key per attempt defeats the mechanism entirely, and your customer receives duplicates.

Starting a WhatsApp conversation

WhatsApp only delivers free text within 24 hours of the customer's last message to you. To message someone first, or someone who has gone quiet, send an approved template: pass template in place of content.

curl -X POST https://cx.ikonia.co.za/api/v1/messages \
  -H "Authorization: Bearer $IKONIACX_KEY" \
  -H "Idempotency-Key: 5b1e0c9a-2d3f-4a6b-8c7d-9e0f1a2b3c4d" \
  -H "Content-Type: application/json" \
  -d '{
    "channel": "whatsapp",
    "to": "+27821234567",
    "template": { "name": "new_enquiry", "variables": ["Thandi"] }
  }'

Sending files

Both send endpoints take attachments, on WhatsApp and email. On WhatsApp each file arrives as its own message, and content becomes the caption of the first file that can carry one. A file on its own is a message, so content is optional when you attach something.

curl -X POST https://cx.ikonia.co.za/api/v1/conversations/{id}/messages \
  -H "Authorization: Bearer $IKONIACX_KEY" \
  -H "Idempotency-Key: 3c9e1f2a-6b7d-4e8f-a1b2-c3d4e5f6a7b8" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Your invoice is attached.",
    "attachments": [
      { "filename": "invoice.pdf", "content_type": "application/pdf", "data": "JVBERi0xLjQK..." },
      { "url": "https://files.example.com/brochure.pdf" }
    ]
  }'

Or upload files directly as multipart/form-data, which avoids base64:

curl -X POST https://cx.ikonia.co.za/api/v1/conversations/{id}/messages \
  -H "Authorization: Bearer $IKONIACX_KEY" \
  -H "Idempotency-Key: 8d2f4a6c-1e3b-4c5d-9f7a-0b1c2d3e4f5a" \
  -F "content=Photos from today's visit" \
  -F "attachments=@site-1.jpg" \
  -F "attachments=@site-2.jpg"

Receiving files

Every message carries an attachments list: in message.received and message.sent webhooks, and on each message from GET /v1/conversations/{id}/messages. It is empty when there are no files. Each entry has a url that downloads the file with your API key (scope messages:read).

"attachments": [
  {
    "type": "image",
    "filename": null,
    "mime_type": "image/jpeg",
    "size_bytes": 134501,
    "url": "https://cx.ikonia.co.za/api/v1/messages/wamid.HBgL...%3D/attachments/0"
  }
]
curl -L "https://cx.ikonia.co.za/api/v1/messages/wamid.HBgL...%3D/attachments/0" \
  -H "Authorization: Bearer $IKONIACX_KEY" -o photo.jpg

Rate limits

Reads600 / minute
Writes120 / minute
Sends60 / minute

Every response carries X-RateLimit-Remaining. A 429 includes Retry-After in seconds — wait that long rather than retrying immediately.

Errors

RFC 7807 application/problem+json. Branch on code, show detail to a human.

{
  "type": "https://cx.ikonia.co.za/docs/api/errors#insufficient_scope",
  "title": "insufficient scope",
  "status": 403,
  "code": "insufficient_scope",
  "detail": "This key is missing the \"messages:send\" scope."
}
401missing_api_keyNo key was sent. Use the Authorization header.
401invalid_api_keyUnknown, revoked or expired key. The same message is returned for all three deliberately.
403insufficient_scopeThe key is valid but lacks the scope this endpoint needs.
404not_foundNo such record — or it belongs to another organisation. Identical response for both, by design.
400invalid_parameterA query parameter is out of range or not a recognised value.
400invalid_cursorThe cursor was altered or is from a different endpoint. Pass next_cursor back unchanged.
409outside_messaging_windowWhatsApp free text needs a customer message in the last 24 hours. Send a template instead. Nothing was sent.
409template_not_approvedWhatsApp has not approved that template (or has paused it), so it cannot be sent.
400variable_mismatchThe number of template variables supplied does not match the template.
400invalid_attachmentAn attachment is malformed: not base64, no filename, or both data and url.
422invalid_attachmentThe channel cannot carry that file (type, size or count). The detail names the file. Nothing was sent.
422attachments_unsupportedFiles can be sent on email and WhatsApp only. Nothing was sent.
404attachment_not_foundThe message has no file at that position.
410attachment_expiredA Facebook or Instagram file whose link Meta no longer serves. Fetch files when the webhook arrives.
502attachment_unavailableThe mailbox did not return an email attachment. Try again later.
502partially_deliveredSome WhatsApp messages of a multi-file send went out before one failed. They are recorded. Do not retry with the same key.
429rate_limitedBudget exhausted. Honour Retry-After.
500internal_errorOur fault. The request did not complete.

Keeping keys safe

Not built yet

Reading, writing, sending, broadcasting and outbound webhooks are all live. Google Business reviews are the one deliberate omission — see above. Google Business reviews are not available over the API. They are managed in IkoniaCX itself, where replying to one is a judgement call rather than something a third-party system should automate.