# List a flow's runs

> Documentation index: https://exomations.com/llms.txt

`GET /api/v1/flows/{flowId}/runs`

The runs of one flow, newest first, filtered by status and time.

Lists the runs of one flow, newest first. Filter with `status`, and with `since` and `until` on the time the run was recorded (both included). Run data is not returned; read a run's steps with `GET /runs/{runId}/steps`.

## Authorization

The REST API is being rolled out and is not yet available to every workspace. Send an API key with the `read` permission in the `X-Api-Key` header. REST API access must be switched on for the workspace; see the REST API overview.

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `flowId` | string | yes | The flow's ID. |

## Query parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `status` | string ("queued" \| "running" \| "success" \| "partially_succeeded" \| "failed" \| "retrying" \| "waiting_approval" \| "skipped" \| "rejected" \| "held") | no | Only runs with this status (see Run status). |
| `since` | string | no | Only runs recorded at or after this time. An ISO 8601 date-time with a time zone, for example `2026-11-01T00:00:00Z`. |
| `until` | string | no | Only runs recorded at or before this time. Same format as `since`. |
| `limit` | integer | no | Items per page, from 1 to 100. Default 20. |
| `cursor` | string | no | The `nextCursor` of the previous page, unchanged. |

## Response

The answer is `{ data, nextCursor }`; each item of `data` has these fields:

| Name | Type | Description |
|---|---|---|
| `id` | string | The run's ID. |
| `status` | string | The run's status (see Run status). |
| `startedAt` | string (date-time) \| null | When the run started. |
| `completedAt` | string (date-time) \| null | When the run finished. |
| `durationMs` | integer \| null | How long the run took, in milliseconds. |
| `error` | string \| null | The run's error message, or `null`. At most 2,000 characters; credentials, e-mail addresses, long digit runs and internal addresses are masked, so do not parse it. It reads `The error text is not available.` when it cannot be shown. |
| `replayOfExecutionId` | string \| null | For a replay, the ID of the run it replays; otherwise `null`. |
| `data` (envelope) | array | The items of this page. |
| `nextCursor` (envelope) | string \| null | Pass it as `cursor` for the next page; `null` when the list has ended. |

### 200

```json
{
  "data": [
    {
      "id": "0b6f6c1e-5a55-4d0e-9a57-2f7c1d0e8a11",
      "status": "failed",
      "startedAt": "2026-11-16T08:30:12.000Z",
      "completedAt": "2026-11-16T08:30:13.840Z",
      "durationMs": 1840,
      "error": "Request failed with status 503",
      "replayOfExecutionId": null
    }
  ],
  "nextCursor": null
}
```

## Errors

Every error is JSON with three fields: `error` (a short title), `code` (a fixed name your code can rely on) and `message` (a sentence for people). An unknown path under `/api/v1` answers `404` with `NOT_FOUND`.

| Status | Code | When | Message |
|---|---|---|---|
| 400 | `INVALID_STATUS` | `status` is not a run status. | `The status filter must be one of: queued, running, success, partially_succeeded, failed, retrying, waiting_approval, skipped, rejected, held.` |
| 400 | `INVALID_RANGE` | `since` or `until` is not a date-time with a time zone, or `since` is later than `until`. | `since and until must be ISO 8601 date-times with a time zone (for example 2026-11-01T00:00:00Z), and since must not be later than until.` |
| 400 | `INVALID_LIMIT` | `limit` is not a whole number from 1 to 100. | `The limit must be a whole number from 1 to 100.` |
| 400 | `INVALID_CURSOR` | `cursor` is not a `nextCursor` from this list, or is no longer valid: start the list again from the first page. | `The cursor is not valid. Pass the nextCursor value from a previous response unchanged.` |
| 404 | `NOT_FOUND` | No such flow or run in the key's workspace (another workspace's IDs and withheld flows answer the same), or an unknown path. | `The requested resource was not found.` |
| 401 | `UNAUTHENTICATED` | The key is missing, not an Exomations API key, unknown, inactive, expired or deleted, or it was sent in the URL or an `Authorization` header. | `A valid API key is required in the X-Api-Key header.` |
| 402 | `PENDING_PAYMENT` | The workspace is awaiting its card verification (every endpoint except `GET /usage`). | `Payment required. Complete the 1 SAR card verification on the Billing page to activate your account.` |
| 403 | `FORBIDDEN` | The key does not carry `read`. | `This API key does not have the Read permission.` |
| 403 | `FORBIDDEN` | The workspace is suspended. | `This workspace is suspended.` |
| 403 | `API_NOT_ENABLED` | REST API access is off for the workspace. | `REST API access is turned off for this workspace. An admin or the owner can turn it on on the API Keys page.` |
| 405 | `METHOD_NOT_ALLOWED` | A method other than `GET` or `HEAD`. The `Allow` header lists the methods. | `This endpoint does not support this method. See the Allow header.` |
| 429 | `RATE_LIMITED` | Too many calls in a minute (calls without a valid key are limited too). | `Rate limit reached. Retry after the number of seconds in the Retry-After header.` |
| 500 | `INTERNAL` | Something failed on our side. Retry; if it happens again, contact support. | `Something went wrong on our side. Please try again.` |

## Examples

### cURL

```bash
curl "https://exomations.com/api/v1/flows/YOUR_FLOW_ID/runs?status=failed&since=2026-11-01T00:00:00Z&limit=50" \
  -H "X-Api-Key: exo_your_key"

# Next page: add &cursor=<nextCursor from the previous answer>
```

### JavaScript

```javascript
// Every page, following nextCursor until it is null.
const items = [];
let cursor = null;
do {
  const params = new URLSearchParams({ status: "failed", since: "2026-11-01T00:00:00Z", limit: "50" });
  if (cursor) params.set("cursor", cursor);
  const res = await fetch(`https://exomations.com/api/v1/flows/YOUR_FLOW_ID/runs?${params}`, {
    headers: { "X-Api-Key": process.env.EXOMATIONS_KEY }, // exo_...
  });
  const page = await res.json();
  if (!res.ok) throw new Error(`${page.code}: ${page.message}`);
  items.push(...page.data);
  cursor = page.nextCursor;
} while (cursor);
console.log(items.length);
```

### Python

```python
import os, requests

items, cursor = [], None
while True:
    params = {"status": "failed", "since": "2026-11-01T00:00:00Z", "limit": 50}
    if cursor:
        params["cursor"] = cursor
    res = requests.get(
        "https://exomations.com/api/v1/flows/YOUR_FLOW_ID/runs",
        headers={"X-Api-Key": os.environ["EXOMATIONS_KEY"]},  # exo_...
        params=params,
        timeout=15,
    )
    page = res.json()
    if res.status_code != 200:
        raise RuntimeError(f"{page['code']}: {page['message']}")
    items.extend(page["data"])
    cursor = page["nextCursor"]
    if not cursor:
        break
print(len(items))
```
