Clone Scenario
Create a copy of an existing scenario.
Clone Scenario
Duplicates a scenario including its prompt, persona links, agent links, scorecard, tags, and prompt variables. The clone receives a new ID and an optional new name.
Endpoint
POST /api/v1/scenarios/:id/clone
curl -X POST "https://api.chanl.ai/api/v1/scenarios/scenario_abc123/clone" \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{
"name": "Billing Dispute Resolution (copy)"
}'const response = await fetch('https://api.chanl.ai/api/v1/scenarios/scenario_abc123/clone', {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Billing Dispute Resolution (copy)',
}),
});
const data = await response.json();import requests
response = requests.post(
'https://api.chanl.ai/api/v1/scenarios/scenario_abc123/clone',
headers={'Authorization': f'Bearer {access_token}'},
json={
'name': 'Billing Dispute Resolution (copy)',
},
)
data = response.json()Path Parameters
idstringrequiredThe ID of the scenario to clone (e.g., scenario_abc123).
Parameters
namestringName for the cloned scenario. Defaults to the original name with (copy) appended.
Response
Response
{
"success": true,
"data": {
"scenario": {
"id": "scenario_def456",
"name": "Billing Dispute Resolution (copy)",
"prompt": "You are calling about an unexpected charge on your account. You want it explained and resolved.",
"promptVariables": [
{
"name": "charge_amount",
"type": "string",
"defaultValue": "$29.99"
}
],
"personas": [
{ "id": "persona_123", "name": "Frustrated Customer" },
{ "id": "persona_456", "name": "Polite Customer" }
],
"targetAgents": [
{ "id": "agent_789", "name": "Support Agent v2" }
],
"scorecard": {
"id": "scorecard_345",
"name": "Customer Service Quality"
},
"tags": ["billing", "customer-service"],
"cloned_from": "scenario_abc123",
"created_at": "2025-03-17T10:30:00Z",
"updated_at": "2025-03-17T10:30:00Z",
"created_by": {
"id": "user_123",
"name": "John Doe"
}
}
}
}Errors
| Status | Code | Description |
|---|---|---|
| 400 | validation_error | Invalid request body |
| 401 | unauthorized | Missing or invalid access token |
| 404 | not_found | Source scenario not found |
| 409 | conflict | A scenario with the target name already exists in the workspace |