Products
WhatsApp Business APIWhatsApp chatbotWhatsApp marketingConversationsAI StudioSMS gatewayCloud call centerCompany
IndustriesDevelopersPricingInsightsWhatsApp API guideWhatsApp API by countryCompare UnecastPartnersAboutContactLog inDevelopers
APIs for WhatsApp, SMS and AI agents.
Send and receive WhatsApp messages, manage contacts and webhooks, send SMS over REST or SMPP, and run your AI agents from any system.
# Send an approved WhatsApp template curl -X POST https://platform.unecast.com/api/v1/messages/template \ -H "X-API-Key: YOUR_API_KEY" \ -H "X-API-Secret: YOUR_API_SECRET" \ -H "Content-Type: application/json" \ -d '{ "to": "94771234567", "templateName": "order_shipment_update", "language": "en", "components": [{ "type": "body", "parameters": [{ "type": "text", "text": "Maya" }] }] }'
# Send a transactional SMS curl -X POST https://api.unecast.com/v2/send \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "channel": "sms", "from": "YOURBRAND", "to": "94771234567", "message": "Your OTP is 482913", "priority": 3 }'
# Run an AI agent you built in AI Studio curl -X POST https://aistudio.unecast.com/agents/YOUR_AGENT_ID/runs \ -H "Authorization: Bearer YOUR_TENANT_KEY" \ -H "Content-Type: application/json" \ -d '{ "message": "Do you deliver to Kandy?" }'
Start here
Pick the API for the job, then get credentials.
Three APIs, each with its own account and keys, and the SMS API also connects over SMPP. Keys belong on your server, never in a browser, app or public repository.
| You want to | Use | Authentication | How to get credentials |
|---|---|---|---|
| Send WhatsApp templates and replies, manage contacts, receive webhooks | WhatsApp API, platform.unecast.com/api/v1 | X-API-Key and X-API-Secret headers | Create an account, then Settings, API keys |
| Send SMS, read balance and delivery status | SMS API, api.unecast.com/v2 | Bearer token | Open an SMS portal account, then Developer, Create app, HTTP (REST API) |
| Send high volumes of SMS from your own platform | SMPP, smsc.unecast.com:2775 | Per-app system ID and password | Create an SMPP app in the SMS portal, then bind over standard SMPP 3.4 |
| Run an AI agent from your own system | AI agent API, aistudio.unecast.com | Bearer tenant key | Ask for AI Studio access |
WhatsApp API: errors and webhooks
Errors return 400 (invalid request), 401 (missing or invalid key or secret), 403 (no permission, or the 24-hour window has closed), 404, 409 (already exists), 429 (rate limit; limits per minute and per month depend on your plan) and 500. Webhooks send message.sent, message.delivered, message.read, message.failed, conversation.new and contact.new, with a secret for checking the signature.
SMS: delivery statuses
Messages move through Queued, Processing and Sent to Delivered, or end as Undelivered, Expired, Rejected or Failed. Scheduled campaigns show as Scheduled. Each message shows its cost.
Test safely
- There is no separate sandbox. Use the API Playground in Settings, API keys, to send real requests with a key you can revoke.
- Test with your own phone number and an approved template before you message customers.
- For SMS, test with a small top-up and your own number.
- Revoke and replace a key at once if it is ever exposed.
WhatsApp API
Base URL https://platform.unecast.com. Authenticate every request with your API key and secret in the X-API-Key and X-API-Secret headers. Create keys in Settings, API keys; the secret is shown once. The in-app API docs also show an X-Channel-Id header for choosing the WhatsApp number.
| Method | Path | What it does |
|---|---|---|
| POST | /api/v1/messages/template | Send an approved template message to a contact |
| POST | /api/v1/messages/reply | Send a free-text reply inside the 24-hour service window |
| GET | /api/v1/messages/:contactPhone | Get the message history for a contact |
| GET | /api/v1/messages/status/:messageId | Get the delivery status of a message |
| GET | /api/v1/contacts | List contacts |
| POST | /api/v1/contacts | Create a contact |
| PUT | /api/v1/contacts/:id | Update a contact |
| DELETE | /api/v1/contacts/:id | Delete a contact |
| GET | /api/v1/contacts/groups | List contact groups |
| POST | /api/v1/contacts/groups/:groupId/add | Add contacts to a group |
| POST | /api/v1/contacts/groups/:groupId/remove | Remove contacts from a group |
| GET | /api/v1/templates | List message templates |
| GET | /api/v1/campaigns | List campaigns |
| GET | /api/v1/account | Get account details |
| GET | /api/v1/account/usage | Get account usage |
| GET | /api/v1/webhooks | List webhooks |
| POST | /api/v1/webhooks | Create a webhook |
| PUT | /api/v1/webhooks/:id | Update a webhook |
| DELETE | /api/v1/webhooks/:id | Delete a webhook |
Webhooks deliver incoming messages and status changes to your server. Full request and response examples are in API docs inside your Unecast workspace.
SMS API
All SMS calls use a Bearer token in the Authorization header. Get credentials by creating an app in the SMS portal's Developer area and choosing HTTP (REST API) or SMPP. SMPP is for high-volume systems and connects to smpp://smsc.unecast.com:2775 over standard SMPP 3.4. The standard limit is 600 SMS submissions a minute.
| Method | Path | What it does |
|---|---|---|
| POST | https://api.unecast.com/v2/send | Send a message with channel, from, to, message and priority (0 lowest to 3 highest) |
| GET | https://api.unecast.com/v2/account/balance | Read your account balance |
| GET | https://api.unecast.com/v2/status/{message_id} | Read the delivery status of one message |
# Send a transactional SMS curl -X POST https://api.unecast.com/v2/send \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "channel": "sms", "from": "YOURBRAND", "to": "94771234567", "message": "Your OTP is 482913", "priority": 3 }'
AI agent API
Every agent, team or workflow you build in AI Studio has its own run endpoint.
- Run an agent with POST /agents/{agent-id}/runs on aistudio.unecast.com.
- Authenticate with a tenant-scoped key as a Bearer token. The secret is shown once.
- Lock it down with an expiry and allowed IP addresses or CIDR ranges.
- Shape the response with response filters, validators and session state.
# Run an AI agent you built in AI Studio curl -X POST https://aistudio.unecast.com/agents/YOUR_AGENT_ID/runs \ -H "Authorization: Bearer YOUR_TENANT_KEY" \ -H "Content-Type: application/json" \ -d '{ "message": "Do you deliver to Kandy?" }'
Integrations: connect the tools you already use.
WooCommerce, Shopify, WordPress, Microsoft Power Platform, webhooks, MCP servers and WHMCS.
Online stores
WooCommerce and Shopify for order and delivery updates.
Websites
WordPress and the Unecast website chat widget.
Automation
Microsoft Power Platform, webhooks and MCP servers.
Billing and hosting
WHMCS for invoices and service notifications.
Need help scoping an integration?
Our engineers will review your systems and suggest the simplest way to connect. Call +94 77 600 3273 or write to sales@unecast.com.