Contents

Simple SMS (v2)5 endpoints

Send with number, message, sender and DLT template ID — JSON or a form post, key in the header or body. Paths start at /v2.

Base URLhttps://sms21.in

Send SMS (simple)

post/v2/sms/send

Scopesms:send

The simplest way to send: number, message and sender. JSON or an HTML form post; the key in X-API-Key, Authorization: Bearer or an apikey field.

  • Send the final text. SMS21 finds the approved DLT template it matches (or checks it against the one named by templateid) and recovers the variable values, so you never handle {#var#} or template IDs of ours.
  • Up to 100 numbers per request, all-or-nothing: every number is validated and every message funded in one step, or nothing is sent.
  • Same routing, DLT enforcement, billing, delivery reports and webhooks as /v1/sms/send.
  • Test keys may send text that fits no template; messages go to the sandbox and are never charged.

Parameters1

  • Idempotency-Keyheaderstring

    Makes the request safe to retry: repeating it with the same key and body returns the original result (with Idempotent-Replayed: true) instead of sending again. Use one key per logical message, e.g. derived from your order or login-attempt ID. Reusing a key with a different body is 409 IDEMPOTENCY_KEY_REUSED.

Body · JSON or form6

  • apikeystring

    Your API key, for tools that cannot set the X-API-Key or Authorization header. Never put it in the URL.

  • numberstring | string[]required

    One mobile number, several separated by commas (at most 100), or an array. 10-digit Indian numbers may omit 91; spaces, dashes and + are ignored.

  • messagestringrequired

    The final text, exactly as it should arrive. For live SMS to India it must match one of your approved DLT templates (the one named by templateid, if sent), each {#var#} filled in.

  • senderstring

    DLT header (sender ID), e.g. ACMEIN. It must be the matched template’s header; optional when the text fits templates of one header only.

  • headerstring

    Alias of sender.

  • templateidstring

    The DLT template ID from the operator DLT portal. Optional: when left out, SMS21 finds the approved template your text matches (the most specific one) and returns its ID in the response.

Responses

  • 200

    Accepted and queued.

  • 400

    Invalid numbers, or the text does not fit the DLT template.

    Example
    Response 400
    {
      "success": false,
      "error": {
        "code": "TEMPLATE_TEXT_MISMATCH",
        "message": "The message does not match the DLT template",
        "details": [
          {
            "field": "message",
            "message": "must match the registered text exactly, with each {#var#} replaced by a value of at most 30 characters: Dear {#var#}, your OTP for {#var#} is {#var#}. Valid for 10 minutes."
          }
        ]
      },
      "requestId": "0199491c-8f3a-7c2e-9b1d-5e7f3a2c4b6d"
    }
  • 401

    The API key is missing, malformed, unknown, revoked or expired.

    Example
    Response 401
    {
      "success": false,
      "error": {
        "code": "AUTHENTICATION_REQUIRED",
        "message": "An API key is required; send it in the X-API-Key header or as \"Authorization: Bearer <key>\""
      },
      "requestId": "0199491c-8f3a-7c2e-9b1d-5e7f3a2c4b6d"
    }
  • 402

    Live keys only: the wallet cannot cover the message. Add funds; retrying will not help.

    Example
    Response 402
    {
      "success": false,
      "error": {
        "code": "INSUFFICIENT_BALANCE",
        "message": "Insufficient wallet balance"
      },
      "requestId": "0199491c-8f3a-7c2e-9b1d-5e7f3a2c4b6d"
    }
  • 403

    The key may not do this: missing scope, IP not on the allow-list, company, project or key suspended by SMS21, project archived, wallet suspended or destination blocked.

    Example
    Response 403
    {
      "success": false,
      "error": {
        "code": "INSUFFICIENT_SCOPE",
        "message": "This API key does not have the required scope",
        "details": [
          {
            "message": "requires scope sms:send"
          }
        ]
      },
      "requestId": "0199491c-8f3a-7c2e-9b1d-5e7f3a2c4b6d"
    }
  • 404

    No template with this DLT template ID is registered.

    Example
    Response 404
    {
      "success": false,
      "error": {
        "code": "NOT_FOUND",
        "message": "DLT template not found"
      },
      "requestId": "0199491c-8f3a-7c2e-9b1d-5e7f3a2c4b6d"
    }
  • 409

    The Idempotency-Key was used for a different request.

    Example
    Response 409
    {
      "success": false,
      "error": {
        "code": "IDEMPOTENCY_KEY_REUSED",
        "message": "This Idempotency-Key was already used with a different request"
      },
      "requestId": "0199491c-8f3a-7c2e-9b1d-5e7f3a2c4b6d"
    }
  • 429

    Rate limited. Wait Retry-After seconds, then retry with the same Idempotency-Key.

    Example
    Response 429
    {
      "success": false,
      "error": {
        "code": "RATE_LIMITED",
        "message": "Rate limit exceeded for this API key"
      },
      "requestId": "0199491c-8f3a-7c2e-9b1d-5e7f3a2c4b6d"
    }
  • 503

    Temporarily unavailable, or live sending paused by SMS21. Retry later with the same Idempotency-Key.

    Example
    Response 503
    {
      "success": false,
      "error": {
        "code": "SERVICE_UNAVAILABLE",
        "message": "Service temporarily unavailable"
      },
      "requestId": "0199491c-8f3a-7c2e-9b1d-5e7f3a2c4b6d"
    }
curl -X POST "https://sms21.in/v2/sms/send" \
  -H "X-API-Key: $SMS21_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"number":"9876543210","message":"Dear Asha, your OTP for Acme is 482913. Valid for 10 minutes.","sender":"ACMEIN"}'
Response 200
{
  "success": true,
  "status": "queued",
  "environment": "live",
  "count": 1,
  "parts": 1,
  "encoding": "gsm7",
  "sender": "ACMEIN",
  "templateid": "1107169876543210123",
  "cost": "0.1500",
  "currency": "INR",
  "balance": "1249.8500",
  "messages": [
    {
      "id": "msg_01k55q8y4m3d9v7x2c6b0n1r8t",
      "number": "919876543210",
      "status": "queued"
    }
  ]
}

Message status (simple)

get/v2/sms/status

Scopesms:send

Status of up to 100 messages sent by this key’s project. IDs of other projects report not_found.

Parameters1

  • idquerystringrequired

    msg_… IDs, comma-separated.

Responses

  • 200

    Statuses, in request order.

  • 401

    The API key is missing, malformed, unknown, revoked or expired.

    Example
    Response 401
    {
      "success": false,
      "error": {
        "code": "AUTHENTICATION_REQUIRED",
        "message": "An API key is required; send it in the X-API-Key header or as \"Authorization: Bearer <key>\""
      },
      "requestId": "0199491c-8f3a-7c2e-9b1d-5e7f3a2c4b6d"
    }
  • 403

    The key may not do this: missing scope, IP not on the allow-list, company, project or key suspended by SMS21, project archived, wallet suspended or destination blocked.

    Example
    Response 403
    {
      "success": false,
      "error": {
        "code": "INSUFFICIENT_SCOPE",
        "message": "This API key does not have the required scope",
        "details": [
          {
            "message": "requires scope sms:send"
          }
        ]
      },
      "requestId": "0199491c-8f3a-7c2e-9b1d-5e7f3a2c4b6d"
    }
  • 429

    Rate limited. Wait Retry-After seconds, then retry with the same Idempotency-Key.

    Example
    Response 429
    {
      "success": false,
      "error": {
        "code": "RATE_LIMITED",
        "message": "Rate limit exceeded for this API key"
      },
      "requestId": "0199491c-8f3a-7c2e-9b1d-5e7f3a2c4b6d"
    }
  • 503

    Temporarily unavailable, or live sending paused by SMS21. Retry later with the same Idempotency-Key.

    Example
    Response 503
    {
      "success": false,
      "error": {
        "code": "SERVICE_UNAVAILABLE",
        "message": "Service temporarily unavailable"
      },
      "requestId": "0199491c-8f3a-7c2e-9b1d-5e7f3a2c4b6d"
    }
curl -X GET "https://sms21.in/v2/sms/status" \
  -H "X-API-Key: $SMS21_API_KEY"
Response 200
{
  "success": true,
  "data": [
    {
      "id": "msg_01k55q8y4m3d9v7x2c6b0n1r8t",
      "number": "919876543210",
      "status": "delivered",
      "parts": 1,
      "failure": null,
      "sentAt": "2026-09-26T10:15:02.000Z",
      "deliveredAt": "2026-09-26T10:15:05.000Z"
    }
  ]
}

Message status (simple, POST)

post/v2/sms/status

Scopesms:send

The same as GET, with id (and optionally apikey) in the body.

Body · JSON or form2

  • apikeystring

    Your API key, for tools that cannot set the X-API-Key or Authorization header. Never put it in the URL.

  • idstring | string[]required

    msg_… IDs: one, comma-separated, or an array (at most 100).

Responses

  • 200

    Statuses, in request order.

  • 401

    The API key is missing, malformed, unknown, revoked or expired.

    Example
    Response 401
    {
      "success": false,
      "error": {
        "code": "AUTHENTICATION_REQUIRED",
        "message": "An API key is required; send it in the X-API-Key header or as \"Authorization: Bearer <key>\""
      },
      "requestId": "0199491c-8f3a-7c2e-9b1d-5e7f3a2c4b6d"
    }
  • 403

    The key may not do this: missing scope, IP not on the allow-list, company, project or key suspended by SMS21, project archived, wallet suspended or destination blocked.

    Example
    Response 403
    {
      "success": false,
      "error": {
        "code": "INSUFFICIENT_SCOPE",
        "message": "This API key does not have the required scope",
        "details": [
          {
            "message": "requires scope sms:send"
          }
        ]
      },
      "requestId": "0199491c-8f3a-7c2e-9b1d-5e7f3a2c4b6d"
    }
  • 429

    Rate limited. Wait Retry-After seconds, then retry with the same Idempotency-Key.

    Example
    Response 429
    {
      "success": false,
      "error": {
        "code": "RATE_LIMITED",
        "message": "Rate limit exceeded for this API key"
      },
      "requestId": "0199491c-8f3a-7c2e-9b1d-5e7f3a2c4b6d"
    }
  • 503

    Temporarily unavailable, or live sending paused by SMS21. Retry later with the same Idempotency-Key.

    Example
    Response 503
    {
      "success": false,
      "error": {
        "code": "SERVICE_UNAVAILABLE",
        "message": "Service temporarily unavailable"
      },
      "requestId": "0199491c-8f3a-7c2e-9b1d-5e7f3a2c4b6d"
    }
curl -X POST "https://sms21.in/v2/sms/status" \
  -H "X-API-Key: $SMS21_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"id":"msg_01k55q8y4m3d9v7x2c6b0n1r8t"}'
Response 200
{
  "success": true,
  "data": [
    {
      "id": "msg_01k55q8y4m3d9v7x2c6b0n1r8t",
      "number": "919876543210",
      "status": "delivered",
      "parts": 1,
      "failure": null,
      "sentAt": "2026-09-26T10:15:02.000Z",
      "deliveredAt": "2026-09-26T10:15:05.000Z"
    }
  ]
}

Wallet balance (simple)

get/v2/balance

Available balance of the company wallet. Any API key may call it.

Responses

  • 200

    The balance.

  • 401

    The API key is missing, malformed, unknown, revoked or expired.

    Example
    Response 401
    {
      "success": false,
      "error": {
        "code": "AUTHENTICATION_REQUIRED",
        "message": "An API key is required; send it in the X-API-Key header or as \"Authorization: Bearer <key>\""
      },
      "requestId": "0199491c-8f3a-7c2e-9b1d-5e7f3a2c4b6d"
    }
  • 403

    The key may not do this: missing scope, IP not on the allow-list, company, project or key suspended by SMS21, project archived, wallet suspended or destination blocked.

    Example
    Response 403
    {
      "success": false,
      "error": {
        "code": "INSUFFICIENT_SCOPE",
        "message": "This API key does not have the required scope",
        "details": [
          {
            "message": "requires scope sms:send"
          }
        ]
      },
      "requestId": "0199491c-8f3a-7c2e-9b1d-5e7f3a2c4b6d"
    }
  • 429

    Rate limited. Wait Retry-After seconds, then retry with the same Idempotency-Key.

    Example
    Response 429
    {
      "success": false,
      "error": {
        "code": "RATE_LIMITED",
        "message": "Rate limit exceeded for this API key"
      },
      "requestId": "0199491c-8f3a-7c2e-9b1d-5e7f3a2c4b6d"
    }
  • 503

    Temporarily unavailable, or live sending paused by SMS21. Retry later with the same Idempotency-Key.

    Example
    Response 503
    {
      "success": false,
      "error": {
        "code": "SERVICE_UNAVAILABLE",
        "message": "Service temporarily unavailable"
      },
      "requestId": "0199491c-8f3a-7c2e-9b1d-5e7f3a2c4b6d"
    }
curl -X GET "https://sms21.in/v2/balance" \
  -H "X-API-Key: $SMS21_API_KEY"
Response 200
{
  "success": true,
  "balance": "1249.8500",
  "currency": "INR",
  "reserved": "0.1500",
  "status": "active"
}

Wallet balance (simple, POST)

post/v2/balance

The same as GET, for tools that send the key as apikey in the body.

Body · JSON or form1

  • apikeystring

    Your API key, for tools that cannot set the X-API-Key or Authorization header. Never put it in the URL.

Responses

  • 200

    The balance.

  • 401

    The API key is missing, malformed, unknown, revoked or expired.

    Example
    Response 401
    {
      "success": false,
      "error": {
        "code": "AUTHENTICATION_REQUIRED",
        "message": "An API key is required; send it in the X-API-Key header or as \"Authorization: Bearer <key>\""
      },
      "requestId": "0199491c-8f3a-7c2e-9b1d-5e7f3a2c4b6d"
    }
  • 403

    The key may not do this: missing scope, IP not on the allow-list, company, project or key suspended by SMS21, project archived, wallet suspended or destination blocked.

    Example
    Response 403
    {
      "success": false,
      "error": {
        "code": "INSUFFICIENT_SCOPE",
        "message": "This API key does not have the required scope",
        "details": [
          {
            "message": "requires scope sms:send"
          }
        ]
      },
      "requestId": "0199491c-8f3a-7c2e-9b1d-5e7f3a2c4b6d"
    }
  • 429

    Rate limited. Wait Retry-After seconds, then retry with the same Idempotency-Key.

    Example
    Response 429
    {
      "success": false,
      "error": {
        "code": "RATE_LIMITED",
        "message": "Rate limit exceeded for this API key"
      },
      "requestId": "0199491c-8f3a-7c2e-9b1d-5e7f3a2c4b6d"
    }
  • 503

    Temporarily unavailable, or live sending paused by SMS21. Retry later with the same Idempotency-Key.

    Example
    Response 503
    {
      "success": false,
      "error": {
        "code": "SERVICE_UNAVAILABLE",
        "message": "Service temporarily unavailable"
      },
      "requestId": "0199491c-8f3a-7c2e-9b1d-5e7f3a2c4b6d"
    }
curl -X POST "https://sms21.in/v2/balance" \
  -H "X-API-Key: $SMS21_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"apikey":"sms21_live_…"}'
Response 200
{
  "success": true,
  "balance": "1249.8500",
  "currency": "INR",
  "reserved": "0.1500",
  "status": "active"
}