Skip to Content
Send WhatsApp MessageSend a Message

Send WhatsApp Messages

Send an approved WhatsApp template message to any phone number.

POST /v1/whatsapp/send

The public API also supports customer-service-window messages:

EndpointPurpose
POST /v1/whatsapp/send/textSend text with URL preview and optional reply-to ID
POST /v1/whatsapp/send/mediaSend an image, video, audio, or document URL

Free-form text and media can only be sent within the open 24-hour WhatsApp customer-service window. Use an approved template to start or reopen a conversation.

Request body

FieldTypeRequiredDescription
tostring✓Recipient phone number in E.164 format (e.g. +254700000000)
phone_number_idstring✓Your sending phone number id from /v1/whatsapp/phone_numbers
template_namestring✓The template name from the templates endpoint
language_codestring✓The template language from the templates endpoint (e.g. en_US)
variablesobject—Template placeholder values. See Template Variables.
media_urlstring—Public URL of media to use as template header. Alternative to media_id. See Sending with Media.
media_idstring—media_id from the upload endpoint. Alternative to media_url. See Sending with Media.
catalog_idstring—Meta catalog ID the products in variables.cards belong to. Required for Product Carousels.
locationobjectFor location templatesLatitude, longitude, name, and address for a template with a location header. See Location Templates.

The variables object holds one entry per template section:

FieldTypeDescription
variables.headerobjectHeader placeholder values, keyed by param_name
variables.bodyobjectBody placeholder values, keyed by param_name
variables.buttonsobjectDynamic URL button values, keyed by button position. See Button Variables.
variables.cardsobjectCarousel cards, keyed by card position starting at "1". See Carousels.

Use the exact template_name and language_code as returned by the templates endpoint. Phone numbers are identified by their phone number ID (id field), not the phone number itself.

Sending a message template

If the template has no placeholders, omit the variables field entirely.

curl -X POST https://api.bahasha.app/v1/whatsapp/send \ -H "Authorization: Bearer bh_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "to": "+254700000000", "phone_number_id": "123456789", "template_name": "hello_world", "language_code": "en_US" }'

Response

{ "success": true, "message_id": "wamid.HBgNMjU0NzAwMDAwMDAwFQIAERgSNDQ1...", "to": "+254700000000", "template": "order_confirmation" }

A successful response means the request was accepted — it does not guarantee delivery. Use webhooks to track delivery status (sent, delivered, read, failed).


Send free-form text

curl -X POST https://api.bahasha.app/v1/whatsapp/send/text \ -H "Authorization: Bearer bh_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "to": "+254700000000", "phone_number_id": "123456789", "text": "Your order is ready for collection.", "preview_url": true, "reply_to_message_id": "wamid.optional" }'

Send session media

curl -X POST https://api.bahasha.app/v1/whatsapp/send/media \ -H "Authorization: Bearer bh_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "to": "+254700000000", "phone_number_id": "123456789", "media_type": "document", "media_url": "https://example.com/invoice.pdf", "caption": "Your invoice", "filename": "invoice.pdf" }'

Choose your scenario

Everything else you can send is a variation on the request above.