API Reference
Every endpoint, webhook payload and error code of the KonekSip REST API.
Base URL
https://koneksip.com/api
A machine-readable OpenAPI 3.1 description of this API is at https://koneksip.com/api/openapi.json. It needs no API key, and you can import it into Postman or Insomnia.
Authentication
All API requests require authentication using an API key, sent in the Authorization header.
Header Authentication
Send your API key as a Bearer token on every request.
Authorization: Bearer YOUR_API_KEY
Note: Keep your API key secure and never share it publicly.
Conventions
- Request and response bodies are JSON. Send
Content-Type: application/jsonon requests with a body. - Ids in the path (
{message_id},{receiver}, ...) must be URL-encoded. message_idis the id of the message on its channel. The value in a send response, in webhooks and in the path of Mark as Read, React, Edit and Delete is the same. Its format depends on the channel:3EB0…on Unofficial (QR) channels,wamid.…on Official (Cloud API) channels and the Message-ID header (<…@…>) on email.- Success is the HTTP status:
200means the request succeeded. There is nostatusfield in the body. - A success body always holds a
messageand, when there is a result, adatafield. Only responses usedata, request fields are flat. - Each plan has a monthly message limit. Once it is reached, endpoints that send return
429 quota_exceededuntil the next month or an upgrade. - Requests that send a message or an email are limited to 60 per minute for each API key, and all requests together to 120 per minute. Every response carries
X-RateLimit-Limit,X-RateLimit-RemainingandX-RateLimit-Reset(seconds until the window resets). - A WhatsApp user who adopted a username may reach you without a phone number. Meta then identifies them with a business-scoped user ID (BSUID, for example
ID.13491208655302741918). Such a conversation uses the BSUID as itsreceiver: you see it in webhooks and in the read endpoints, and you reply by sending it asreceiver. This works on Official (Cloud API) channels. Phone-number receivers keep working. - Errors are described in Errors.
- Some endpoints only work on Unofficial (QR) channels and say so, Official channels get an
unsupported_channelerror there.
Idempotency
Send an Idempotency-Key header (any unique string, up to 255 characters) with POST /api/messages and POST /api/emails. If you retry after a timeout with the same key and body, the first successful response is returned again, with the header Idempotent-Replayed: true, and nothing is sent twice. Keys are remembered for 24 hours. Reusing a key with a different body returns idempotency_key_reused, a retry while the first request is still running returns idempotency_in_progress. Failed requests do not keep the key.
Idempotency-Key: 7c9e6679-7425-40de-944b-e07fc1f90ae7
Send Text
Send a text message to a WhatsApp number. Every message, whatever its kind, is sent with POST /api/messages, the type field (text, media, buttons or template) picks the kind and the other fields of the body depend on it.
Send Media
Send images, videos, documents, or audio files.
Send List
Send a message with a menu of up to 10 choices. The customer taps the button, picks a row, and the choice arrives on your webhook.
Official (Cloud API) channels only. Other channel types are rejected with an unsupported_channel error. Like every free-form message on an Official channel, a list can only be sent within 24 hours after the customer's last message, use a template outside that window.
Send Template
Send a pre-approved WhatsApp message template. Outside Meta's 24-hour customer service window this is the only way to start a conversation on an Official channel.
Official channels only. Requests for Unofficial channels are rejected with a wrong_channel_type error. Create and approve templates in the dashboard first.
Mark Chat as Read
Send a read receipt (blue ticks) for the latest message the customer sent in a chat.
React to Message
Add an emoji reaction to a message.
Edit Message
Change the text of a message you sent.
Unofficial channels only. Only messages sent by this channel can be edited. {message_id} is the id of a message in your channel, encode it for use in a URL.
Delete Message
Delete a message for everyone, or only on your side.
Unofficial channels only. Deleting for everyone only works on messages sent by this channel, a message from someone else returns not_allowed.
List Conversations
Read your conversations, messages, contacts and templates. Lists are paginated: send limit (1 to 100) and pass the next_cursor of the previous page to get the next one. next_cursor is null on the last page. These endpoints need an active subscription, but the channel does not have to be connected.
The conversations of this channel, most recently active first. Group chats are included.
List Messages
The messages of one conversation, newest first.
Get a Message
One message by its ID, for example the message_id returned when you sent it, to read its current delivery status.
List Contacts
The customers of your organization, oldest first. This is the same customer list you manage under Customers.
List Templates
The message templates of an Official (Cloud API) channel, to use with Send Template. Only approved templates are returned unless you pass all=true. Other channel types return wrong_channel_type.
Channel Status
Get the channel that owns the API key, including whether it is connected right now. Use it to check a channel before you send.
Webhook
Configure a webhook URL to receive incoming WhatsApp messages in real-time. When someone sends a message to your connected WhatsApp number, the system will automatically send the message data to your webhook endpoint.
Important: Your webhook URL must be publicly accessible and accept POST requests with JSON payload. Delivery is retried up to 5 times with backoff if your endpoint is unreachable or errors out.
Setting Up Webhook
1. Configure Webhook URL
In your channel settings, add your webhook URL:
- Click the settings icon on your channel
- Enter your webhook URL (e.g., https://yourdomain.com/webhook)
- Save the settings
Delivery
- Each event is sent as a
POSTwith a JSON body. Answer with any2xxstatus, the response body is ignored. - Headers on every request:
X-Webhook-Id(same asid),X-Webhook-Event(same astype),X-Webhook-Timestamp(same ascreated_at) andUser-Agent: KonekSip-Webhook/1.0. - A failed delivery is retried 5 more times, 1 second, 5 seconds, 30 seconds, 2 minutes and 10 minutes apart, and each attempt times out after 10 seconds.
- The same
idis sent again on a retry, so use it to ignore duplicates. - The order of delivery is not guaranteed, a retried event can arrive after a newer one. Sort events by
created_at. - Redirects are not followed, and URLs that point to private or internal addresses are rejected.
Incoming Message Format
When a message is received, your webhook will receive a POST request with the following data. Every event uses the same envelope: id, type, created_at, channel_id and data.
Conversation Events
Besides messages, the webhook receives events about the conversation itself. They use the same envelope. receiver identifies the conversation, in the same format as in the conversations endpoint. assigned_by is null when the conversation was assigned automatically.
Best Practices
- Always check if
is_meis false before replying to avoid loops - Use HTTPS for your webhook URL for security
- Implement timeout and error handling in your webhook
- Log incoming messages for debugging and analytics
- Consider rate limiting to prevent spam
- Validate incoming data structure before processing
Errors
Every error is { "code": "...", "message": "..." } with a matching HTTP status. Use code in your logic, message is for people and may change.
| HTTP | Code | Description |
|---|---|---|
| 400 | invalid_json |
The request body is not valid JSON |
| 413 | payload_too_large |
The request body is too large |
| 415 | unsupported_media_type |
The body must be sent as JSON with Content-Type: application/json |
| 400 | unsupported_channel |
This channel type does not support the action |
| 400 | wrong_channel_type |
The endpoint is not available for this channel type |
| 401 | invalid_api_key |
The API key is missing or wrong |
| 403 | subscription_ended |
The trial or subscription has ended |
| 403 | not_allowed |
The action is not allowed on this resource |
| 404 | not_found |
The endpoint, message or chat does not exist |
| 409 | channel_not_connected |
The channel is stopped or not connected |
| 409 | idempotency_in_progress |
A request with the same Idempotency-Key is still being processed |
| 422 | validation_failed |
The request is invalid, errors lists each field |
| 422 | invalid_receiver |
The receiver is not a valid WhatsApp number |
| 422 | channel_misconfigured |
The channel settings are incomplete |
| 422 | verification_failed |
The credentials could not be verified |
| 422 | idempotency_key_reused |
The Idempotency-Key was already used with a different request |
| 429 | rate_limited |
Too many requests or delivery failures, wait retry_after seconds (also sent as the Retry-After header) |
| 429 | quota_exceeded |
The monthly message limit of your plan is reached, sending resumes next month or after an upgrade |
| 500 | request_failed |
The request failed on our side |
| 502 | provider_error |
WhatsApp or Meta rejected the request, message carries their reason |
Need Help?
If you have questions or need assistance, our support team is here to help.