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 —
pageandper, with atotalso you can count the pages. - By offset —
limitandoffset, a count of items to skip.
| Endpoint | Pages by | Next page |
|---|---|---|
List tasks — GET /api/tasks | cursor | X-Next-Cursor header → after |
List tickets — GET /api/support/tickets | cursor | next_cursor → cursor |
List hosts — GET /api/hosts | cursor | next_cursor → cursor |
List schedule runs — GET /api/crons/{cron_id}/runs | cursor | next_before → before |
List all schedule runs — GET /api/crons/runs | cursor | next_before → before |
Get Jaah AI ledger — GET /api/org/jaah-ai/ledger | cursor | last entry → before and before_id |
List credentials — GET /api/credentials | page number | page + 1 |
List sessions — GET /api/sessions | page number | page + 1 |
List intents — GET /api/nodes/intents | page number | page + 1 |
Get command log — GET /api/command-log | page number | page + 1 |
Browse the audit log — GET /api/audit | offset | offset + limit |
Get compliance matrix — GET /api/portfolio/compliance-matrix | offset | offset + 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.
| Parameter | Meaning |
|---|---|
limit | How 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. |
after | The 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=stoppedorsection=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,focusor a numberedqbetween pages changes the order, and the old cursor is refused with400and{"detail": "after is not a cursor this listing issued"}. Start again withoutafter. - 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;limitandafterdo not apply.
The ticket list
List tickets (GET /api/support/tickets) returns its page in the
body: {"items": […], "next_cursor": "…"}.
| Parameter | Meaning |
|---|---|
limit | How many tickets to return, from 1 to 200; default 50. |
cursor | The 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.
| Parameter | Meaning |
|---|---|
limit | How many hosts to return, from 1 to 200; default 50. |
cursor | The 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.
| Parameter | Meaning |
|---|---|
limit | How many runs to return, from 1 to 200; default 50. |
before | The 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.
| Parameter | Meaning |
|---|---|
limit | How many entries to return, from 1 to 100; default 25. |
before | The created_at of the previous page's last entry. |
before_id | The 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.
| Parameter | Meaning |
|---|---|
page | Which page, from 1; default 1. At most 10000 for the command log and 1000000 for the others. |
per | How 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;
sortanddirchange 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.
| Parameter | Meaning |
|---|---|
limit | How many entries to return, from 1 to 200; default 50. |
offset | How 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.
| Parameter | Meaning |
|---|---|
limit | How many cells to return, from 1 to 5000. Leave it out to get every cell. |
offset | How many cells to skip; default 0. |