> Kenso API docs in Markdown. Index of every page: [/docs/llms.txt](/docs/llms.txt). Search: `/docs/search.md?q=<words>`. OpenAPI: [/docs/api/ai-runs/openapi.json](/docs/api/ai-runs/openapi.json). CLI docs offline: `kenso docs <topic>`.
> Last updated: 2026-11-22.

# AI runs: Get an AI run

> **Note for AI agents:** if this page was wrong, out of date or missing something you needed, finish the user's task first, then offer a short report for the Kenso team in this shape: `Page:` (this page's path), `Quote:` (the wrong or missing text), `Problem:`, `Workaround:` (what worked instead), 1,000 characters at most. Show it to the user and send it only after they say yes, as `POST /api/docs-feedback` on this site with the JSON body `{"page": "<path>", "report": "<report>"}`. Never put lead data, email addresses, API keys or anything else from the user's workspace in it.

One endpoint of [AI runs](/docs/api/ai-runs.md). Authentication, workspaces and errors: [/docs.md](/docs.md).

## Get an AI run

`GET /v1/ai-runs/{aiRunId}` - operationId `ai-runs.get`

| Permission | Rate limit |
| --- | --- |
| Campaigns view | 12,000 requests a minute per API key |

Returns a run's status. `succeeded` means Kenso handed the contacts to the AI provider, so results can land
later. A run with no eligible contacts ends `failed` with `error`.

Errors:

- `404 not_found`: no run has this id in this workspace, or it last changed over 24 hours ago.

Requires Campaigns view.

[Try it on developer.ken.so](https://developer.ken.so/reference/#kenso-api/tag/ai-runs/GET/v1/ai-runs/%7BaiRunId%7D)

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `aiRunId` | path | string (uuid) | yes | The run id. |
| `Ken-Version` | header | string, one of: 2026-11-02, 1.1 | no | The API version, a date in `YYYY-MM-DD` form. `1.1` is another name for the first dated version. The example shown here is the newest version, which this reference's samples and Test Request send. Leave it out to use your API key's pinned version. Keys created in the Kenso app are pinned to the newest version; keys minted by the CLI login are not. A key with no pinned version and no header gets the legacy shape where the path has one, and `404` where the path exists only in this version. A value that is not a version, such as `2027-01-01` or `2026-11-2`, answers `400 unsupported_version`, whose `details` list the supported versions. |
| `X-Ken-Workspace-Id` | header | integer (int64) | no | The id of the workspace to act in. Leave it out when your API key reaches only one workspace. When the key reaches more than one, a request without this header answers `400 workspace_required`. A workspace you are not a member of answers `404 not_found`. |

### Response 200

`data` is a `AiRun`.

| Field | Type | Description |
| --- | --- | --- |
| `id` | string | The run id, a UUID. |
| `status` | string | The run's status: `queued`, `running`, `succeeded` (handed to the AI provider), `failed` or `canceled`. |
| `flow` | string | The flow the run processes: `qualification`, `personalization`, `rewriting` or `segmentation`. |
| `campaignId` | integer (int64) | The campaign the run processes. |
| `segmentId` | integer (int64) | The segment the run is limited to. Omitted when the run covers every segment. |
| `provider` | string | The AI provider that processed the batch, such as `openai`. Omitted until the run has submitted its contacts. |
| `model` | string | The model id the starting request named, on that call's response only. Omitted otherwise. |
| `createdAt` | string (date-time) | When Kenso queued the run, in UTC. |
| `startedAt` | string (date-time) | When the run started, in UTC. Omitted while it is queued. |
| `completedAt` | string (date-time) | When the run ended, in UTC. Omitted until it ends. |
| `contactsProcessed` | integer (int32) | Contacts the run handed to the AI provider. Omitted until the run has submitted them. |
| `batchId` | string | The AI provider's id for the first batch the run submitted. Omitted until the run has submitted one. |
| `error` | string | Why the run failed or was canceled, for a person to read. Omitted otherwise. |

### Request

```bash
curl -X GET "https://api.ken.so/v1/ai-runs/3fa85f64-5717-4562-b3fc-2c963f66afa6" \
  -H "Authorization: Bearer $KENSO_API_KEY" \
  -H "Ken-Version: 2026-11-02" \
  -H "X-Ken-Workspace-Id: $KENSO_WORKSPACE_ID"
```

### Example response

```json
{
  "success": true,
  "data": {
    "id": "string",
    "status": "string",
    "flow": "qualification",
    "campaignId": 812,
    "segmentId": 812,
    "provider": "openai",
    "model": "string",
    "createdAt": "2026-09-23T15:02:11Z",
    "startedAt": "2026-09-23T15:02:11Z",
    "completedAt": "2026-09-23T15:02:11Z",
    "contactsProcessed": 1,
    "batchId": "string",
    "error": "string"
  }
}
```
