Update an evaluator
Changed onPartially update an evaluator. Same field shape as create — see scenarios_create for details.
If you set or edit expected_outcome_prompt: it is evaluated only when the project's Expected Outcome metric is attached to the scenario — check its metrics and attach that metric if missing.
Tip: to add or modify a single condition inside a conditional_actions scenario, fetch the scenario with GET, parse its instructions (the same object as conditional_actions), edit it, and PATCH the full object back as conditional_actions. The server replaces all conditions atomically.
Request
- Base URLhttps://api.cekura.ai
- URLhttps://api.cekura.ai/test_framework/v2/scenarios/{id}/
- Auth
- API key in header X-CEKURA-API-KEY
- or HTTP bearer
- or HTTP bearer
Path parameters
A unique integer value identifying this scenario.
Request body
ID of the agent. Either agent or project must be provided.
ID of the project. Either agent or project must be provided.
Alternative to agent ID - the assistant ID to use for this scenario Example: "asst_1234567890"
Name of the evaluator
The personality of the evaluator
Type of scenario to create:
- instruction: Standard instruction-based scenario where the instructions field contains plain text
- conditional_actions: Conditional action-based scenario where the instructions field contains a JSON structure
Default: instruction. Must be sent as conditional_actions when the request includes the conditional_actions field.
- instruction - Instruction
- conditional_actions - Conditional Actions
Scenario Instructions - the format depends on the scenario_type:
For scenario_type="instruction": Provide plain text instructions that describe the scenario behavior. Example: "You are a customer calling to inquire about your order status. Be polite and provide order number 12345 when asked."
For scenario_type="conditional_actions": Use the structured conditional_actions field instead. If you send via instructions, pass a JSON-formatted string with the following structure:
{
"role": "A friendly customer calling about an appointment",
"first_message": "Hi, I'd like to check on my upcoming appointment <silence time=\"1.5s\" />",
"conditions": [
{"when": "The agent asks for your name", "say": "My name is Sarah Johnson"},
{"when": "The agent asks for your date of birth", "say": "January first, nineteen ninety"},
{
"when": "The agent confirms your identity and provides appointment details",
"say": "Thank you, that's all I needed <silence time=\"1.0s\" />",
"then": ["<endcall />"]
}
]
}
Note: When sent via instructions, the value must be a JSON-formatted string (e.g. JSON.stringify(...) / json.dumps(...)). For new integrations, use the structured conditional_actions field below. Responses return instructions in this same shape.
Structure Details:
-
role (string): Personality/role description for the scenario actor
-
first_message (string | object): What the scenario actor says first, always verbatim. Empty means wait for the agent to speak. Use {"say": "...", "then": [...]} to add follow-up steps after it.
-
conditions (array): Ordered list of conditions that define the conversation flow
Each condition object has:
-
when (string): Natural-language description of the main agent's observable action, written from a third-person observer perspective (e.g. "The agent asks for your date of birth", "The agent confirms the cancellation"). Matched semantically against the conversation context.
-
say (string): What the scenario actor says or does, spoken verbatim. Wrap the whole step in <ai_generated>...</ai_generated> to have the actor improvise from it instead.
- SSML pause tags: <silence time="1.5s" /> (interruptible) or <hold time="2s" /> (not interruptible). <silence> lets the main agent jump in mid-pause; <hold> enforces dead air.
- Emotion markers: [laughter], [sigh], etc. (can repeat like [laughter] [laughter])
- Special actions: <endcall /> to end the call
- Action tags only work in verbatim steps, not inside <ai_generated>.
-
then (array of strings, optional): Follow-up steps in order. Each fires on the actor's next turn after one main-agent reply, regardless of its content. <interruption> is only allowed here.
-
Usage Tips:
- Write when as third-person descriptions of what the main agent does (e.g. "The agent confirms the cancellation")
- End with an <endcall /> step for clean call termination
- Combine SSML tags and emotion markers naturally: "Great <silence time=\"1.5s\" /> [laughter] [laughter]"
Expected Outcome Prompt Example: "The user should be able to complete the order"
List of metric IDs to associate with this evaluator Example: [123, 456, 789]
List of tags to associate with the evaluator Example: ["tag1", "tag2", "tag3"]
List of tool IDs to use for evaluator
The test profile ID to use for the evaluator
The phone number ID to use for the evaluator (works for both inbound and outbound)
(Deprecated) The inbound phone number ID to use for the evaluator. Use phone_number instead, which works for both inbound and outbound.
Dot-separated path of the folder to assign this evaluator to (e.g. "Sales.Inbound"). Folders must be created before use — they are not auto-created. Use scenarios_create_folder_create to create each level before assigning evaluators. Example: to use "Sales.Inbound", first create "Sales", then create "Inbound" inside it.
Opening line the simulated caller says to the agent. Defaults to "Hello".
Max call duration in seconds for this scenario. If not provided or set to null, the scenario will use the project's max_call_duration setting. Valid range: 10-3600 seconds (10 seconds to 60 minutes) Example: 600 (10 minutes)
Language of the evaluator. Must match the chosen personality's language — mismatches are rejected.
- af - Afrikaans
- ar - Arabic
- bn - Bengali
- bg - Bulgarian
- zh - Chinese Simplified
- cs - Czech
- da - Danish
- nl - Dutch
- en - English
- et - Estonian
- fi - Finnish
- fr - French
- de - German
- el - Greek
- gu - Gujarati
- hi - Hindi
- he - Hebrew
- hu - Hungarian
- id - Indonesian
- it - Italian
- ja - Japanese
- kn - Kannada
- kk - Kazakh
- ko - Korean
- ms - Malay
- ml - Malayalam
- mr - Marathi
- multi - Multilingual
- no - Norwegian
- pl - Polish
- pa - Punjabi
- pt - Portuguese
- ro - Romanian
- ru - Russian
- sk - Slovak
- es - Spanish
- sv - Swedish
- th - Thai
- tr - Turkish
- tl - Tagalog
- ta - Tamil
- te - Telugu
- uk - Ukrainian
- uz - Uzbek
- vi - Vietnamese
Example request
{
"tool_ids": [
"TOOL_DTMF",
"TOOL_END_CALL",
"TOOL_END_CALL_ONLY_ON_TRANSFER"
]
}Response
Name of the evaluator
Agent ID Example: 2142
Alternative to agent ID - the assistant ID to use for this scenario Example: "asst_1234567890"
ID of the personality
Name of the personality
Name of the agent associated with this scenario Example: "Customer Support Agent"
List of tags of the evaluators Example: ["tag1", "tag2", "tag3"]
List of metric IDs Example: [123, 456, 789]
List of metric names Example: ["Metric 1", "Metric 2", "Metric 3"]
Phone number eg: +17776666333
First message of the evaluator
Scenario Instructions - format depends on scenario_type:
- For instruction type: Plain text instructions
- For conditional_actions type: JSON string with role, first_message and a conditions array. Each condition has when (a natural-language third-person description of the main agent's observable action — e.g. "The agent asks for your date of birth", matched semantically), say (spoken verbatim, with optional <silence time="1.5s" /> (interruptible) or <hold time="2s" /> (not interruptible) and [laughter] tags; wrap the whole step in <ai_generated>...</ai_generated> to improvise instead) and optional then follow-up steps. Responses return this format unless conditional_actions_format=legacy is passed. The earlier id-based format (id, condition, action, type, fixed_message) is still accepted on writes.
Pre-recorded clips available to this scenario's conditional actions, keyed by clip id. Read-only: upload, replace and delete clips, and correct a transcript, through condition-audio/. Reference a clip from any number of verbatim steps by pasting its tag; steps lists where it is used (e.g. conditions[1].then[0]).
Example:
{
"greeting": {"tag": "<audio id=\"greeting\"/>", "filename": "greeting.wav",
"status": "ready", "duration": 2.4, "transcript": "Hi, is this the clinic?",
"steps": ["first_message", "conditions[1]"]}
}
Information fields of the evaluator Example:
{
"user_name": "John Doe",
"user_email": "john.doe@example.com",
}
Expected outcome prompt of the evaluator Example: "The user should be able to complete the order"
Language of the scenario
- af - Afrikaans
- ar - Arabic
- bn - Bengali
- bg - Bulgarian
- zh - Chinese Simplified
- cs - Czech
- da - Danish
- nl - Dutch
- en - English
- et - Estonian
- fi - Finnish
- fr - French
- de - German
- el - Greek
- gu - Gujarati
- hi - Hindi
- he - Hebrew
- hu - Hungarian
- id - Indonesian
- it - Italian
- ja - Japanese
- kn - Kannada
- kk - Kazakh
- ko - Korean
- ms - Malay
- ml - Malayalam
- mr - Marathi
- multi - Multilingual
- no - Norwegian
- pl - Polish
- pa - Punjabi
- pt - Portuguese
- ro - Romanian
- ru - Russian
- sk - Slovak
- es - Spanish
- sv - Swedish
- th - Thai
- tr - Turkish
- tl - Tagalog
- ta - Tamil
- te - Telugu
- uk - Ukrainian
- uz - Uzbek
- vi - Vietnamese
Type of scenario:
- instruction: Standard instruction-based scenario (plain text instructions)
- conditional_actions: Conditional action-based scenario (JSON with role, conditions, SSML tags, emotion markers)
Type of predefined suite (e.g., infrastructure)
- undefined - Undefined
- infrastructure - Infrastructure
Whether this is a predefined scenario (template)
Path of an existing folder to assign this evaluator to, e.g. "Sales" or "Sales.Inbound". Create it first with the create-folder endpoint.
Max call duration in seconds for this scenario. If not provided or set to null, the scenario will use the project's max_call_duration setting. Valid range: 10-3600 seconds (10 seconds to 60 minutes) Example: 600 (10 minutes)
Changes
- info
endpoint added
- info