> ## Documentation Index
> Fetch the complete documentation index at: https://docs.myunite.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Pagination and filters

> How to page through the list of pre-tests.

`GET /pretests` returns the workspace pre-tests, newest first. It includes the ones created through the API and the ones created in the app.

## Parameters

| Parameter | Description |
| - | - |
| `limit` | Page size, from 1 to 100. Default: 20. |
| `cursor` | The `nextCursor` from the previous page. |
| `status` | `queued`, `processing`, `completed` or `failed`. |
| `channel` | `ooh`, `digital` or `email`. |

An invalid value responds [`invalid_request`](https://docs.myunite.ai/en/errors#invalid_request) with the parameter name in `param`.

## Response

```json theme={null}
{
  "object": "list",
  "data": [
    {
      "id": "PRETEST_ID",
      "object": "pretest",
      "status": "completed",
      "channel": "ooh",
      "title": "Summer · urban clock",
      "score": 7.4,
      "recommendation": "optimize",
      "createdAt": "2026-11-16T13:00:00.000Z",
      "updatedAt": "2026-11-16T13:04:00.000Z"
    }
  ],
  "nextCursor": "OPAQUE_CURSOR"
}
```

While `nextCursor` is not `null`, there are more pages. Treat the cursor as opaque text: do not build or change it. Keep the same filters across all pages.

The list carries a summary of each pre-test. For the full result, use `GET /pretests/{id}`.

```bash curl theme={null}
curl "https://myunite.ai/api/v1/pretests?status=completed&channel=ooh&limit=50" \
  -H "Authorization: Bearer $UNITE_API_KEY"
```

```javascript JavaScript theme={null}
async function* allCompleted() {
  let cursor;
  do {
    const url = new URL("https://myunite.ai/api/v1/pretests");
    url.searchParams.set("status", "completed");
    url.searchParams.set("limit", "50");
    if (cursor) url.searchParams.set("cursor", cursor);
    const res = await fetch(url, {
      headers: { Authorization: `Bearer ${process.env.UNITE_API_KEY}` },
    });
    const page = await res.json();
    yield* page.data;
    cursor = page.nextCursor;
  } while (cursor);
}

for await (const item of allCompleted()) console.log(item.title, item.score);
```

```python Python theme={null}
import os
import requests

def all_completed():
    cursor = None
    while True:
        params = {"status": "completed", "limit": 50}
        if cursor:
            params["cursor"] = cursor
        page = requests.get(
            "https://myunite.ai/api/v1/pretests",
            params=params,
            headers={"Authorization": f"Bearer {os.environ['UNITE_API_KEY']}"},
        ).json()
        yield from page["data"]
        cursor = page["nextCursor"]
        if not cursor:
            break

for item in all_completed():
    print(item["title"], item["score"])
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.