Chanl

List Scenarios

Retrieve all scenarios in the workspace with filtering, search, and pagination.

List Scenarios

Returns a paginated list of scenarios in the current workspace, with optional filtering by status, tags, and search.

Endpoint

GET /api/v1/scenarios

curl -X GET "https://api.chanl.ai/api/v1/scenarios?limit=20&offset=0&status=active&tags=billing" \
  -H "Authorization: Bearer <access_token>"
const params = new URLSearchParams({
  limit: '20',
  offset: '0',
  status: 'active',
  tags: 'billing',
});

const response = await fetch(`https://api.chanl.ai/api/v1/scenarios?${params}`, {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${accessToken}`,
  },
});
const data = await response.json();
import requests

response = requests.get(
    'https://api.chanl.ai/api/v1/scenarios',
    headers={'Authorization': f'Bearer {access_token}'},
    params={
        'limit': 20,
        'offset': 0,
        'status': 'active',
        'tags': 'billing',
    },
)
data = response.json()

Query Parameters

limitnumberdefault: 50

Maximum number of results to return. Max: 100.

offsetnumberdefault: 0

Number of results to skip for pagination.

statusstring

Filter by scenario status. One of active, archived, or draft.

tagsstring

Comma-separated list of tags to filter by (e.g., billing,support).

namestring

Search scenarios by name (partial match).

sortBystringdefault: createdAt

Sort field. One of name, createdAt, updatedAt, usage.

sortOrderstringdefault: desc

Sort direction. One of asc, desc.

Response

Response
{
  "success": true,
  "data": {
    "scenarios": [
      {
        "id": "scenario_abc123",
        "name": "Billing Dispute Resolution",
        "prompt": "You are calling about an unexpected charge on your account.",
        "personas": [
          { "id": "persona_456", "name": "Frustrated Customer" },
          { "id": "persona_789", "name": "Polite Customer" }
        ],
        "targetAgents": [
          { "id": "agent_101", "name": "Support Agent v2" }
        ],
        "scorecard": {
          "id": "scorecard_234",
          "name": "Customer Service Quality"
        },
        "tags": ["billing", "customer-service"],
        "status": "active",
        "created_at": "2025-01-10T10:00:00Z",
        "updated_at": "2025-02-15T09:30:00Z",
        "created_by": {
          "id": "user_567",
          "name": "Jane Smith"
        },
        "stats": {
          "total_simulations": 23,
          "avg_score": 87.3,
          "last_run": "2025-02-15T08:45:00Z"
        }
      }
    ],
    "pagination": {
      "total": 45,
      "limit": 20,
      "offset": 0,
      "has_more": true
    }
  }
}

Errors

StatusCodeDescription
400validation_errorInvalid query parameter value
401unauthorizedMissing or invalid access token

On this page