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

# Agent work: Claim agent work

> **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 [Agent work](/docs/api/agent-work.md). Authentication, workspaces and errors: [/docs.md](/docs.md).

## Claim agent work

`POST /v1/agent-work/claims` - operationId `agent-work.create-claim`

| Permission | Rate limit |
| --- | --- |
| Any workspace member except a Network member | 120 requests a minute and 1,800 an hour per workspace |

Hands out up to `limit` items (1 to 50, default 10) of the first kind, in hand-out order, that waits for your
agent and that you may write: only the kinds in `kinds` when you send it, only `campaignId`'s work when you
send it. A kind on `kenso_ai`, one Kenso cannot hand out yet, or one held back (`heldBy`) is skipped. With
`scope` `live` a campaign kind hands out only the campaigns Kenso's AI works on by itself, never a Draft,
finished or errored one; `all`, the default, hands out every campaign's. One claim holds one kind, and one
campaign for a campaign kind. The claim holds its items for `leaseMinutes`
(5 to 240, default 30): Kenso's AI and other claims leave them alone until then. Each item carries its target, the
prompt Kenso's AI would have run and what the answer must look like (`answer.format` `json` or
`text`, and `answer.schema`, a JSON Schema object or null). Nothing waiting is `200` with
`id` null and no items, and stores no claim. A claim stops short of `limit` when its items would pass about
900 KB; the rest stay in the queue. Send an `Idempotency-Key` to retry safely: a resend with the same key
returns the same claim.

Errors:

- `400 validation_failed`: an unknown kind, an empty `kinds`, `limit` or `leaseMinutes` out
of range, or a `scope` other than `all` or `live`. Each problem is one `details[]` entry,
such as `kinds[1]`.
- `404 not_found`: the workspace does not have the `agent_work` feature, or the campaign is not the
workspace's.
- `429 rate_limited`: more than 120 claims a minute or 1,800 an hour for the workspace.
- `503 service_unavailable` with `Retry-After`: the agent work settings could not be read. Nothing was
handed out. Try again.

Open to any workspace member except a Client seat; hands out only the kinds the caller may write.

Needs the `agent_work` feature on your workspace. Until it is on, calls answer 404.

[Try it on developer.ken.so](https://developer.ken.so/reference/#kenso-api/tag/agent-work/POST/v1/agent-work/claims)

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `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`. |
| `Idempotency-Key` | header | string | no | A unique value, such as a UUID, that makes a retry safe. Send the same key when you retry. For 24 hours, a repeat of the same request with the same key gets the first response again, with the `Idempotent-Replayed: true` header, and Kenso does not run the action twice. The same key with a different request answers `422 idempotency_key_reused`. Keys are per workspace and at most 200 characters long. A repeat sent while the first request is still running can get `503 service_unavailable` with `Retry-After`. Retry it with the same key. Kenso does not store a `5xx` response, so a retry after one runs the action again. It does not store a `408`, a `429` or another `4xx` that carries `Retry-After` either: retry with the same key after that time and Kenso runs the action again. |

### Request body

`application/json`, optional.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `kinds` | array of string | no | The kinds to take, in any order; left out for every kind. Kinds are still handed out in hand-out order. |
| `campaignId` | integer (int64) | no | Only this campaign's work (campaign kinds). The campaign must be the workspace's. |
| `limit` | integer (int32) | no | The most items to take, 1 to 50. Default 10. |
| `leaseMinutes` | integer (int32) | no | How long the claim holds its items, in minutes, 5 to 240. Default 30. |
| `scope` | string | no | Which campaigns' work a campaign kind hands out: `all` (the default) is every campaign that is not deleted or AI-paused, a Draft, finished or errored one included; `live` is only the campaigns Kenso's AI works on by itself. Kinds outside a campaign hand out the same in both. |

### Response 200

`data` is a `AgentWorkClaim`.

| Field | Type | Description |
| --- | --- | --- |
| `id` | string | The claim id (`awc_` and 22 URL-safe characters). Null when nothing was waiting. |
| `kind` | string | The one kind this claim holds; null when nothing was waiting. |
| `campaignId` | integer (int64) | The campaign of a campaign kind's claim; null otherwise. |
| `expiresAt` | string (date-time) | When the claim lets go of its unanswered items, in UTC; null when nothing was waiting. |
| `items` | array of AgentWorkItem | The items to answer. Empty when nothing was waiting. |

### Request

```bash
curl -X POST "https://api.ken.so/v1/agent-work/claims" \
  -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 '{
  "kinds": [
    "string"
  ],
  "campaignId": 812,
  "limit": 1,
  "leaseMinutes": 1,
  "scope": "all"
}'
```

### Example response

```json
{
  "success": true,
  "data": {
    "id": "awc_2bX9kq4LmR7tW3vY",
    "kind": "string",
    "campaignId": 812,
    "expiresAt": "2026-09-23T15:02:11Z",
    "items": [
      {
        "id": "awi_2bX9kq4LmR7tW3vY",
        "kind": "string",
        "target": {
          "type": "contact",
          "id": "string",
          "campaignId": 812
        },
        "prompt": {
          "system": "string",
          "user": "string"
        },
        "answer": {
          "format": "string",
          "schema": null,
          "instruction": "string"
        }
      }
    ]
  }
}
```

## Types

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

### AgentWorkItem

One item to answer.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | no | The item id (`awi_` and 22 URL-safe characters): the `itemId` of its answer. |
| `kind` | string | no | The item's kind, the claim's kind. |
| `target` | AgentWorkTarget | no | What the answer is for. |
| `prompt` | AgentWorkPrompt | no | The prompt Kenso's AI would have run. |
| `answer` | AgentWorkAnswerFormat | no | What the answer must look like. |

### AgentWorkTarget

What an item's answer is for.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `type` | string | no | The kind of record, such as `contact` or `meeting`. |
| `id` | string | no | The record's id, as text. |
| `campaignId` | integer (int64) | no | The record's campaign, or null. |

### AgentWorkPrompt

The prompt to run.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `system` | string | no | The system prompt, or null when the kind has none. |
| `user` | string | no | The user prompt. |

### AgentWorkAnswerFormat

What an item's answer must look like.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `format` | string | no | `json` (send `output` as a JSON object) or `text` (send `output` as a string). |
| `schema` | object | no | The JSON Schema object a `json` answer follows, or null. |
| `instruction` | string | no | How to write the answer, in a sentence or two. |
