Developer Documentation

Send Your First SMS with Alert21

Generate a production or test key from the appropriate customer account. Never place a secret API key in browser JavaScript, a public mobile application, source-control repository or public screenshot.

BASH
Authorization: Bearer al21_live_xxxxxxxxx
Content-Type: application/json

Step 1 - Create a Server-Side API Key

Recommended header:

BASH
Authorization: Bearer al21_live_xxxxxxxxx
Content-Type: application/json

Step 2 - Use an Approved Template

Select the DLT template already mapped to the customer account. Keep the variable count and order consistent with the approved content.

Step 3 - Send the Request

BASH
curl --request POST \
  --url https://api.alert21.in/v1/sms/send \
  --header 'Authorization: Bearer al21_live_xxxxx' \
  --header 'Content-Type: application/json' \
  --header 'X-Idempotency-Key: txn_123456' \
  --data '{
    "to":"919876543210",
    "template_id":"1107161234567890123",
    "variables":["Amit","2500","TXN88991"]
  }'

Step 4 - Store the Alert21 Message ID

The response returns an Alert21-generated message identifier. Store it against your internal event or transaction reference.

Step 5 - Receive Delivery Webhooks

Register a secure HTTPS endpoint and verify the webhook signature before processing delivery events.

Production Checklist

  • API key stored in a secrets manager/environment variable.
  • IP restrictions configured where appropriate.
  • Approved DLT entity/header/template mapping complete for India traffic.
  • Idempotency implemented.
  • HTTP timeouts configured.
  • Webhook signature verified.
  • Duplicate webhook handling implemented.
  • Monitoring and alerting enabled.
EVERY ALERT. ONE API.

Turn your next business event into a traceable alert.

Start with DLT-ready SMS today on Alert21’s developer-first communication platform.