Contents

WhatsApp Connect8 endpoints

Messages and campaigns sent from your own WhatsApp numbers, linked by QR code in the dashboard (plugin). Uses the WhatsApp Web protocol, not the official Business API.

Base URLhttps://sms21.in

Send from a linked WhatsApp number

post/v1/whatsapp-connect/send

Scopewhatsapp_connect:send

Queues a message sent from one of your own WhatsApp numbers, linked by QR code under Dashboard → Plugins → WhatsApp Connect. Requires the plugin to be active.

  • Omit deviceId to let any connected device send it (messages rotate across devices); pass one to pin it.
  • Devices pace themselves (sendIntervalSeconds plus jitter) and stop at their daily limit, so a message may wait in queued. Messages no device sends within 24 hours expire and are not charged.
  • Numbers that are not on WhatsApp end as rejected (not charged).
  • Attach media to send an image, video or document with text as its caption.
  • Groups: pass groupId instead of to (from GET /whatsapp-connect/groups). The message goes out from a linked number that is in the group (the one you pin with deviceId, if any); groups where only admins may post need that number to be an admin.
  • Test keys: no device is used; messages are reported delivered after a moment. Numbers ending in 0000 are reported as not on WhatsApp.

WhatsApp Connect uses the WhatsApp Web protocol, not the official WhatsApp Business API: numbers that send unsolicited messages can be banned by WhatsApp.

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.

Body7

  • tostring

    Recipient in international format.

  • groupIdstring

    A WhatsApp group one of your linked numbers is in, from GET /whatsapp-connect/groups. The message is sent from a device that is a member.

  • textstringrequired

    The message (or caption). Personalise with {{name}} placeholders, or {{name|fallback}} to use a fallback when the value is missing.

  • variablesobject

    Values for the placeholders, by name. Extra values are ignored.

  • mediaWaMedia

    A file sent with the message; text becomes its caption (max 1024 characters). SMS21 downloads it from a public https URL when the message is sent (no redirects).

    3 nested fields
    • typestringrequired

      image: JPEG, PNG or WebP · video: MP4 or 3GPP · document: any file but HTML.

      imagevideodocument

    • urlstring (uri)required
    • filenamestring

      Documents: the name the recipient sees.

  • deviceIdstring

    Send from this linked device. Omit to use any connected device (rotation).

  • typestring

    Pricing category.

    transactionalpromotional

