Send a WhatsApp message or mark inbound as read
Meta-style messages endpoint. Two operations share the same path, distinguished by the request body:
Outbound send — body has a type field (text, image, document, video, audio, template, interactive). Body shape mirrors the Meta WhatsApp Cloud API; media variants accept either link (hosted URL) or id (Meta uploaded media). Optional top-level context: { message_id } creates a contextual reply — pass the inbound wamid from your webhook (messages[0].id), not a Kirim msg_* id. The sender is the WhatsApp account identified by phone_number_id in the URL path; there is no from field in the body. Pass Idempotency-Key to safely retry on network failure.
Read receipt — body has status: "read" + message_id (the inbound wamid from your webhook). Sends a read receipt back to the sender so the double-tick turns blue on their phone. Optional typing_indicator: { type: "text" } shows a typing bubble alongside the receipt; Meta auto-dismisses after ~25 seconds or on first outbound message.
Pre-send validation — the API performs compliance checks before queuing the send. A 422 response with error.code set to marketing_opted_out indicates the recipient has stopped marketing messages from your business (the customer did this via the WhatsApp app menu — webhook user_preferences notifies you of the change). account_restricted indicates Meta has restricted your WhatsApp account; check the account status via the dashboard. consent_required indicates the recipient has not opted in. customer_suspended indicates the operator has suspended (or archived) the customer that owns this WhatsApp account; sends are blocked until the customer is unsuspended via the dashboard. upstream_error indicates the WhatsApp account is disconnected. None of these are retryable until the underlying condition changes.
Request
- Base URL: https://api.kirimdev.com/v1
- URL: https://api.kirimdev.com/v1/{phone_number_id}/messages
- Auth: HTTP bearer
Path parameters
Meta WhatsApp Business phone_number_id of the connected account that should send / own this resource. Discoverable via GET /v1/accounts (returned as phone_number_id on each row).
Headers
Optional retry key. Reusing the same key with the same method, path, and body within 24 hours returns the original response; reusing it for a different request returns 422.
Request body
Example request
{
"to": "628123456789",
"recipient": "US.13491208655302741918",
"context": {
"message_id": "wamid.HBgNNjI4MTIzNDU2Nzg5FQIAEhggMUE5MDM1QzVDMUYxQTAyRkVCNzZDQjVDMjFFRDQzNTUA"
}
}Response
Message accepted for delivery, or read receipt sent.
Example response
{
"data": {
"id": "msg_01HXYZABCDEFGHJKMNPQRSTVWX",
"to": "+628123456789",
"bsuid": "US.13491208655302741918",
"parent_bsuid": "US.ENT.11815799212886844830",
"username": "pablomorales",
"reaction": {
"message_id": "wamid.HBgN...",
"emoji": "👍"
}
},
"request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"
}Changes
No recorded changes to this operation across all 1 revision of this API.