List messages
Page through your message history, newest first.
GET
/api/v1/smsQuery parameters
status
string
Filter by status, e.g. DELIVERED or FAILED.
campaign_id
string
Only messages in one campaign.
recipient
string
Only messages to one number.
from
string
ISO 8601 datetime lower bound.
to
string
ISO 8601 datetime upper bound.
limit
integer
1–200. Defaults to 50.
cursor
string
next_cursor from the previous page.
Shell
curl "https://api.jkasms.com/api/v1/sms?status=FAILED&limit=50" \
-H "Authorization: Bearer $JKASMS_SECRET_KEY" \
-H "X-JKASMS-Org-Id: $JKASMS_ORG_ID"Response200
JSON
{
"success": true,
"data": [ { "message_id": "cmu9x2k4a0001abcd", "status": "FAILED" } ],
"has_more": true,
"next_cursor": "cmu9x2k4a0001abcd"
}Pagination
Cursor-based, not offset-based. Pass next_cursor back as cursor until has_more is false.
Node.js
let cursor;
const all = [];
do {
const url = new URL("https://api.jkasms.com/api/v1/sms");
url.searchParams.set("limit", "200");
if (cursor) url.searchParams.set("cursor", cursor);
const res = await fetch(url, { headers });
const page = await res.json();
all.push(...page.data);
cursor = page.has_more ? page.next_cursor : undefined;
} while (cursor);Cursors are used rather than page numbers because an offset scan over millions of rows gets slower the deeper you page. A cursor stays fast at any depth, and new messages arriving mid-pagination cannot shift rows into a page you already read.