Pagination
Keyset cursor pagination for all list endpoints.
List endpoints return a uniform envelope: the rows under data, and pagination state
under page.
{ "data": [ /* … */ ], "page": { "nextCursor": "…", "hasMore": true } }Query parameters
| Param | Meaning |
|---|---|
limit | Page size, default 50, max 500. |
cursor | Opaque cursor from a previous page.nextCursor. Omit for the first page. |
sort | A whitelisted sort key for the resource (see below). |
order | asc or desc. |
q | Free-text filter over resource-specific columns. |
Paging through results
Follow page.nextCursor until page.hasMore is false (at which point nextCursor
is null):
let cursor = undefined;
const all = [];
do {
const url = new URL("https://app.steerd.io/api/public/v1/contacts");
url.searchParams.set("limit", "100");
if (cursor) url.searchParams.set("cursor", cursor);
const res = await fetch(url, { headers: { Authorization: "Bearer strd_YOUR_KEY" } });
const { data, page } = await res.json();
all.push(...data);
cursor = page.hasMore ? page.nextCursor : null;
} while (cursor);The cursor is keyset-based, so it is stable under inserts and deletes; you will
not skip or repeat rows because the underlying data changed between pages. A cursor is
tied to the sort/order it was issued for: passing it with a different sort or
order returns 400 bad_request.
Sort keys per resource
Defaults are shown in bold.
| Resource | Sort keys |
|---|---|
| organizations | name, created_at |
| contacts | name (last, first), email, created_at |
| employees | name (last, first), title, created_at |
| cvs | name, updated_at, created_at |
| projects | updated_at, created_at, title, status, archived_at |
| activities | activity_date, created_at |
| tasks | created_at |
| assignments | created_at |
Default order is asc for the name-defaulted resources and desc for the others.
Projections
Responses are public projections: internal-only fields are never exposed. Every
resource omits team_id; projects also omit board_rank; activities and employees
also omit user_id; tasks also omit assigned_user_id.