---
title: "Pagination"
description: "List endpoints page with a cursor. Ask for a limit, follow next_cursor until it is null."
url: https://typeship.dev/docs/typeship-api/api/pagination
markdown: https://typeship.dev/docs/typeship-api/api/pagination.md
section: "Get started"
---
> ## Documentation index
> Fetch the complete documentation index at https://typeship.dev/llms.txt (every page, one line each) or the full text at https://typeship.dev/llms-full.txt.
> Append .md to any docs URL, or send Accept: text/markdown, for the markdown twin of that page.

# Pagination

List endpoints page with a cursor. Ask for a limit, follow next_cursor until it is null.

List endpoints on the typeship API return one page at a time and a cursor for the next:

```bash
curl -s "https://typeship.dev/api/v1/projects?limit=20" \
  -H "Authorization: Bearer ak_..."
```

```json
{
  "data": [ { "id": "prj_...", "object": "project", "...": "..." } ],
  "next_cursor": "MjAyNi0wOC0xOFQxMjowMDowMC4wMDBafHByal8..."
}
```

Pass `next_cursor` back as `cursor` for the following page. When `next_cursor` is `null`, you have everything.

| Parameter | Meaning                                           |
| --------- | ------------------------------------------------- |
| `limit`   | Items per page. Default 20, maximum 100.          |
| `cursor`  | The `next_cursor` from the previous page. Opaque. |

Results are newest first. A cursor that was not issued by the API returns `400` with `Malformed cursor.`

Paginated operations: `GET /v1/projects`, `GET /v1/api_keys`, `GET /v1/projects/{id}/generations`, and `GET /v1/projects/{id}/spec_versions`.

## In the typeship SDK

Paginated methods return a `PagePromise`. Iterate it to walk every item, or await it for one page:

```ts
for await (const project of client.projects.list()) {
  console.log(project.name);
}

const page = await client.projects.list({ limit: 50 });
if (page.ok) {
  page.data.items;
  page.data.hasNextPage();
  await page.data.getNextPage();
}
```

## In the typeship CLI

`--all` walks every page and prints one item per line:

```bash
typeship projects list --all | jq -r '.id'
```

## Sitemap

[Every page of these docs](https://typeship.dev/llms.txt)
