Chanl

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

idstringrequired

The ID of the scenario to clone (e.g., scenario_abc123).

Parameters

namestring

Name 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

StatusCodeDescription
400validation_errorInvalid request body
401unauthorizedMissing or invalid access token
404not_foundSource scenario not found
409conflictA scenario with the target name already exists in the workspace

On this page