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

# Threads: Replace a thread's draft

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

## Replace a thread's draft

`PUT /v1/threads/{threadId}/draft` - operationId `threads.replace-draft`

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

Saves the reply draft on a thread in place of the one there. Send `body` and, on an email thread, an
optional `subject`. An empty or missing `body` deletes the draft and returns `204` with no body.

Only a person signed in to the Kenso app writes as the draft's author, `user`. An agent (any caller that
sends the header `X-Ken-Actor: agent`) or an API key writes as `agent`, and never overwrites or deletes
a person's draft: the response is then the person's draft, unchanged.

On an email thread, a person who saves a reply Ken wrote into their composer sends `authorSource`
`agent`, and the model that wrote it in the header `X-Ken-Generator`. The draft is theirs, as their own
save is (`authorSource` stays `user`, so no agent write replaces it), and it records the text as Ken's,
so their send or discard of it is measured against that text.

On an email thread, saving or clearing a draft also stops any reply or follow-up that Ken holds for the thread, so
Ken does not send on top of it.

A Facebook thread has no draft: `404`. An iMessage thread has none either: writing one, an empty
`body` included, is `400 validation_failed` on `threadId`.

Errors:

- `400 validation_failed` on `threadId`: an iMessage thread has no drafts.
- `404 not_found`: the id is malformed, or no thread in this workspace has it.

Requires Inbox edit.

[Try it on developer.ken.so](https://developer.ken.so/reference/#kenso-api/tag/threads/PUT/v1/threads/%7BthreadId%7D/draft)

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `threadId` | path | string | yes | The thread's `thr_` 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`. |

### Request body

`application/json`, optional.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `subject` | string | no | Email only: the draft's subject. A LinkedIn thread ignores it. |
| `body` | string | no | The draft's text. Empty or omitted deletes the draft. |
| `authorSource` | string | no | Email only, optional: `agent` when a person saves a reply Ken wrote into their composer. The draft stays the person's (the response's `authorSource` is `user`) and records the text as Ken's, with the model the `X-Ken-Generator` header names. Ignored for any caller that is not a person signed in to the Kenso app, and for any other value. |

### Response 200

`data` is a `ThreadDraft`.

| Field | Type | Description |
| --- | --- | --- |
| `threadId` | string | The `thr_` id of the thread. |
| `subject` | string | Email only: the draft's subject. Null when it has none. |
| `body` | string | The draft's text. |
| `authorSource` | string | Who last wrote the draft: `user` (a person in the Kenso app) or `agent` (an agent or API key). An agent never overwrites a person's draft. |
| `mirror` | ThreadDraftMirror | When an agent wrote the reply in the contact's language: the same reply in the reader's language, as plain text. Null otherwise. A person's save that changes the body clears it. |
| `updatedAt` | string (date-time) | When the draft last changed, in UTC. |
| `agentJobId` | integer (int64) | Email only: the reply-agent job this draft came from, rated as `reply_job:{agentJobId}`. Omitted for a draft a person wrote. |
| `gapId` | integer (int64) | Email only: the open question Ken needs answered for this draft, whose body holds a {gap} blank. Omitted otherwise. |
| `gapQuestion` | string | The question of `gapId`, as Ken asked it. Omitted with `gapId`. |

### Request

```bash
curl -X PUT "https://api.ken.so/v1/threads/thr_ZW1haWw6NDAyMjg0LjFAZXhhbXBsZS5jb20/draft" \
  -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 '{
  "subject": "Re: Onboarding new engineers at Northwind Labs",
  "body": "<p>Hi Amanda,</p><p>Thursday works. Does 2pm Central suit you? I will send an invite.</p><p>Alex</p>"
}'
```

### Example response

```json
{
  "success": true,
  "data": {
    "threadId": "thr_ZW1haWw6NDAyMjg0LjFAZXhhbXBsZS5jb20",
    "subject": "Re: Onboarding new engineers at Northwind Labs",
    "body": "<p>Hi Amanda,</p><p>Thursday works. Does 2pm Central suit you? I will send an invite.</p><p>Alex</p>",
    "authorSource": "agent",
    "updatedAt": "2026-10-13T16:25:40Z"
  }
}
```

## Types

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

### ThreadDraftMirror

A draft in the reader's language.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `text` | string | no | The reply as plain text with line breaks. |
| `language` | string | no | The ISO 639-1 code of `text`, such as `en`. |
