Pagination and errors
Consume lists predictably and recover from REST API failures.
Pagination is endpoint-specific. If a list supports cursors, request a bounded limit value. Pass the returned nextCursor back as after. The cursor response usually contains items, nextCursor, and hasMore. Do not assume that every list supports cursor pagination. Inbox uses its own cursor form. Activity sessions use numbered pages. Some resource lists have no pagination. Check the generated reference for the route that you call.
Request-schema failures use the 400 VALIDATION_ERROR envelope. Scope failures use 403 INSUFFICIENT_SCOPE. Unexpected handler or middleware failures use 500 INTERNAL_ERROR. Before you use a response, parse the shared { success, data, error } structure. Keep the error code in your logs. This helps operators distinguish malformed requests from authorization mistakes.
Retry only failures that are safe for the operation. You can often retry reads and idempotent updates after a transient error. Creations, sends, and other externally visible actions need an idempotency strategy in your own service. Do not retry validation or scope errors without changes. Fix the input or the relevant configuration first.