Bahasha WhatsApp API
Send WhatsApp template and free-form messages, manage phone numbers and templates, and build real-time message integrations with Bahasha’s Official WhatsApp Business API.
If you are looking to send bulk WhatsApp messages from a dashboard rather than from code, use the Bahasha Dashboard instead.
Base URL:
https://api.bahasha.appAll API endpoints are relative to this base URL. Requests must be made over HTTPS and authenticated with an Authorization: Bearer <key> header.
Quickstart
Up and running in 4 steps.
Create an API key
Go to Settings → API Keys → Create key in your Bahasha dashboard , choose an environment (sandbox or production), and copy your key.
API keys are shown only once when created. Store them securely as environment variables. If you lose a key, revoke it and generate a new one.
Fetch your phone number ID
curl https://api.bahasha.app/v1/whatsapp/phone_numbers \
-H "Authorization: Bearer bh_live_xxxxxxxxxxxx"Save the id field from the response — this is your phone_number_id. It is not the phone number itself. See Phone Numbers.
Fetch your templates
curl https://api.bahasha.app/v1/whatsapp/phone_numbers/<phone_number_id>/templates \
-H "Authorization: Bearer bh_live_xxxxxxxxxxxx"Each template includes an expected_variables field listing all placeholder variables you need to supply when sending. See Templates.
Send your first template message
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": "<id-from-step-2>",
"template_name": "hello_world",
"language_code": "en_US"
}'If your template has placeholders, add a variables field. See Template Variables.
Once the customer replies, the customer service window opens and you can send free-form text or media. See Free-form Messages and how the customer service window works.
Register your webhook (optional)
Register a webhook to receive real-time delivery reports (sent, delivered, read, failed) and customer reply events.
Testing? Use a bh_test_* sandbox key to get realistic responses without sending real messages or spending message credits. See Sandbox Environment.
What you can send
Compare template and free-form messages and how the customer service window works.
Send a MessageSend an approved template at any time, including to reopen a conversation.
Template MessagesReply with text or media while the customer service window is open.
Free-form MessagesFill named and positional placeholders in the header and body.
Template VariablesSend one-time passcodes with authentication templates.
Authentication (OTP)Multi-card carousels with per-card variables, and product cards from your catalog.
Media Card CarouselsNext steps
- Authentication — API key types, environments, and best practices
- Phone Numbers — list your connected WhatsApp numbers
- Templates — explore your approved templates and their variables
- Template Messages — send an approved template at any time
- Free-form Messages — reply with text or media inside an open customer service window
- Template Media — upload, attach, and manage images, videos, and documents on templates
- Contacts — fetch, create, and update contacts with tags and attributes
- Webhooks — receive delivery reports and customer replies at your own endpoint
- Error Codes — status codes and error response shapes