> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.cadrooms.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.cadrooms.com/_mcp/server.

# Pagination

All list endpoints in the CAD ROOMS API use cursor-based pagination to return results in manageable batches. The only exception is [List ECO files](/api-reference/ecos/list-eco-files), which returns all files in a single response.

Endpoints such as `GET /projects/{projectId}/files` and `GET /projects/{projectId}/ecos` use the same pagination parameters and response format.

## Query parameters

* **`limit`** (integer, default 100): Maximum number of records to return per page. Accepts values from 1 to 1000.
* **`cursor`** (string, default None): Cursor indicating where to resume retrieving results. Omit this parameter when requesting the first page.

## Response format

All paginated responses follow a consistent structure:

```json
{
  "data": [ ... ],
  "nextCursor": "b3BhcXVlLWN1cnNvcg"
}
```

* **`data`:** Array of records for the current page, returned in the endpoint's defined sort order. Contains an empty array (`[]`) if no records are found.
* **`nextCursor`:** Cursor used to retrieve the next page. Returns `null` when no additional results are available.

## Example: Retrieve all project files

### Step 1: Request the first page

Send a request with the desired `limit`. Omit the `cursor` parameter when requesting the first page.

```bash
curl "https://api.cadrooms.workers.dev/v1/projects/356d9a6c-31e9-4d9c-ad55-de709172d893/files?limit=2" \
  -H "Authorization: Bearer <apiKey>"
```

Example response:

```json
{
  "data": [
    {
      "projectId": "356d9a6c-31e9-4d9c-ad55-de709172d893",
      "path": "housing.asm",
      "name": "housing.asm",
      "folder": "",
      "revisionId": "5e2f66fe-f4dd-49b9-acba-b84f5e66328b",
      "revisionMajor": "B",
      "revisionMinor": 1,
      "contentType": "application/octet-stream",
      "sizeBytes": 1048576,
      "sha256": "3e1f0b7a6c4e2f9d8b1a0c7e5f3d2b19b74c1a3e5f2d8b0c6a1e4f7d2b9c8a5e",
      "starred": false,
      "latestContribution": {
        "id": "580ed703-3742-40a1-a318-2ca6b31523ad",
        "title": "Update housing",
        "description": "",
        "author": { "id": "40a078d1-1f99-459a-a09a-f21da9c5dce4", "displayName": "John Doe" },
        "createdAt": "2026-10-05T11:30:00Z"
      },
      "createdAt": "2026-04-10T10:00:00Z",
      "updatedAt": "2026-10-05T11:30:00Z"
    },
    {
      "projectId": "356d9a6c-31e9-4d9c-ad55-de709172d893",
      "path": "parts/bracket.prt",
      "name": "bracket.prt",
      "folder": "parts",
      "revisionId": "e88d65cd-879d-4df3-adfc-ef0ca99238bf",
      "revisionMajor": "A",
      "revisionMinor": 3,
      "contentType": "application/octet-stream",
      "sizeBytes": 482113,
      "sha256": "9b74c1a3e5f2d8b0c6a1e4f7d2b9c8a5e3f1d0b7a6c4e2f9d8b1a0c7e5f3d2b1",
      "starred": false,
      "latestContribution": {
        "id": "bc06695b-d65d-4446-a075-82a9b9d33a22",
        "title": "Fillet edges",
        "description": "",
        "author": { "id": "40a078d1-1f99-459a-a09a-f21da9c5dce4", "displayName": "John Doe" },
        "createdAt": "2026-10-02T09:00:00Z"
      },
      "createdAt": "2026-04-10T10:00:00Z",
      "updatedAt": "2026-10-02T09:00:00Z"
    }
  ],
  "nextCursor": "b3BhcXVlLWN1cnNvcg"
}
```

### Step 2: Request the next page

Use the `nextCursor` value from the previous response as the `cursor` parameter in your next request.

```bash
curl "https://api.cadrooms.workers.dev/v1/projects/356d9a6c-31e9-4d9c-ad55-de709172d893/files?limit=2&cursor=b3BhcXVlLWN1cnNvcg" \
  -H "Authorization: Bearer <apiKey>"
```

### Step 3: Continue until all records are retrieved

Repeat this process until `nextCursor` is `null`, indicating that you have reached the last page.

## Additional considerations

* **Sort order:** Each list endpoint has a predefined sort order, documented in its API reference.
* **Cursor handling:** Cursors are opaque strings. Pass them back exactly as received, without modifying or interpreting their contents.
* **Filtering:** Some endpoints support additional filters, such as `status` for ECOs, and `path`, `authorId`, `since`, and `until` for contributions. These filters can be used alongside pagination parameters.
* **Total count:** Some list endpoints support `include=totalCount`. When specified, the response also includes `totalCount`, representing the total number of records that match the request across all pages. Counting is optional because it can be slower for large lists.