> 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

> **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.

Queue AI runs over a campaign's contacts, check eligibility and reset flows or chosen contacts.

AI. 5 endpoints under `https://api.ken.so`. Every request sends `Authorization: Bearer <your API key>` and `Ken-Version: 2026-11-02`: see [Authentication](/docs/authentication.md), [Workspaces](/docs/workspaces.md) and [Errors](/docs/errors.md). OpenAPI for this resource only: [/docs/api/ai-runs/openapi.json](/docs/api/ai-runs/openapi.json).

- `POST /v1/campaigns/{campaignId}/ai-runs` - Start an AI run (`ai-runs.create`): [/docs/api/ai-runs/create.md](/docs/api/ai-runs/create.md)
- `GET /v1/ai-runs/{aiRunId}` - Get an AI run (`ai-runs.get`): [/docs/api/ai-runs/get.md](/docs/api/ai-runs/get.md)
- `GET /v1/campaigns/{campaignId}/ai-runs/eligibility` - Get a campaign's AI run eligibility (`ai-runs.get-eligibility`): [/docs/api/ai-runs/get-eligibility.md](/docs/api/ai-runs/get-eligibility.md)
- `POST /v1/campaigns/{campaignId}/ai-runs/reset` - Reset an AI flow (`ai-runs.reset`): [/docs/api/ai-runs/reset.md](/docs/api/ai-runs/reset.md)
- `POST /v1/campaigns/{campaignId}/ai-runs/reset-contacts` - Reset an AI flow for chosen contacts (`ai-runs.reset-contacts`): [/docs/api/ai-runs/reset-contacts.md](/docs/api/ai-runs/reset-contacts.md)

## Start an AI run

`POST /v1/campaigns/{campaignId}/ai-runs` - operationId `ai-runs.create`

| Permission | Credits | Rate limit |
| --- | --- | --- |
| Campaigns edit and the `ask` permission | 50 credits per 1,000 contact rows (`ai_qualification`); 300 credits per 1,000 contact rows (`ai_personalization`) | 30 requests a minute and 200 a day per workspace (Free plan: 3 a minute and 20 a day) |

Queues a run of one flow over the campaign's eligible contacts and answers `202` with the run. Poll it until
`status` is `succeeded`, `failed` or `canceled`. A refused run changes nothing. With
`dryRun: true` it answers `200` with what the run would process. Personalization and rewriting run one
segment at a time, so they need `segmentId`: start one run per segment.

Errors:

- `400 validation_failed`: a body field is missing or not valid, such as no `segmentId` for
personalization or rewriting.
- `402 plan_limit_reached`: no credits are left. `error.refusal` has the balance.
- `404 not_found`: the campaign is not in this workspace, or `segmentId` is not one of its segments.
- `409 runs_on_agent`: the workspace gave this flow to its own agent in the agent work settings, so Kenso's AI
does not run it. Run it with `kenso work run`.
- `429 rate_limited`: an AI run quota is used up. Retry after `Retry-After` seconds.
- `503 service_unavailable`: the run queue is full, or the workspace's agent work setting could not be read.
Retry later.

Requires Campaigns edit and the `ask` permission.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `campaignId` | path | integer (int64) | yes | The campaign to process. |
| `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`. |

### Request body

`application/json`, optional.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `flow` | string | yes | The flow to run: `qualification`, `personalization`, `rewriting` or `segmentation`. Required. |
| `batchSize` | integer (int32) | no | The most contacts this run processes, at least 1. Kenso lowers a value above the flow's limit to the limit: 2,000 for qualification and segmentation, 5,000 for personalization and 500 for rewriting. Omitted means 500, or the flow's limit when `processAll` is true. |
| `processAll` | boolean | no | True runs up to the flow's limit when `batchSize` is omitted. Default false. |
| `segmentId` | integer (int64) | no | A segment of the campaign, to process only its contacts. Required for personalization and rewriting, which run one segment at a time. Omit it for qualification and segmentation to run every segment. `0` is `400 validation_failed`, not "no segment". |
| `provider` | string | no | The AI provider for this run only, such as `openai` or `anthropic`. Omitted uses the flow's saved model settings. Kenso ignores an override it cannot use, such as a model the provider does not offer for the flow, and runs the saved settings. |
| `model` | string | no | The AI model id for this run only. With no `provider`, Kenso picks the provider from the model. Omitted uses the flow's saved model settings. |
| `dryRun` | boolean | no | True checks the request and returns what the run would process (`200`) without queueing it, reserving quota or spending credits. Default false. |

