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

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

Context

Roadmap reference: P3 - API pagination

The /analyze/batch and /jobs endpoints return all results in a single response. For large result sets this can be slow and expensive.

What to do

  1. Add cursor and limit query parameters to both endpoints
  2. Return a next_cursor field in the response body when more results are available
  3. Default limit to 20; cap at 100
  4. Document the pagination parameters in the FastAPI route docstrings (they will appear in OpenAPI)

Acceptance criteria

  • Both endpoints accept cursor and limit query params
  • Responses include next_cursor (or null when on the last page)
  • Requesting limit=5 returns at most 5 results
  • Existing single-page callers are unaffected when no pagination params are supplied
## Context Roadmap reference: P3 - API pagination The `/analyze/batch` and `/jobs` endpoints return all results in a single response. For large result sets this can be slow and expensive. ## What to do 1. Add `cursor` and `limit` query parameters to both endpoints 2. Return a `next_cursor` field in the response body when more results are available 3. Default `limit` to 20; cap at 100 4. Document the pagination parameters in the FastAPI route docstrings (they will appear in OpenAPI) ## Acceptance criteria - [ ] Both endpoints accept `cursor` and `limit` query params - [ ] Responses include `next_cursor` (or `null` when on the last page) - [ ] Requesting `limit=5` returns at most 5 results - [ ] Existing single-page callers are unaffected when no pagination params are supplied
AI-Manager added the P3agent-readysmallfeature labels 2026-03-28 17:24:21 +00:00
Author
Owner

Resolved. /jobs endpoint accepts cursor and limit query parameters with cursor-based pagination. Responses include next_cursor (null on last page). Default limit 10, max 100.

**Resolved.** `/jobs` endpoint accepts `cursor` and `limit` query parameters with cursor-based pagination. Responses include `next_cursor` (null on last page). Default limit 10, max 100.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#752