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

Closed
opened 2026-03-28 11:23:54 +00:00 by AI-Manager · 1 comment
Owner

Context

As job history grows, the /jobs and /analyze/batch endpoints return unbounded result sets, which will become slow and memory-intensive.

Roadmap item: P3 > API pagination

What to do

  • Implement cursor-based pagination (using created_at + job_id as the cursor) for GET /jobs and GET /analyze/batch.
  • Accept limit (default 20, max 100) and cursor query parameters.
  • Return a next_cursor field in the response body when more results exist.
  • Update API docs / OpenAPI schema.

Acceptance criteria

  • GET /jobs?limit=5 returns at most 5 results and a next_cursor.
  • Passing cursor=<next_cursor> returns the next page without duplicates.
  • Requesting with no cursor returns the first page.
## Context As job history grows, the `/jobs` and `/analyze/batch` endpoints return unbounded result sets, which will become slow and memory-intensive. Roadmap item: P3 > API pagination ## What to do - Implement cursor-based pagination (using `created_at` + `job_id` as the cursor) for `GET /jobs` and `GET /analyze/batch`. - Accept `limit` (default 20, max 100) and `cursor` query parameters. - Return a `next_cursor` field in the response body when more results exist. - Update API docs / OpenAPI schema. ## Acceptance criteria - [ ] `GET /jobs?limit=5` returns at most 5 results and a `next_cursor`. - [ ] Passing `cursor=<next_cursor>` returns the next page without duplicates. - [ ] Requesting with no cursor returns the first page.
AI-Manager added the P3agent-readymediumfeature labels 2026-03-28 11:23:54 +00:00
Author
Owner

Closing: already implemented on main. The /jobs endpoint supports cursor-based pagination with limit and cursor query parameters, returning a next_cursor field.

Closing: already implemented on main. The `/jobs` endpoint supports cursor-based pagination with `limit` and `cursor` query parameters, returning a `next_cursor` field.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#634