### Response 200

Also answers `202`. `data` is a `AiRunDryRun`.

| Field | Type | Description |
| --- | --- | --- |
| `dryRun` | boolean | Always true. |
| `campaignId` | integer (int64) | The campaign the run would process. |
| `flow` | string | The flow the run would process. |
| `segmentId` | integer (int64) | The segment from the request. Omitted when the run would cover every segment. |
| `processAll` | boolean | The `processAll` value from the request. |
| `provider` | string | The provider from the request. Omitted when the request named none. |
| `model` | string | The model id from the request. Omitted when the request named none. |
| `batchSize` | integer (int32) | The most contacts the run would process: `batchSize` from the request, lowered to the flow's limit, else the flow's limit with `processAll`, else 500. |
| `eligibleCount` | integer (int32) | Contacts eligible for the flow now, only those in `segmentId` when it is set. |
| `projectedContactCount` | integer (int32) | The lower of `eligibleCount` and `batchSize`. The run would process at most this many contacts. |
| `blockingGate` | string | The check that left no contact eligible. Omitted when contacts are eligible. |
| `blockingReason` | string | Why no contact is eligible and what to change, for a person to read. Omitted with `blockingGate`. |

### Request

```bash
curl -X POST "https://api.ken.so/v1/campaigns/812/ai-runs" \
  -H "Authorization: Bearer $KENSO_API_KEY" \
  -H "Ken-Version: 2026-11-02" \
  -H "X-Ken-Workspace-Id: $KENSO_WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
  "flow": "qualification",
  "batchSize": 1,
  "processAll": true,
  "segmentId": 812,
  "provider": "openai",
  "model": "string",
  "dryRun": true
}'
```

### Example response

```json
{
  "success": true,
  "data": {
    "dryRun": true,
    "campaignId": 812,
    "flow": "string",
    "segmentId": 812,
    "processAll": true,
    "provider": "string",
    "model": "string",
    "batchSize": 1,
    "eligibleCount": 1,
    "projectedContactCount": 1,
    "blockingGate": "string",
    "blockingReason": "string"
  }
}
```

## 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"
  }
}
```

## Get a campaign's AI run eligibility

`GET /v1/campaigns/{campaignId}/ai-runs/eligibility` - operationId `ai-runs.get-eligibility`

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

Returns, for each flow, how many contacts a run would process now and, when none would, the check that stops them.
Send `flow` and `preview` together to also count what a reset or a new prompt would clear.

Errors:

- `400 validation_failed`: a parameter is not valid, or only one of `flow` and `preview` is set.
- `404 not_found`: the campaign is not in this workspace, or `segmentId` is not one of its segments.

Requires Campaigns view.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `campaignId` | path | integer (int64) | yes | The campaign to read. |
| `segmentId` | query | integer (int64) | no | A segment of the campaign, to count only its contacts. Omit it for every segment. `0` is `400 validation_failed`, not "no segment". The preview always covers the whole campaign. |
| `flow` | query | string | no | The flow to preview: `qualification`, `personalization`, `rewriting` or `segmentation`. Send it with `preview`, or leave both out. |
| `preview` | query | string | no | What to preview: `reset` (what a reset of `flow` deletes) or `freshness` (what saving a new prompt for `flow` clears). Send it with `flow`, or leave both out. |
| `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 `AiRunEligibility`.

| Field | Type | Description |
| --- | --- | --- |
| `campaignId` | integer (int64) | The campaign read. |
| `flows` | array of AiRunFlowEligibility | One entry for each flow: `qualification`, `personalization`, `rewriting` and `segmentation`. |
| `preview` | AiRunInvalidationPreview | What the previewed change would clear. Omitted unless the request sent `flow` and `preview`. |

