Skip to main content
POST
/
test_framework
/
v1
/
scenarios
/
create_scenario_from_transcript
cURL
curl --request POST \
  --url https://api.cekura.ai/test_framework/v1/scenarios/create_scenario_from_transcript/ \
  --header 'Content-Type: application/json' \
  --header 'X-CEKURA-API-KEY: <api-key>' \
  --data '
{
  "transcript_json": [
    {
      "role": "Main Agent",
      "content": "<string>",
      "end_time": 123,
      "start_time": 123,
      "data": {
        "id": "<string>",
        "name": "<string>",
        "arguments": null,
        "result": null
      }
    }
  ],
  "personality": 123,
  "agent": 123,
  "assistant_id": "<string>",
  "name": "<string>",
  "expected_outcome_prompt": "<string>"
}
'
{
  "name": "<string>",
  "instructions": "<string>",
  "agent": 123,
  "id": 123,
  "personality": 123,
  "personality_name": "<string>",
  "agent_name": "<string>",
  "phone_number": "<string>",
  "expected_outcome_prompt": "<string>",
  "scenario_language": "af",
  "scenario_type": "instruction",
  "tags": "<unknown>",
  "inbound_phone_number": 123,
  "inbound_phone_number_data": "<string>",
  "metrics": "<string>",
  "metric_names": "<string>",
  "first_message": "Hello",
  "tool_ids": "<unknown>",
  "test_profile": 123,
  "test_profile_data": {
    "name": "<string>",
    "id": 123,
    "project": 123,
    "agent": 123,
    "information": {}
  },
  "dynamic_variable_values": "<unknown>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "created_by": 123,
  "last_updated_by": 123,
  "folder_path": "<string>"
}

Authorizations

X-CEKURA-API-KEY
string
header
required

API Key Authentication. It should be included in the header of each request.

Body

transcript_json
object[]
required

JSON representation of the conversation transcript

personality
integer

ID of the personality to use in the simulation

agent
integer

ID of the agent to use in the simulation

assistant_id
string

Assistant ID to use in the simulation

name
string

Name for the simulated scenario

expected_outcome_prompt
string

Prompt describing the expected outcome of the scenario

Response

name
string
required

Name of the scenario

Maximum string length: 80
instructions
string
required

Scenario Instructions - format depends on scenario_type:

For scenario_type="instruction": Plain text instructions describing 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": JSON-formatted string (stringified) with role and conditions:

{
  "role": "A friendly customer calling about an appointment",
  "conditions": [
    {
      "id": 0,
      "condition": "FIRST_MESSAGE",
      "action": "Hi there, I need to check on my appointment <break time=\"1.5s\" /> [laughter]",
      "type": "standard",
      "fixed_message": true
    },
    {
      "id": 1,
      "condition": "contains \"appointment\" OR contains \"schedule\" OR contains \"help\"",
      "action": "Yes, I have an appointment scheduled for tomorrow [laughter] [laughter]",
      "type": "standard",
      "fixed_message": true
    },
    {
      "id": 2,
      "condition": "contains \"confirm\" OR contains \"thank\" OR contains \"anything else\"",
      "action": "No that's all, thank you so much <break time=\"1.0s\" /> [laughter]",
      "type": "standard",
      "fixed_message": true
    },
    {
      "id": 3,
      "condition": 2,
      "action": "<endcall />",
      "type": "action_followup",
      "fixed_message": true
    }
  ]
}

Structure:

  • role: Personality/role description
  • conditions: Array with id (0,1,2...), condition (FIRST_MESSAGE | contains operators with OR/AND | condition id reference), action (text with SSML <break time="1.5s" /> and markers [laughter] or <endcall />), type (standard | action_followup), fixed_message (boolean)
agent
integer
required

Foreign key reference to the AI agent that owns this scenario

id
integer

Unique identifier for the AI agent Example: 123

personality
integer | null

Foreign key reference to the personality used in this scenario

personality_name
string

Name of the personality used in this scenario Example: "Normal Male"

agent_name
string

Name of the agent associated with this scenario Example: "Customer Support Agent"

phone_number
string
expected_outcome_prompt
string

Expected outcome prompt for the scenario Example: "The user should be able to complete the order"

scenario_language
enum<string> | null

Language code for the scenario (ISO language code)

  • 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
  • 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
  • ta - Tamil
  • te - Telugu
  • uk - Ukrainian
  • vi - Vietnamese
Available options:
af,
ar,
bn,
bg,
zh,
cs,
da,
nl,
en,
et,
fi,
fr,
de,
el,
gu,
hi,
he,
hu,
id,
it,
ja,
kn,
ko,
ms,
ml,
mr,
multi,
no,
pl,
pa,
pt,
ro,
ru,
sk,
es,
sv,
th,
tr,
ta,
te,
uk,
vi,
null
scenario_type
enum<string>
default:instruction

Type of scenario:

  • instruction: Standard instruction-based scenario where instructions field contains plain text
  • conditional_actions: Conditional action-based scenario where instructions field contains JSON
  • real_world_smart: Real world smart scenario
  • real_world_fixed: Real world fixed scenario
  • instruction - Instruction
  • real_world_smart - Real World Smart
  • real_world_fixed - Real World Fixed
  • conditional_actions - Conditional Actions
Available options:
instruction,
real_world_smart,
real_world_fixed,
conditional_actions
tags
any

List of tags associated with this scenario for categorization Example: ["tag1", "tag2", "tag3"]

inbound_phone_number
integer | null

(Deprecated) Foreign key reference to the phone number. Use phone_number field instead. This field is maintained for backward compatibility and will be automatically synced with phone_number.

inbound_phone_number_data
string

Details of the phone number used for inbound calls

metrics
string

List of metrics associated with this scenario for evaluation

metric_names
string

List of metric names associated with this scenario Example: ["Metric 1", "Metric 2", "Metric 3"]

first_message
string
default:Hello

The initial message that the AI agent will send when the scenario starts

Maximum string length: 1000
tool_ids
any

List of tool IDs that are available for use in this scenario Example: ["TOOL_DTML", "TOOL_END_CALL"]

test_profile
integer | null

Test profile ID Example: 123

test_profile_data
object

Details of the test profile associated with this scenario Example:

{
    "id": "<integer>",
    "agent": "<integer>",
    "name": "<string>",
    "information": {
        "user_name": "John Doe",
        "user_email": "john.doe@example.com",
    }
}
dynamic_variable_values
any | null

Generated values for the agent's dynamic variables for this scenario. Keys are variable names; values are the generated values.

created_at
string<date-time>

Timestamp when the scenario was created

updated_at
string<date-time>

Timestamp when the scenario was last updated

created_by
integer

ID of the user who created this scenario

last_updated_by
integer

ID of the user who last updated this scenario

folder_path
string · null · null

Path of the folder this scenario belongs to