Skip to Content

Developers

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" }] }]
  }'

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 toUseAuthenticationHow to get credentials
Send WhatsApp templates and replies, manage contacts, receive webhooksWhatsApp API, platform.unecast.com/api/v1X-API-Key and X-API-Secret headersCreate an account, then Settings, API keys
Send SMS, read balance and delivery statusSMS API, api.unecast.com/v2Bearer tokenOpen an SMS portal account, then Developer, Create app, HTTP (REST API)
Send high volumes of SMS from your own platformSMPP, smsc.unecast.com:2775Per-app system ID and passwordCreate an SMPP app in the SMS portal, then bind over standard SMPP 3.4
Run an AI agent from your own systemAI agent API, aistudio.unecast.comBearer tenant keyAsk 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.

MethodPathWhat it does
POST/api/v1/messages/templateSend an approved template message to a contact
POST/api/v1/messages/replySend a free-text reply inside the 24-hour service window
GET/api/v1/messages/:contactPhoneGet the message history for a contact
GET/api/v1/messages/status/:messageIdGet the delivery status of a message
GET/api/v1/contactsList contacts
POST/api/v1/contactsCreate a contact
PUT/api/v1/contacts/:idUpdate a contact
DELETE/api/v1/contacts/:idDelete a contact
GET/api/v1/contacts/groupsList contact groups
POST/api/v1/contacts/groups/:groupId/addAdd contacts to a group
POST/api/v1/contacts/groups/:groupId/removeRemove contacts from a group
GET/api/v1/templatesList message templates
GET/api/v1/campaignsList campaigns
GET/api/v1/accountGet account details
GET/api/v1/account/usageGet account usage
GET/api/v1/webhooksList webhooks
POST/api/v1/webhooksCreate a webhook
PUT/api/v1/webhooks/:idUpdate a webhook
DELETE/api/v1/webhooks/:idDelete 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.

MethodPathWhat it does
POSThttps://api.unecast.com/v2/sendSend a message with channel, from, to, message and priority (0 lowest to 3 highest)
GEThttps://api.unecast.com/v2/account/balanceRead your account balance
GEThttps://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.

Talk to us now+94 77 600 3273sales@unecast.comMonday to Friday, 9 AM to 6 PM