### Request

```bash
curl -X GET "https://api.ken.so/v1/campaigns/812/ai-runs/eligibility" \
  -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": {
    "campaignId": 812,
    "flows": [
      {
        "flow": "qualification",
        "eligibleCount": 1,
        "blockingGate": "campaign_processing_state",
        "blockingReason": "string"
      }
    ],
    "preview": {
      "flow": "string",
      "preview": "reset",
      "hasImpact": true,
      "cascadeFlows": [
        "string"
      ],
      "campaignStatus": "draft",
      "sendingStatus": "not_started",
      "emailsSent": 1,
      "message": "string",
      "impact": {
        "qualificationResponses": 1,
        "qualifiedFlags": 1,
        "segmentationReasoning": 1,
        "segmentationAssignmentsKept": 1,
        "segmentationAssignmentsReset": 1,
        "personalizationLines": 1,
        "personalizationLeads": 1,
        "rewritingLines": 1,
        "rewritingLeads": 1
      }
    }
  }
}
```

## Reset an AI flow

`POST /v1/campaigns/{campaignId}/ai-runs/reset` - operationId `ai-runs.reset`

| Permission | Rate limit |
| --- | --- |
| Campaigns edit | 10 requests a day per workspace (Free plan: 1 a day) |

Clears a flow's output, and every later flow's, for every contact of the campaign, emailed or not, and cancels those
flows' running batches. The next AI run processes the contacts again. A segmentation reset also moves every contact
to the default segment. Each reset counts against a daily quota.

Errors:

- `400 validation_failed`: `flow` is not valid, or a segmentation reset finds no default segment.
- `404 not_found`: the campaign is not in this workspace.
- `429 rate_limited`: the daily reset quota is used up. Retry after `Retry-After` seconds.

Requires Campaigns edit.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `campaignId` | path | integer (int64) | yes | The campaign to reset. |
| `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`. |

### Request body

`application/json`, optional.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `flow` | string | yes | The flow to reset: `qualification`, `personalization`, `rewriting` or `segmentation`. Kenso also resets every flow after it. Required. |

### Response 200

`data` is a `AiRunReset`.

| Field | Type | Description |
| --- | --- | --- |
| `flows` | array of string | The flows Kenso reset, listed from `rewriting` back to the requested flow. |
| `batchesCancelled` | integer (int32) | The campaign's AI batches in progress that Kenso cancelled. Always 0 on a reset for chosen contacts. |
| `runsCancelled` | integer (int32) | Provider fallback chains Kenso cancelled. Always 0 on a reset for chosen contacts. |
| `aiResponseLinesDeleted` | integer (int32) | AI lines Kenso deleted. |
| `aiResponsesDeleted` | integer (int32) | AI responses Kenso deleted. A response is one AI answer and holds the lines in `aiResponseLinesDeleted`. |
| `outreachStatusesRemoved` | integer (int32) | Contact progress marks for the reset flows that Kenso removed, so those contacts are eligible again. |
| `qualificationResponsesDeleted` | integer (int32) | Stored qualification answers Kenso deleted. 0 unless the reset covers qualification. |
| `segmentationReasoningDeleted` | integer (int32) | Stored segmentation reasons Kenso deleted. 0 unless the reset covers segmentation. |
| `contactsQualificationReset` | integer (int32) | Contacts whose qualification result Kenso cleared. 0 unless the reset covers qualification. |
| `contactsSegmentReset` | integer (int32) | Contacts Kenso moved back to the campaign's default segment. 0 unless the reset covers segmentation. |
| `contactsReset` | integer (int32) | Contacts a reset for chosen contacts cleared. Omitted on a campaign-wide reset. |
| `contactsSkipped` | array of AiRunResetSkippedContact | Listed contacts that a reset for chosen contacts left untouched, with the reason. Omitted on a campaign-wide reset. |

### Request

