Skip to main content
Create a new test scenario combining personas, agents, and evaluation criteria.
curl -X POST "https://api.chanl.ai/api/v1/workspaces/ws_123/scenarios" \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Billing Issue Resolution",
    "prompt": "You are calling about an unexpected charge on your account. You want to understand what it is and get it resolved.",
    "promptVariables": [
      {
        "name": "charge_amount",
        "type": "string",
        "defaultValue": "$29.99"
      }
    ],
    "personas": ["persona_123", "persona_456"],
    "targetAgents": ["agent_789"],
    "scorecard": "scorecard_345",
    "tags": ["billing", "customer-service"]
  }'
{
  "success": true,
  "data": {
    "scenario": {
      "id": "scenario_890",
      "name": "Billing Issue Resolution",
      "prompt": "You are calling about an unexpected charge on your account. You want to understand what it is and get it resolved.",
      "promptVariables": [
        {
          "name": "charge_amount",
          "type": "string",
          "defaultValue": "$29.99"
        }
      ],
      "personas": ["persona_123", "persona_456"],
      "targetAgents": ["agent_789"],
      "scorecard": "scorecard_345",
      "tags": ["billing", "customer-service"],
      "created_at": "2024-01-15T10:30:00Z",
      "created_by": {
        "id": "user_123",
        "name": "John Doe"
      }
    }
  }
}