For AI agents and LLMs: a machine-readable index is available at llms.txt. A plain-Markdown version of any documentation page is available by appending .md to its URL.
Skip to main content
Chat TestingCreate Chat Scenario
TestMu AI
StatusCommunityBlog
Chat Testing

Create Chat Scenario

Add a custom scenario to a chat workflow (Add your own scenario).

POST
/api/workflows/{workflow_id}/scenarios/create
Create Chat Scenario
curl --request POST \
--url "https://agent-testing.lambdatest.com/api/workflows/{workflow_id}/scenarios/create" \
--header "Authorization: Basic <encoded-value>" \
--header "Content-Type: application/json" \
--data '{
"project_id": "<project_id>",
"title": "<title>",
"description": "<description>",
"persona": "<persona>",
"special_instructions": "<special_instructions>",
"expected_outcomes": [],
"test_profile_id": "<test_profile_id>",
"language": "<language>",
"interaction_mode": "<interaction_mode>",
"first_message": "<first_message>",
"image_names": []
}'
{
"success": true,
"message": "<string>",
"created_scenario": {}
}

Authorizations

Authorizationstringheaderrequired

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Path Parameters

workflow_idstringrequired

Body

application/json
project_idstringrequired

Project ID associated with the workflow

titlestringrequired

Scenario title/name

descriptionstringrequired

Scenario description (conversation flow and expected behavior)

personastring

Persona for this scenario (e.g. from personas list). Defaults to 'Adaptable Communicator' if omitted.

special_instructionsstring

Optional special instructions to include in the scenario

expected_outcomesarray

User-provided validation criteria. If omitted, auto-generated via LLM.

test_profile_idstring

Test profile ID to associate with this scenario

languagestring

Language for this scenario (e.g., 'Spanish'). If None, defaults to English.

interaction_modestring

Interaction mode: 'questioner' (test agent leads) or 'responder' (target bot leads). Defaults to 'questioner'.

first_messagestring

Optional custom first message to start the conversation. When set, this exact text is used as the opening message. If not set, the agent auto-generates an appropriate opener.

image_namesarray

Test image names (org image library) the agent may attach during this scenario. Overrides the test profile's 'attached_images' list when set.

Response

application/json

Successful Response

successbooleanrequired

Whether the operation was successful

messagestringrequired

Response message

created_scenarioobjectrequired

The created scenario (same shape as items in get test scenarios)

Create Chat Scenario
curl --request POST \
--url "https://agent-testing.lambdatest.com/api/workflows/{workflow_id}/scenarios/create" \
--header "Authorization: Basic <encoded-value>" \
--header "Content-Type: application/json" \
--data '{
"project_id": "<project_id>",
"title": "<title>",
"description": "<description>",
"persona": "<persona>",
"special_instructions": "<special_instructions>",
"expected_outcomes": [],
"test_profile_id": "<test_profile_id>",
"language": "<language>",
"interaction_mode": "<interaction_mode>",
"first_message": "<first_message>",
"image_names": []
}'
{
"success": true,
"message": "<string>",
"created_scenario": {}
}