```bash
curl -X POST "https://api.ken.so/v1/campaigns/812/ai-runs/reset" \
  -H "Authorization: Bearer $KENSO_API_KEY" \
  -H "Ken-Version: 2026-11-02" \
  -H "X-Ken-Workspace-Id: $KENSO_WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
  "flow": "qualification"
}'
```

### Example response

```json
{
  "success": true,
  "data": {
    "flows": [
      "string"
    ],
    "batchesCancelled": 1,
    "runsCancelled": 1,
    "aiResponseLinesDeleted": 1,
    "aiResponsesDeleted": 1,
    "outreachStatusesRemoved": 1,
    "qualificationResponsesDeleted": 1,
    "segmentationReasoningDeleted": 1,
    "contactsQualificationReset": 1,
    "contactsSegmentReset": 1,
    "contactsReset": 1,
    "contactsSkipped": [
      {
        "contactId": 812,
        "reason": "string"
      }
    ]
  }
}
```

## Reset an AI flow for chosen contacts

`POST /v1/campaigns/{campaignId}/ai-runs/reset-contacts` - operationId `ai-runs.reset-contacts`

| Permission | Rate limit |
| --- | --- |
| Campaigns edit | 4,800 requests a minute per API key |

Clears the listed contacts' personalization or rewriting output, so the next AI run writes their lines again. Kenso
skips a contact that is not in the campaign, was already sent or exported, has a send queued or is in an unfinished
AI batch, and lists it in `contactsSkipped`. It uses no reset quota.

Errors:

- `400 validation_failed`: `flow` or `contactIds` is not valid.
- `404 not_found`: the campaign is not in this workspace.

Requires Campaigns edit.