Responses

  • 202

    Accepted and queued for a device.

  • 400

    Invalid request, recipient, placeholder values or media URL.

    Example
    Response 400
    {
      "success": false,
      "error": {
        "code": "INVALID_RECIPIENT",
        "message": "The recipient is not a valid mobile number",
        "details": [
          {
            "field": "to",
            "message": "to must be a mobile number in international format, e.g. 919876543210"
          }
        ]
      },
      "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 plugin is not active, or the key lacks the scope.

    Example
    Response 403
    {
      "success": false,
      "error": {
        "code": "PLUGIN_NOT_ACTIVE",
        "message": "WhatsApp Connect is not activated for this company; activate it under Plugins"
      },
      "requestId": "0199491c-8f3a-7c2e-9b1d-5e7f3a2c4b6d"
    }
  • 404

    The device does not exist in this company.

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

    Conflicting state.

    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/v1/whatsapp-connect/send" \
  -H "X-API-Key: $SMS21_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to":"919876543210","text":"Hi {{name|there}}, your order {{order}} has shipped.","variables":{"name":"Asha","order":"A-1042"}}'
Response 202
{
  "success": true,
  "messageId": "msg_01k55q8y4m3d9v7x2c6b0n1r8t",
  "status": "queued",
  "channel": "whatsapp_connect",
  "type": "transactional",
  "environment": "live",
  "to": "919876543210",
  "templateId": null,
  "whatsappTemplateId": null,
  "segments": 1,
  "encoding": "gsm7",
  "failure": null,
  "queuedAt": "2026-09-15T10:30:00.000Z",
  "submittedAt": null,
  "sentAt": null,
  "deliveredAt": null,
  "failedAt": null
}

List WhatsApp campaigns

get/v1/whatsapp-connect/bulk

Scopewhatsapp_connect:send

WhatsApp Connect campaigns of the key’s project, newest first.

Parameters4

  • statusquerystring

    Only campaigns in this state.

  • limitqueryinteger
  • cursorquerystring

    pagination.nextCursor of the previous page.

  • pagequeryinteger

    Page number (1-based) for numbered pagination with pagination.total. Ignored with cursor; to read everything, follow cursor instead (faster on large lists).

Responses

  • 200

    A page of campaigns.

  • 400

    Invalid filter or cursor.

    Example
    Response 400
    {
      "success": false,
      "error": {
        "code": "VALIDATION_FAILED",
        "message": "Invalid cursor",
        "details": [
          {
            "field": "cursor",
            "message": "cursor is invalid or expired"
          }
        ]
      },
      "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"
    }
  • 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/v1/whatsapp-connect/bulk" \
  -H "X-API-Key: $SMS21_API_KEY"
Response 200
{
  "success": true,
  "data": [
    {
      "batchId": "bat_01k55q8y4m3d9v7x2c6b0n1r8t",
      "name": "Festive offer",
      "status": "queued",
      "environment": "live",
      "channel": "whatsapp_connect",
      "type": "promotional",
      "deviceId": null,
      "templateId": null,
      "senderId": null,
      "scheduledAt": null,
      "counts": {
        "recipients": 800,
        "expanded": 0,
        "skipped": 3,
        "pending": 797
      },
      "failure": null,
      "createdAt": "2026-09-15T10:30:00.000Z",
      "startedAt": null,
      "completedAt": null,
      "cancelledAt": null
    }
  ],
  "pagination": {
    "limit": 20,
    "hasMore": false,
    "nextCursor": null
  }
}

Create a WhatsApp campaign

post/v1/whatsapp-connect/bulk

Scopewhatsapp_connect:send

Queues a campaign sent from your linked WhatsApp numbers (202 Accepted). Every recipient’s text is personalised and checked now; the messages are created in the background and the devices send them at their own pace.

  • listId sends to a saved contact list: its columns fill the {{placeholders}}.
  • Numbers on the suppression list or blocked for your account are reported as skipped.
  • Money is held per message as the campaign is expanded; if the wallet runs out the campaign stops with INSUFFICIENT_BALANCE.

Follow progress with GET /whatsapp-connect/bulk/{batchId} and each message with webhooks.

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.

Body8

  • namestring

    Label shown in reports.

  • textstringrequired

    The message (or caption). Personalise with {{name}} placeholders, or {{name|fallback}} to use a fallback when the value is missing.

  • mediaWaMedia

    A file sent with the message; text becomes its caption (max 1024 characters). SMS21 downloads it from a public https URL when the message is sent (no redirects).

    3 nested fields
    • typestringrequired

      image: JPEG, PNG or WebP · video: MP4 or 3GPP · document: any file but HTML.

      imagevideodocument

    • urlstring (uri)required
    • filenamestring

      Documents: the name the recipient sees.

  • deviceIdstring

    Pin the campaign to one device. Omit to spread it over every connected device.

  • typestring

    Pricing category.

    transactionalpromotional

  • scheduledAtstring (date-time)

    Send time. Omit to start immediately.

  • listIdstring

    lst_… — send to a saved contact list; its columns fill the placeholders.

  • recipientsobject[]

    Recipients; duplicates are collapsed. The maximum per campaign is set by SMS21 (5 000 by default).

    2 nested fields
    • tostringrequired
    • variablesobject

      Values for this recipient’s placeholders.

Responses

  • 202

    Campaign accepted.

  • 400

    Invalid request, recipients, placeholder values or media URL.

    Example
    Response 400
    {
      "success": false,
      "error": {
        "code": "VALIDATION_FAILED",
        "message": "The message could not be personalised for every recipient",
        "details": [
          {
            "field": "recipients[4].variables.order",
            "message": "order has no value and the placeholder has no fallback (recipient 919812345678)"
          }
        ]
      },
      "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 plugin is not active, or the key lacks the scope.

    Example
    Response 403
    {
      "success": false,
      "error": {
        "code": "PLUGIN_NOT_ACTIVE",
        "message": "WhatsApp Connect is not activated for this company; activate it under Plugins"
      },
      "requestId": "0199491c-8f3a-7c2e-9b1d-5e7f3a2c4b6d"
    }
  • 404

    The device or contact list does not exist in this company.

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

    Conflicting state.

    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/v1/whatsapp-connect/bulk" \
  -H "X-API-Key: $SMS21_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Festive offer","text":"Hi {{name|there}}, enjoy 20% off this week at Acme.","recipients":[{"to":"919876543210","variables":{"name":"Asha"}},{"to":"919812345678"}]}'
Response 202
{
  "success": true,
  "batchId": "bat_01k55q8y4m3d9v7x2c6b0n1r8t",
  "name": "Festive offer",
  "status": "queued",
  "environment": "live",
  "channel": "whatsapp_connect",
  "type": "promotional",
  "deviceId": null,
  "templateId": null,
  "senderId": null,
  "scheduledAt": null,
  "counts": {
    "recipients": 800,
    "expanded": 0,
    "skipped": 3,
    "pending": 797
  },
  "failure": null,
  "createdAt": "2026-09-15T10:30:00.000Z",
  "startedAt": null,
  "completedAt": null,
  "cancelledAt": null
}

WhatsApp campaign progress

get/v1/whatsapp-connect/bulk/{batchId}

Scopewhatsapp_connect:send

Counts move from pending to expanded while the campaign is created; each message then follows its own status.

Parameters1

  • batchIdpathstringrequired

    Campaign ID (bat_…).

Responses

  • 200

    The campaign.

  • 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"
    }
  • 404

    Not found, or not visible to the API key project.

    Example
    Response 404
    {
      "success": false,
      "error": {
        "code": "NOT_FOUND",
        "message": "Message not found"
      },
      "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/v1/whatsapp-connect/bulk/{batchId}" \
  -H "X-API-Key: $SMS21_API_KEY"
Response 200
{
  "success": true,
  "batchId": "bat_01k55q8y4m3d9v7x2c6b0n1r8t",
  "name": "Festive offer",
  "status": "queued",
  "environment": "live",
  "channel": "whatsapp_connect",
  "type": "promotional",
  "deviceId": null,
  "templateId": null,
  "senderId": null,
  "scheduledAt": null,
  "counts": {
    "recipients": 800,
    "expanded": 0,
    "skipped": 3,
    "pending": 797
  },
  "failure": null,
  "createdAt": "2026-09-15T10:30:00.000Z",
  "startedAt": null,
  "completedAt": null,
  "cancelledAt": null
}

WhatsApp campaign recipients

get/v1/whatsapp-connect/bulk/{batchId}/recipients

Scopewhatsapp_connect:send

The message created for each recipient, or why the number was skipped.

Parameters5

  • batchIdpathstringrequired

    Campaign ID (bat_…).

  • statusquerystring

    Only recipients in this state.

  • limitqueryinteger
  • cursorquerystring

    pagination.nextCursor of the previous page.

  • pagequeryinteger

    Page number (1-based) for numbered pagination with pagination.total. Ignored with cursor; to read everything, follow cursor instead (faster on large lists).

Responses

  • 200

    A page of recipients.

  • 400

    Invalid filter or cursor.

    Example
    Response 400
    {
      "success": false,
      "error": {
        "code": "VALIDATION_FAILED",
        "message": "Invalid cursor",
        "details": [
          {
            "field": "cursor",
            "message": "cursor is invalid or expired"
          }
        ]
      },
      "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"
    }
  • 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

    Not found, or not visible to the API key project.

    Example
    Response 404
    {
      "success": false,
      "error": {
        "code": "NOT_FOUND",
        "message": "Message not found"
      },
      "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/v1/whatsapp-connect/bulk/{batchId}/recipients" \
  -H "X-API-Key: $SMS21_API_KEY"
Response 200
{
  "success": true,
  "data": [
    {
      "to": "919876543210",
      "status": "expanded",
      "messageId": "msg_01k55q8y4m3d9v7x2c6b0n1r8t",
      "reason": null
    }
  ],
  "pagination": {
    "limit": 20,
    "hasMore": false,
    "nextCursor": null
  }
}

Cancel a WhatsApp campaign

post/v1/whatsapp-connect/bulk/{batchId}/cancel

Scopewhatsapp_connect:send

Cancels recipients that have not been expanded yet. Messages already created are still sent by the devices.

Parameters1

  • batchIdpathstringrequired

    Campaign ID (bat_…).

Responses

  • 200

    The cancelled campaign.

  • 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"
    }
  • 404

    Not found, or not visible to the API key project.

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

    The campaign has already finished.

    Example
    Response 409
    {
      "success": false,
      "error": {
        "code": "BATCH_NOT_CANCELLABLE",
        "message": "This campaign is already completed"
      },
      "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/v1/whatsapp-connect/bulk/{batchId}/cancel" \
  -H "X-API-Key: $SMS21_API_KEY"
Response 200
{
  "success": true,
  "batchId": "bat_01k55q8y4m3d9v7x2c6b0n1r8t",
  "name": "Festive offer",
  "status": "cancelled",
  "environment": "live",
  "channel": "whatsapp_connect",
  "type": "promotional",
  "deviceId": null,
  "templateId": null,
  "senderId": null,
  "scheduledAt": null,
  "counts": {
    "recipients": 800,
    "expanded": 0,
    "skipped": 3,
    "pending": 797
  },
  "failure": null,
  "createdAt": "2026-09-15T10:30:00.000Z",
  "startedAt": null,
  "completedAt": null,
  "cancelledAt": "2026-09-15T10:30:00.000Z"
}

List linked devices

get/v1/whatsapp-connect/devices

Scopewhatsapp_connect:send

The company’s linked WhatsApp numbers and whether they are online. Devices are linked, paused and removed in the dashboard (linking needs a phone to scan a QR code).

Responses

  • 200

    The devices.

  • 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/v1/whatsapp-connect/devices" \
  -H "X-API-Key: $SMS21_API_KEY"
Response 200
{
  "success": true,
  "data": [
    {
      "deviceId": "wad_01k55q8y4m3d9v7x2c6b0n1r8t",
      "name": "Sales line",
      "status": "connected",
      "active": true,
      "phoneNumber": "919812345678",
      "displayName": "Acme Store",
      "sendIntervalSeconds": 6,
      "dailyLimit": 1000,
      "sentToday": 140,
      "receiveInbound": true,
      "inboundProjectId": null,
      "lastConnectedAt": "2026-09-15T10:30:00.000Z",
      "lastDisconnectedAt": null,
      "lastError": null,
      "createdAt": "2026-09-15T10:30:00.000Z"
    }
  ]
}

List WhatsApp groups

get/v1/whatsapp-connect/groups

Scopewhatsapp_connect:send

The WhatsApp groups your linked numbers are in, refreshed whenever a device connects and when groups change. Use groupId with POST /whatsapp-connect/send. A group shared by two of your numbers appears once per device.

Parameters2

  • deviceIdquerystring

    Only the groups of this linked device.

  • searchquerystring

    Part of the group name.

Responses

  • 200

    The groups.

  • 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"
    }
  • 404

    Not found, or not visible to the API key project.

    Example
    Response 404
    {
      "success": false,
      "error": {
        "code": "NOT_FOUND",
        "message": "Message not found"
      },
      "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/v1/whatsapp-connect/groups" \
  -H "X-API-Key: $SMS21_API_KEY"
Response 200
{
  "success": true,
  "data": [
    {
      "groupId": "120363025246125486@g.us",
      "name": "Sales team",
      "deviceId": "wad_01k55q8y4m3d9v7x2c6b0n1r8t",
      "deviceName": "Support phone",
      "participants": 42,
      "onlyAdminsCanSend": false,
      "isAdmin": true,
      "canSend": true,
      "syncedAt": "2026-11-04T10:00:00.000Z"
    }
  ]
}