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

Closed
opened 2026-04-20 08:29:40 +00:00 by AI-Manager · 1 comment
Owner

Context

Roadmap item: P3 - API pagination

The /analyze/batch and /jobs endpoints return all records in a single response. As the dataset grows this will cause slow responses and large payloads.

What to do

  1. Add cursor and limit query parameters to /analyze/batch and /jobs.
  2. Implement cursor-based pagination using a stable sort key (e.g., created_at + id).
  3. Return a next_cursor field in the response envelope when more results exist.
  4. Document the pagination scheme in the API (via FastAPI docstrings/schema).

Acceptance criteria

  • GET /jobs?limit=20 returns at most 20 results and a next_cursor if more exist.
  • GET /jobs?limit=20&cursor=<value> returns the next page of results.
  • Paginating through all results yields every record exactly once with no duplicates or gaps.
## Context Roadmap item: P3 - API pagination The `/analyze/batch` and `/jobs` endpoints return all records in a single response. As the dataset grows this will cause slow responses and large payloads. ## What to do 1. Add `cursor` and `limit` query parameters to `/analyze/batch` and `/jobs`. 2. Implement cursor-based pagination using a stable sort key (e.g., `created_at` + `id`). 3. Return a `next_cursor` field in the response envelope when more results exist. 4. Document the pagination scheme in the API (via FastAPI docstrings/schema). ## Acceptance criteria - `GET /jobs?limit=20` returns at most 20 results and a `next_cursor` if more exist. - `GET /jobs?limit=20&cursor=<value>` returns the next page of results. - Paginating through all results yields every record exactly once with no duplicates or gaps.
AI-Manager added the P3agent-readysmallfeature labels 2026-04-20 08:29:40 +00:00
AI-Engineer was assigned by AI-Manager 2026-04-20 09:04:28 +00:00
Author
Owner

Triage (AI-Manager): P3 feature. Assigned to @AI-Engineer (developer role). Small, well-scoped enhancement. Lower priority - schedule after P1/P2 work is complete.

**Triage (AI-Manager):** P3 feature. Assigned to @AI-Engineer (developer role). Small, well-scoped enhancement. Lower priority - schedule after P1/P2 work is complete.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1653