Skip to main content

Pagination

Most list endpoints return every matching item in one response; a few cap it with limit and offer no next page. The twelve below return a page at a time. They page in one of three ways:

  • By cursor — the response gives you a value that marks the last item you were sent; send it back to get the next page. A list that changes while you read it does not shift every later page.
  • By page number — page and per, with a total so you can count the pages.
  • By offset — limit and offset, a count of items to skip.
EndpointPages byNext page
List tasks — GET /api/taskscursorX-Next-Cursor header → after
List tickets — GET /api/support/ticketscursornext_cursor → cursor
List hosts — GET /api/hostscursornext_cursor → cursor
List schedule runs — GET /api/crons/{cron_id}/runscursornext_before → before
List all schedule runs — GET /api/crons/runscursornext_before → before
Get Jaah AI ledger — GET /api/org/jaah-ai/ledgercursorlast entry → before and before_id
List credentials — GET /api/credentialspage numberpage + 1
List sessions — GET /api/sessionspage numberpage + 1
List intents — GET /api/nodes/intentspage numberpage + 1
Get command log — GET /api/command-logpage numberpage + 1
Browse the audit log — GET /api/auditoffsetoffset + limit
Get compliance matrix — GET /api/portfolio/compliance-matrixoffsetoffset + limit

Unless a section below says otherwise, a limit, per, page or offset outside its range is refused with 422 and the list-shaped detail described in Errors, and a page past the end returns an empty list. Treat every cursor as opaque: send it back unchanged, never build or edit one.

The task list​

List tasks (GET /api/tasks) pages its top-level tasks.

ParameterMeaning
limitHow many tasks to return, from 1 to 500. A larger value is treated as 500 and a smaller one as 1. Leave it out to get 500.
afterThe cursor from the previous page's X-Next-Cursor header. Leave it out for the first page.

When more tasks remain, the response carries an X-Next-Cursor header. Send its value back unchanged as after, with the same filters, to get the next page. On the last page the header is absent.

GET /api/tasks?limit=50
→ 200, X-Next-Cursor: W1si…

GET /api/tasks?limit=50&after=W1si…
→ 200, no X-Next-Cursor: this was the last page
  • Order. Unfinished tasks first, then the most recently updated, then the highest id. With section=stopped or section=in_progress, unfinished tasks are also sorted by why they stopped or how far they have got.
  • A cursor belongs to its ordering. Changing section, focus or a numbered q between pages changes the order, and the old cursor is refused with 400 and {"detail": "after is not a cursor this listing issued"}. Start again without after.
  • Live data. A task updated while you page may move: it can appear twice or not at all. Reload from the first page when you need an exact snapshot.
  • Children are not paged. With parent_id, the endpoint returns every child of that parent you can see, except archived ones, ordered by id; limit and after do not apply.

The ticket list​

List tickets (GET /api/support/tickets) returns its page in the body: {"items": […], "next_cursor": "…"}.

ParameterMeaning
limitHow many tickets to return, from 1 to 200; default 50.
cursorThe previous response's next_cursor. Leave it out for the first page.

next_cursor is null on the last page. A cursor is valid only for the same sort; any other is refused with 400 and {"detail": "cursor is not one this listing issued"}.

The host list​

List hosts (GET /api/hosts) returns its page in the body: {"items": […], "next_cursor": "…"}, hosts ordered by name, then id.

ParameterMeaning
limitHow many hosts to return, from 1 to 200; default 50.
cursorThe previous response's next_cursor. Leave it out for the first page.

next_cursor is null on the last page. Nodes on shared machines are grouped into one entry with no name or id, and it comes on the last page. A cursor this endpoint did not issue is refused with 422 and {"detail": "That page link is no longer valid."}.

Schedule runs​

List schedule runs (GET /api/crons/{cron_id}/runs) pages one schedule's runs; List all schedule runs (GET /api/crons/runs) pages the runs of every schedule, optionally filtered by cron and outcome. Both return the runs newest first in runs, with the cursor for the next page in next_before, or null at the end.

ParameterMeaning
limitHow many runs to return, from 1 to 200; default 50.
beforeThe previous response's next_before. Leave it out for the newest runs.

On GET /api/crons/runs, send the same filters with every page: the cursor continues the filtered list. A before value the endpoint did not issue is refused with 422 and a detail that starts with before:. The responses have no total count.

The Jaah AI ledger​

Get Jaah AI ledger (GET /api/org/jaah-ai/ledger) returns the ledger between from and to, newest first: {"entries": […], "has_more": true}. It has no cursor field of its own; the last entry of a page is the cursor.

ParameterMeaning
limitHow many entries to return, from 1 to 100; default 25.
beforeThe created_at of the previous page's last entry.
before_idThe id of the previous page's last entry.

While has_more is true, send the same from, to and tz with before and before_id taken from the last entry to get the next page. Send both or neither: one without the other is refused with 422 and {"detail": "Give both before and before_id, or neither"}.

Page-numbered lists​

List credentials, List sessions, List intents and Get command log page by number.

ParameterMeaning
pageWhich page, from 1; default 1. At most 10000 for the command log and 1000000 for the others.
perHow many items a page holds, from 1 to 200; default 25 (50 for the command log).

Each returns its page in items and the number of items matching your filters in total, so the last page is ceil(total / per). Credentials, sessions and intents also echo page and per; sessions and intents add total_unfiltered, the count before your filters. Because these pages are counted rather than marked by a cursor, an item added or removed while you page shifts every later page by one.

  • Credentials — newest first.
  • Sessions — by default, running sessions first, then the most recently started; sort and dir change the order.
  • Intents — pending intents oldest first; with set=retired, newest first.
  • Command log — newest first.

Offset lists​

Browse the audit log (GET /api/audit) returns its page in items, newest first, with total (the entries matching your filters) and total_unfiltered.

ParameterMeaning
limitHow many entries to return, from 1 to 200; default 50.
offsetHow many entries to skip, from 0 to 100000; default 0.

Get compliance matrix (GET /api/portfolio/compliance-matrix) pages its verdict cells, cells, ordered by subject and then rule. Its other fields — subjects, subject_keys and rules — are always complete, whatever page you ask for.

ParameterMeaning
limitHow many cells to return, from 1 to 5000. Leave it out to get every cell.
offsetHow many cells to skip; default 0.