Slack API · error code

Slack error invalid_cursor: Pagination cursor is invalid or expired

Permanent - do not retryHTTP 200Channels, membership & DMs

Last verified against Slack API reference - chat.postMessage errors

What Slack returns
Value passed for cursor was not valid or is no longer valid.

What error invalid_cursor means

The cursor you passed to a paginated method (conversations.history, conversations.replies, conversations.list, conversations.members and others) was not accepted. Slack phrases it as "Value passed for cursor was not valid or is no longer valid." Its pagination guide says this is the only pagination-specific error, returned for a cursor that is "gibberish, somehow encoded wrong, or of too great a vintage."

The vintage part catches people. The guide states that "Cursors expire and are meant to be used within a reasonable amount of time," and advises: "do not persist cursors for hours or days." Pausing between rate-limit windows is fine; resuming a backfill from a cursor saved yesterday is not.

Encoding is the other trap. Cursors are opaque strings that can contain characters like =. Sending one in a query string without URL-encoding, or passing a cursor from one method or channel into another, also lands here.

What it looks like

GET /api/conversations.history?channel=C123ABC456&cursor=bmV4dF90czoxNTEyMDg1ODYxMDAwNTQz

{"ok": false, "error": "invalid_cursor"}

Why it happens

  • A cursor stored for hours or days was reused after it expired.
  • The cursor was not URL-encoded in a GET query string.
  • A cursor from one method, channel or token was passed to a different call.
  • The cursor was truncated or modified in storage.

How to fix Slack error invalid_cursor

  1. 1Pass next_cursor back exactly as returned, URL-encoded when in a query string.
  2. 2Use each cursor only with the same method, arguments and token that produced it.
  3. 3If a cursor has expired, restart pagination from the beginning, or from a timestamp boundary such as oldest/latest on conversations.history.
  4. 4Stop when response_metadata.next_cursor is an empty string.

How to stop it recurring

For long backfills, checkpoint on durable values like message ts, not on cursors. Keep the cursor only in memory for the current run, and rely on the SDK's pagination helpers so encoding is handled for you. Pace pages with Slack's rate limits rather than long pauses.

Official reference: Slack API reference - chat.postMessage errors. See all Slack error codes or the Slack limits and quotas.

Related codes

Error invalid_cursor - quick answers

What does Slack error invalid_cursor mean?

The cursor you passed to a paginated method ( conversations.history , conversations.replies , conversations.list , conversations.members and others) was not accepted.

How do I fix Slack error invalid_cursor?

1. Pass next_cursor back exactly as returned, URL-encoded when in a query string. 2. Use each cursor only with the same method, arguments and token that produced it. 3. If a cursor has expired, restart pagination from the beginning, or from a timestamp boundary such as oldest/latest on conversations.history. 4. Stop when response_metadata.next_cursor is an empty string.

Should I retry after error invalid_cursor?

No. Retrying the same request produces the same error; the condition has to be fixed first. Treat it as a permanent failure for that message and surface it, rather than looping.

Stop debugging Slack by hand

Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.