Prompts
Prompts for AI columns and personalization: create, edit, delete and test them.
Ordered by id. Optional campaignId, segmentId, and flow narrow the page. q matches the name. Requires ReadAccess.
Parameters
400 workspace_required).Response 200
data is a list of PromptModel. Each item has these fields. The response also carries pagination.
curl -X GET "https://api.ken.so/v1/prompts" \ -H "Authorization: Bearer $KEN_API_KEY" \ -H "Ken-Version: 2026-11-02" \ -H "X-Ken-Workspace-Id: $KEN_WORKSPACE_ID"
{
"success": true,
"data": [
{
"id": 812,
"name": "string",
"prompt": "string",
"audienceDescription": "string",
"qualificationCriteria": "string",
"disqualificationCriteria": "string",
"scoringCriteria": "string",
"type": "string",
"flow": "string",
"campaignId": 812,
"segmentId": 812,
"segmentName": "string",
"promptTemplateId": 812,
"toOutput": true,
"toRewrite": 1,
"order": 1,
"fallbackIfEmpty": "string",
"isRequiredForSending": true,
"createdAt": "2026-09-23T15:02:11Z",
"updatedAt": "2026-09-23T15:02:11Z"
}
],
"pagination": {
"nextCursor": "eyJpZCI6ODE1fQ",
"hasMore": true,
"total": 1,
"isTotalCapped": true
}
}Returns 201 and Location. campaignId or segmentId is required so the prompt stays in the workspace. confirm=true is required when the write would refresh cached AI results. Requires WriteAccess.
Parameters
400 workspace_required).Request body
application/json, optional.
Response 201
data is a PromptModel.
curl -X POST "https://api.ken.so/v1/prompts" \
-H "Authorization: Bearer $KEN_API_KEY" \
-H "Ken-Version: 2026-11-02" \
-H "X-Ken-Workspace-Id: $KEN_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"prompt": "string",
"audienceDescription": "string",
"qualificationCriteria": "string",
"disqualificationCriteria": "string",
"scoringCriteria": "string",
"type": "string",
"flow": "string",
"campaignId": 812,
"segmentId": 812,
"promptTemplateId": 812,
"toOutput": true,
"toRewrite": 1,
"order": 1,
"fallbackIfEmpty": "string",
"isRequiredForSending": true
}'{
"success": true,
"data": {
"id": 812,
"name": "string",
"prompt": "string",
"audienceDescription": "string",
"qualificationCriteria": "string",
"disqualificationCriteria": "string",
"scoringCriteria": "string",
"type": "string",
"flow": "string",
"campaignId": 812,
"segmentId": 812,
"segmentName": "string",
"promptTemplateId": 812,
"toOutput": true,
"toRewrite": 1,
"order": 1,
"fallbackIfEmpty": "string",
"isRequiredForSending": true,
"createdAt": "2026-09-23T15:02:11Z",
"updatedAt": "2026-09-23T15:02:11Z"
}
}Return one prompt in the current workspace
/v1/prompts/{promptId}prompts.getA missing or cross-workspace id is not_found. Requires ReadAccess.
Parameters
400 workspace_required).Response 200
data is a PromptModel.
curl -X GET "https://api.ken.so/v1/prompts/812" \ -H "Authorization: Bearer $KEN_API_KEY" \ -H "Ken-Version: 2026-11-02" \ -H "X-Ken-Workspace-Id: $KEN_WORKSPACE_ID"
{
"success": true,
"data": {
"id": 812,
"name": "string",
"prompt": "string",
"audienceDescription": "string",
"qualificationCriteria": "string",
"disqualificationCriteria": "string",
"scoringCriteria": "string",
"type": "string",
"flow": "string",
"campaignId": 812,
"segmentId": 812,
"segmentName": "string",
"promptTemplateId": 812,
"toOutput": true,
"toRewrite": 1,
"order": 1,
"fallbackIfEmpty": "string",
"isRequiredForSending": true,
"createdAt": "2026-09-23T15:02:11Z",
"updatedAt": "2026-09-23T15:02:11Z"
}
}Absent fields stay unchanged. JSON null clears a text field or promptTemplateId. segmentId cannot change on this route, and campaignId cannot be cleared on a prompt without a segment (400: it would belong to no workspace). confirm=true is required when the write would refresh cached AI results. Requires WriteAccess.
Parameters
400 workspace_required).Request body
application/json, optional: object.
Response 200
data is a PromptModel.
curl -X PATCH "https://api.ken.so/v1/prompts/812" \
-H "Authorization: Bearer $KEN_API_KEY" \
-H "Ken-Version: 2026-11-02" \
-H "X-Ken-Workspace-Id: $KEN_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{}'{
"success": true,
"data": {
"id": 812,
"name": "string",
"prompt": "string",
"audienceDescription": "string",
"qualificationCriteria": "string",
"disqualificationCriteria": "string",
"scoringCriteria": "string",
"type": "string",
"flow": "string",
"campaignId": 812,
"segmentId": 812,
"segmentName": "string",
"promptTemplateId": 812,
"toOutput": true,
"toRewrite": 1,
"order": 1,
"fallbackIfEmpty": "string",
"isRequiredForSending": true,
"createdAt": "2026-09-23T15:02:11Z",
"updatedAt": "2026-09-23T15:02:11Z"
}
}Returns 204. confirm=true is required when deletion would refresh cached AI results. Requires WriteAccess.
Parameters
400 workspace_required).Response 204
curl -X DELETE "https://api.ken.so/v1/prompts/812" \ -H "Authorization: Bearer $KEN_API_KEY" \ -H "Ken-Version: 2026-11-02" \ -H "X-Ken-Workspace-Id: $KEN_WORKSPACE_ID"
HTTP/1.1 204 No Content
Run a prompt test against live model calls
/v1/prompts/testprompts.testSamples contacts in the campaign and runs the requested flow. This spends model usage. A missing campaign is not_found. Requires PromptTestAccess.
Parameters
400 workspace_required).Request body
application/json, optional.
Response 200
data is a PromptTestResultModel.
curl -X POST "https://api.ken.so/v1/prompts/test" \
-H "Authorization: Bearer $KEN_API_KEY" \
-H "Ken-Version: 2026-11-02" \
-H "X-Ken-Workspace-Id: $KEN_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"campaignId": 812,
"flow": "string",
"sampleSize": 1,
"segmentId": 812,
"modelOverrides": {
"key": {
"model": "string",
"maxTokens": 1,
"temperature": 0.5,
"reasoningLevel": "string"
}
},
"excludeContactIds": [
812
]
}'{
"success": true,
"data": {
"campaignId": 812,
"flow": "string",
"requestedSampleSize": 1,
"returnedSampleSize": 1,
"segmentId": 812,
"provider": "string",
"model": "string",
"cacheStrategy": "string",
"successCount": 1,
"failureCount": 1,
"usageSummary": {
"averageInputTokens": 1,
"averageCacheReadTokens": 1,
"averageOutputTokens": 1,
"totalEstimatedCostUsd": 0.5,
"averageEstimatedCostUsd": 0.5
},
"samples": [
{
"contactId": 812,
"fullName": "string",
"linkedInUrl": "https://example.com",
"title": "string",
"companyName": "string",
"segmentId": 812,
"segmentName": "string",
"success": true,
"provider": "string",
"model": "string",
"cacheStrategy": "string",
"rewritingProvider": "string",
"rewritingModel": "string",
"rewritingCacheStrategy": "string",
"usage": {
"inputTokens": 1,
"outputTokens": 1,
"totalTokens": 1,
"cacheCreationTokens": 1,
"cacheReadTokens": 1,
"reasoningTokens": 1
},
"estimatedCostUsd": 0.5,
"errorMessage": "string",
"isQualified": true,
"qualificationResponse": "string",
"matchedSegmentName": "string",
"segmentationReasoning": "string",
"personalizationOutputs": [
{
"name": "string",
"value": "string"
}
],
"rewritingOutputs": [
{
"name": "string",
"value": "string"
}
],
"finalOutputs": [
{
"name": "string",
"value": "string"
}
]
}
]
}
}