API Error: Invalid pagination cursor (invalid_cursor / cursor expired)
The page token or cursor you passed is malformed, expired, or was generated for a different query.
Seen on:
REST API
Meaning
Cursor pagination returns an opaque token (next_cursor, starting_after, pageToken) that encodes where the next page starts. The server rejects it if it was edited, URL-encoded wrongly, older than its retention window, or reused with different filters or sort order.
Slack returns invalid_cursor, Google APIs “Invalid page token”, others “cursor is invalid or expired”.
Common causes
- Filters, sort or page size changed between pages
- Cursor too old (expired)
- Cursor decoded/modified or double URL-encoded
- Cursor from one endpoint used on another
⚡ Quick fix
- Restart the listing without a cursor
- Keep every other parameter identical while paging
- Pass the cursor exactly as received, URL-encoding it once
Detailed fix by platform
Node.js
- javascript
let cursor; do { const res = await api.list({ limit: 100, status: 'active', cursor }); // same filters every call handle(res.data); cursor = res.next_cursor; } while (cursor);
How to diagnose
- Params — Same filters/sort as the first page?
- Age — How long since the cursor was issued?
- Encoding — Compare the cursor sent with the one received
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026