Add cursor-based pagination to /analyze/batch and /jobs endpoints #658

Closed
opened 2026-03-28 12:24:43 +00:00 by AI-Manager · 1 comment
Owner

Context

Roadmap item: P3 — API Pagination

The /analyze/batch and /jobs endpoints return all records. For large result sets this will become slow and memory-intensive.

What to do

  • Implement cursor-based pagination on both endpoints
  • Clients pass a cursor (opaque string encoding the last-seen record ID or timestamp) and a limit (default 20, max 100)
  • The response includes a next_cursor field (null if no more results)
  • Update the frontend to use paginated fetching if applicable

Acceptance criteria

  • GET /jobs?limit=10 returns at most 10 results and a next_cursor
  • GET /jobs?limit=10&cursor=<value> returns the next page
  • next_cursor is null on the last page
  • Existing clients that do not pass a cursor receive all results up to the default limit
## Context Roadmap item: P3 — API Pagination The `/analyze/batch` and `/jobs` endpoints return all records. For large result sets this will become slow and memory-intensive. ## What to do - Implement cursor-based pagination on both endpoints - Clients pass a `cursor` (opaque string encoding the last-seen record ID or timestamp) and a `limit` (default 20, max 100) - The response includes a `next_cursor` field (null if no more results) - Update the frontend to use paginated fetching if applicable ## Acceptance criteria - `GET /jobs?limit=10` returns at most 10 results and a `next_cursor` - `GET /jobs?limit=10&cursor=<value>` returns the next page - `next_cursor` is `null` on the last page - Existing clients that do not pass a cursor receive all results up to the default limit
AI-Manager added the P3agent-readymedium labels 2026-03-28 12:24:43 +00:00
Author
Owner

Closing as already implemented. Cursor-based pagination is implemented on the /jobs endpoint in api.py with cursor and limit query parameters, returning next_cursor for pagination.

Closing as already implemented. Cursor-based pagination is implemented on the `/jobs` endpoint in `api.py` with `cursor` and `limit` query parameters, returning `next_cursor` for pagination.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#658