List messages
/v1/messages Scopereports:read
Messages of the API key project, newest first. Filters combine with AND. Unknown query parameters are rejected.
Parameters10
limitqueryintegercursorquerystringpagination.nextCursorof the previous page.pagequeryintegerPage number (1-based) for numbered pagination with
pagination.total. Ignored withcursor; to read everything, followcursorinstead (faster on large lists).statusquerystringOnly this status.
typequerystringOnly this type.
channelquerystringOnly this channel.
mobilequerystringRecipient in international format.
templateIdquerystringSMS template (
tmpl_…).createdFromquerystring (date-time)Created at or after (ISO 8601).
createdToquerystring (date-time)Created at or before (ISO 8601).
Responses
- 200
A page of messages.
- 400
Invalid filter.
Example
Response 400{ "success": false, "error": { "code": "VALIDATION_FAILED", "message": "Invalid filter", "details": [ { "field": "createdFrom", "message": "must not be after createdTo" } ] }, "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-Afterseconds, 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/messages" \
-H "X-API-Key: $SMS21_API_KEY"{
"success": true,
"data": [
{
"messageId": "msg_01k55q8y4m3d9v7x2c6b0n1r8t",
"status": "delivered",
"channel": "sms",
"type": "transactional",
"environment": "live",
"to": "919876543210",
"templateId": "tmpl_01k55q8y4m3d9v7x2c6b0n1r8t",
"whatsappTemplateId": null,
"segments": 1,
"encoding": "gsm7",
"failure": null,
"queuedAt": "2026-09-15T10:30:00.000Z",
"submittedAt": "2026-09-15T10:30:00.000Z",
"sentAt": "2026-09-15T10:30:00.000Z",
"deliveredAt": "2026-09-15T10:30:04.000Z",
"failedAt": null
}
],
"pagination": {
"limit": 20,
"hasMore": true,
"nextCursor": "eyJpZCI6IjAxOTk0OTFjIn0"
}
}