Prompt versions
The saved prompt versions of a segment, and restoring one.
Path parameters
The endpoints whose path names one of these take it as described here. An endpoint's own table lists a path parameter only when it describes it differently.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
segmentId | path | integer (int64) | required | The segment's id. |
Headers
The endpoints on this page take these headers. Each endpoint's curl shows the ones it sends.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Ken-Version | header | string, one of: 2026-11-02, 1.1 | optional | 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 date that is not a version answers 400 unsupported_version; any other value that is not a version is treated as legacy. |
X-Ken-Workspace-Id | header | integer (int64) | optional | 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. |
List a segment's prompt versions
/v1/segments/{segmentId}/prompt-versionsprompt-versions.list- Permission
- Campaigns view
- Rate limit
- 12,000 requests a minute per API key
Returns the segment's prompt versions, oldest first, one page at a time. The list leaves out each version's prompts: get a version to read them.
Errors:
400 validation_failed:limitis outside 1 to 200, orcursoris not one Kenso returned.404 not_found: the segment is not in this workspace.
Requires Campaigns view.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
limit | query | integer (int32) | optional | Number of prompt versions per page, from 1 to 200, default 50. |
cursor | query | string | optional | The nextCursor from the previous page. Omit it for the first page. |
curl -X GET "https://api.ken.so/v1/segments/812/prompt-versions?limit=50" \
-H "Authorization: Bearer $KENSO_API_KEY" \
-H "Ken-Version: 2026-11-02" \
-H "X-Ken-Workspace-Id: $KENSO_WORKSPACE_ID"Response 200
data is a list of PromptVersion. Each item has these fields. The response also carries pagination.
Show the 11 response fields and an example
The fields and an example are also on this endpoint's Markdown page.
Get a prompt version
/v1/segments/{segmentId}/prompt-versions/{versionId}prompt-versions.get- Permission
- Campaigns view
- Rate limit
- 12,000 requests a minute per API key
Returns one version of the segment's prompts, with the prompts as they were saved.
Errors:
404 not_found: the segment is not in this workspace, or the version is not one of its versions.
Requires Campaigns view.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
versionId | path | integer (int64) | required | The version's id. |
curl -X GET "https://api.ken.so/v1/segments/812/prompt-versions/812" \
-H "Authorization: Bearer $KENSO_API_KEY" \
-H "Ken-Version: 2026-11-02" \
-H "X-Ken-Workspace-Id: $KENSO_WORKSPACE_ID"Response 200
data is a PromptVersion.
Show the 11 response fields and an example
The fields and an example are also on this endpoint's Markdown page.
Restore a prompt version
/v1/segments/{segmentId}/prompt-versions/{versionId}/restoreprompt-versions.restore- Permission
- Campaigns edit
- Rate limit
- 4,800 requests a minute per API key
Replaces all of the segment's prompts with the version's prompts, and puts back the model settings saved with it. Kenso saves the result as a new version and returns its versionNumber. versionWarning is set when the prompts were restored but Kenso could not fully save the new version or the model settings.
A restore can clear AI results Kenso already made for the campaign. Send dryRun: true to see what it would clear without changing anything: hasImpact and impact describe it. Without confirm: true, a restore that would clear results stops with 409 conflict and error.impact. The body is optional.
Errors:
404 not_found: the segment is not in this workspace, or the version is not one of its versions.409 conflict: the restore would clear AI results, so sendconfirm: trueto go ahead. Or another version save is running for the segment: try again shortly.
Requires Campaigns edit.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
versionId | path | integer (int64) | required | The id of the version to restore. |
Request body
application/json, optional.
Optional: confirm and dryRun.
| Field | Type | Required | Description |
|---|---|---|---|
confirm | boolean | optional | Set to true to restore even when the restore would clear AI output already generated for the campaign. Without it, such a restore answers 409 conflict with error.impact. Defaults to false. |
dryRun | boolean | optional | Set to true to see what the restore would clear without changing anything. Defaults to false. |
curl -X POST "https://api.ken.so/v1/segments/812/prompt-versions/812/restore" \
-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 '{
"confirm": true,
"dryRun": true
}'Response 200
data is a PromptVersionRestore.
Show the 6 response fields and an example
The fields and an example are also on this endpoint's Markdown page.
More in Copy and personalization:Custom variablesAI promptsImage variablesCopy gradesCopy checksVoicesVoice notesVoice note previewsMessage templatesAll resources