Skip to content

Pagination

Every list endpoint returns the same envelope, even short lists such as devices or webhooks:

{
"data": [
{ "id": "msg_q8v2k4n6p1r3t5w7y9z0b2c4", "status": "delivered" },
{ "id": "msg_h3j5l7n9q2s4u6w8y1a3c5e7", "status": "sent" }
],
"nextCursor": "bXNnX2gzajVsN245cTJzNHU2dzh5MWEzYzVlNw"
}

nextCursor is null on the last page. Lists are ordered newest first.

Query Default Range Description
limit 50 1 to 200 Items per page.
cursor nextCursor from the previous page. Leave it out for the first page.

Treat the cursor as an opaque string: pass it back exactly as received. A cursor the API did not issue returns 400 invalid_cursor. Keep the same filters on every page; changing them mid-way gives inconsistent results.

Cursor paging is stable while new items arrive. A message created while you page appears at the start of the list, so it never shifts the pages you are reading.

Terminal window
cursor=""
while :; do
page=$(curl -s "https://api.smsfabric.com/v1/messages?status=failed&limit=200${cursor:+&cursor=$cursor}" \
-H "X-Api-Key: $SMSFABRIC_API_KEY")
echo "$page" | jq -r '.data[] | "\(.id) \(.errorCode)"'
cursor=$(echo "$page" | jq -r '.nextCursor // empty')
[ -z "$cursor" ] && break
done

These take limit and cursor: GET /v1/messages, GET /v1/verifications, GET /v1/contacts, GET /v1/contact-groups, GET /v1/contact-imports, GET /v1/templates, GET /v1/campaigns, GET /v1/blacklist, GET /v1/webhooks/:id/deliveries and GET /v1/audit.

These return the whole list in one page, with nextCursor: null: GET /v1/devices, GET /v1/pools, GET /v1/webhooks, GET /v1/api-keys, GET /v1/org/members and GET /v1/org/invitations.

For a full copy of your message log, GET /v1/messages/export.csv streams every matching row in one response.