[Try it on developer.ken.so](https://developer.ken.so/reference/#kenso-api/tag/ai-runs/POST/v1/campaigns/%7BcampaignId%7D/ai-runs/reset-contacts)

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `campaignId` | path | integer (int64) | yes | The contacts' campaign. |
| `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`. |

### Request body

`application/json`, optional.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `flow` | string | yes | The flow to reset: `personalization` (its rewritten lines too) or `rewriting`. Required. |
| `contactIds` | array of integer (int64) | yes | The contacts to reset, 1 to 500 contact ids of the campaign. Required. |

### Response 200

`data` is a `AiRunReset`.

| Field | Type | Description |
| --- | --- | --- |
| `flows` | array of string | The flows Kenso reset, listed from `rewriting` back to the requested flow. |
| `batchesCancelled` | integer (int32) | The campaign's AI batches in progress that Kenso cancelled. Always 0 on a reset for chosen contacts. |
| `runsCancelled` | integer (int32) | Provider fallback chains Kenso cancelled. Always 0 on a reset for chosen contacts. |
| `aiResponseLinesDeleted` | integer (int32) | AI lines Kenso deleted. |
| `aiResponsesDeleted` | integer (int32) | AI responses Kenso deleted. A response is one AI answer and holds the lines in `aiResponseLinesDeleted`. |
| `outreachStatusesRemoved` | integer (int32) | Contact progress marks for the reset flows that Kenso removed, so those contacts are eligible again. |
| `qualificationResponsesDeleted` | integer (int32) | Stored qualification answers Kenso deleted. 0 unless the reset covers qualification. |
| `segmentationReasoningDeleted` | integer (int32) | Stored segmentation reasons Kenso deleted. 0 unless the reset covers segmentation. |
| `contactsQualificationReset` | integer (int32) | Contacts whose qualification result Kenso cleared. 0 unless the reset covers qualification. |
| `contactsSegmentReset` | integer (int32) | Contacts Kenso moved back to the campaign's default segment. 0 unless the reset covers segmentation. |
| `contactsReset` | integer (int32) | Contacts a reset for chosen contacts cleared. Omitted on a campaign-wide reset. |
| `contactsSkipped` | array of AiRunResetSkippedContact | Listed contacts that a reset for chosen contacts left untouched, with the reason. Omitted on a campaign-wide reset. |

### Request

```bash
curl -X POST "https://api.ken.so/v1/campaigns/812/ai-runs/reset-contacts" \
  -H "Authorization: Bearer $KENSO_API_KEY" \
  -H "Ken-Version: 2026-11-02" \
  -H "X-Ken-Workspace-Id: $KENSO_WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
  "flow": "string",
  "contactIds": [
    812
  ]
}'
```

### Example response

```json
{
  "success": true,
  "data": {
    "flows": [
      "string"
    ],
    "batchesCancelled": 1,
    "runsCancelled": 1,
    "aiResponseLinesDeleted": 1,
    "aiResponsesDeleted": 1,
    "outreachStatusesRemoved": 1,
    "qualificationResponsesDeleted": 1,
    "segmentationReasoningDeleted": 1,
    "contactsQualificationReset": 1,
    "contactsSegmentReset": 1,
    "contactsReset": 1,
    "contactsSkipped": [
      {
        "contactId": 812,
        "reason": "string"
      }
    ]
  }
}
```

## Types

Each named type the tables above use, nested ones included.

### AiRunFlowEligibility

How many contacts one flow would process now.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `flow` | string | no | The flow: `qualification`, `personalization`, `rewriting` or `segmentation`. |
| `eligibleCount` | integer (int32) | no | Contacts the flow would process if a run started now, only those in `segmentId` when it is set. |
| `blockingGate` | string | no | The check that left no contact eligible, a snake_case code such as `campaign_processing_state`. New codes can appear. Omitted when contacts are eligible. |
| `blockingReason` | string | no | Why no contact is eligible and what to change, for a person to read. Omitted with `blockingGate`. |

### AiRunInvalidationPreview

What a reset of a flow, or a new prompt for it, would clear across the campaign.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `flow` | string | no | The flow the preview starts from. |
| `preview` | string | no | The preview you asked for: `reset` or `freshness`. |
| `hasImpact` | boolean | no | True when the change would clear any stored output. `segmentationAssignmentsKept` does not count. |
| `cascadeFlows` | array of string | no | The flows the change clears, from `rewriting` back to the requested flow. |
| `campaignStatus` | string | no | The campaign's status now: `draft`, `building`, `ready`, `sending`, `paused`, `completed`, `error` or `archived`. |
| `sendingStatus` | string | no | The campaign's sending status now: `not_started`, `scheduled`, `sending`, `paused`, `completed`, `error`, `launching` or `archived`. |
| `emailsSent` | integer (int32) | no | Emails the campaign has sent so far. |
| `message` | string | no | A summary for a person: the flows the change clears and, for a campaign that sent, the emails already sent. |
| `impact` | AiRunInvalidationImpact | no | The counts the change would clear. |

### AiRunInvalidationImpact

What a previewed reset or prompt change would clear, by kind of output.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `qualificationResponses` | integer (int32) | no | Stored qualification answers that would be deleted. |
| `qualifiedFlags` | integer (int32) | no | Contacts marked qualified that would lose the mark. |
| `segmentationReasoning` | integer (int32) | no | Stored segmentation reasons that would be deleted. Only the `reset` preview counts them. |
| `segmentationAssignmentsKept` | integer (int32) | no | Contacts on a segment that keep it. Only the `freshness` preview counts them. |
| `segmentationAssignmentsReset` | integer (int32) | no | Contacts that would move back to the default segment. Only the `reset` preview counts them. |
| `personalizationLines` | integer (int32) | no | Personalized lines that would be deleted. |
| `personalizationLeads` | integer (int32) | no | Contacts whose personalized lines would be deleted. |
| `rewritingLines` | integer (int32) | no | Rewritten lines that would be deleted. |
| `rewritingLeads` | integer (int32) | no | Contacts whose rewritten lines would be deleted. |

### AiRunResetSkippedContact

A contact a reset for chosen contacts left untouched.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `contactId` | integer (int64) | no | The contact id from the request. |
| `reason` | string | no | Why Kenso skipped it: `not_in_campaign`, `sent_or_exported` (already emailed or exported), `queued_to_send` (a send is queued) or `in_flight` (it is in an AI batch that has not finished). |

All resources: [/docs.md](/docs.md).
