Skip to main content
Esc
Browse docs

Send messages

Send messages with the Slovio API: POST /comms/messages sends a WhatsApp or RCS template or a DLT SMS from one endpoint, with idempotency and delivery status.

2 min readUpdated

One endpoint sends on WhatsApp, RCS or SMS.

Send

http
POST /v1/comms/messages
Field Type Notes
channel string, required whatsapp, rcs or sms
to string, required The recipient's number with country code, for example +919876543210
from string A channel ID. Defaults to your default channel for that type.
template object WhatsApp: name and language (plus parameters). RCS: id (plus parameters).
text string Required for SMS (1 to 4000 characters), exactly as registered on DLT.
sms object For SMS: category (otp, transactional or promotional, required), dltTemplateId, senderId
metadata object Your own data, returned with the message.

WhatsApp template

bash
curl -X POST https://api.slovio.ai/v1/comms/messages \
  -H "x-access-key: $SLOVIO_ACCESS_KEY" \
  -H "Authorization: Bearer $SLOVIO_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-4471-shipped" \
  -d '{
    "channel": "whatsapp",
    "to": "+919876543210",
    "template": {
      "name": "order_shipped",
      "language": "en",
      "parameters": ["Asha", "4471"]
    },
    "metadata": { "orderId": "4471" }
  }'

SMS

json
{
  "channel": "sms",
  "to": "+919876543210",
  "text": "Dear Asha, your order 4471 has shipped.",
  "sms": { "category": "transactional", "dltTemplateId": "1107160000000000000", "senderId": "SLOVIO" }
}

Response

json
{
  "statusCode": "10000",
  "status": 200,
  "message": "success",
  "data": {
    "id": "msg_wa_d2FtaWQuSEJnTE…",
    "channel": "whatsapp",
    "status": "queued",
    "to": "+919876543210",
    "metadata": { "orderId": "4471" }
  }
}

Idempotency

Send an Idempotency-Key header (8 to 128 characters: letters, digits, ., _, -) that is unique per message, such as your order ID plus event. If you retry with the same key, Slovio won't send twice.

Check status

http
GET /v1/comms/messages/{id}

Returns status with sentAt, deliveredAt, readAt, failedAt and error. For real-time updates, use webhooks instead of polling.

Notes

  • WhatsApp needs an approved template to start a conversation.
  • SMS needs an approved sender ID and DLT template. See SMS sender IDs and templates.
  • Fallback between channels is not available on this endpoint yet.
  • Every send is charged from your wallet; with a zero balance the send fails.

Common questions

How many messages can I send per minute?

600 per minute per API key by default, shared with the template send endpoints. It can be raised for your key. See Errors and rate limits.

What happens if I retry with the same Idempotency-Key?

Slovio does not send the message again. Use a new key only for a new message.

Can I send free text on WhatsApp through this endpoint?

This endpoint sends WhatsApp and RCS templates. WhatsApp needs an approved template to start a conversation.

How do I know if an SMS was delivered?

Read GET /v1/comms/messages/{id}, or subscribe to webhooks for delivery events.

Stuck, or is something here out of date? Tell the team — we reply within a working day.