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.
Direct Answers

Frequently Asked Questions

Quick answers to common questions about Alert21 SMS API, telecom compliance, and developer integration.

What do I need before sending my first SMS with Alert21?

You need an active Alert21 account, a server-side API key and, for applicable India traffic, an approved DLT entity, sender header and content template mapped to the account. Your backend sends the recipient, template ID and ordered template variables to the SMS API.

Can I call the Alert21 SMS API from browser JavaScript?

Do not expose a secret SMS API key in browser code or a public mobile application. Send the request from your backend, serverless function or another trusted server environment, and store the key in a secrets manager or protected environment variable.

How should my application retry an SMS request?

Use a unique idempotency key for each business event, apply bounded retries for temporary failures and store the returned Alert21 message ID. Treat API acceptance as different from final delivery, which should be reconciled through signed webhooks or the status API.

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.