List Personas
Get all personas in a workspace with filtering and search capabilities.
Personas represent different customer behaviors and characteristics used in testing scenarios.
Request
curl -X GET "https://api.chanl.ai/api/v1/workspaces/ws_123/personas" \
-H "Authorization: Bearer <access_token>"const response = await fetch(`https://api.chanl.ai/api/v1/workspaces/${workspaceId}/personas`, {
headers: {
'Authorization': 'Bearer ' + accessToken
}
});
const { data } = await response.json();
console.log('Personas:', data.personas);import requests
response = requests.get(
f'https://api.chanl.ai/api/v1/workspaces/{workspace_id}/personas',
headers={'Authorization': f'Bearer {access_token}'}
)
personas = response.json()['data']['personas']Response
{
"success": true,
"data": {
"personas": [
{
"id": "persona_123",
"name": "Frustrated Customer",
"language": "en",
"emotion": "frustrated",
"difficulty": "hard",
"backgroundNoise": "office",
"tags": ["frustrated", "impatient", "support"],
"created_at": "2024-01-01T10:00:00Z",
"updated_at": "2024-01-15T09:30:00Z",
"created_by": {
"id": "user_456",
"name": "Jane Smith"
},
"usage_stats": {
"total_simulations": 45,
"avg_score": 72.3,
"last_used": "2024-01-15T08:45:00Z"
}
},
{
"id": "persona_456",
"name": "Polite Customer",
"language": "en",
"emotion": "neutral",
"difficulty": "easy",
"backgroundNoise": "none",
"tags": ["polite", "patient", "support"],
"created_at": "2024-01-05T14:20:00Z",
"updated_at": "2024-01-10T11:15:00Z",
"created_by": {
"id": "user_456",
"name": "Jane Smith"
},
"usage_stats": {
"total_simulations": 67,
"avg_score": 91.8,
"last_used": "2024-01-14T16:20:00Z"
}
}
],
"pagination": {
"total": 15,
"page": 1,
"limit": 50,
"has_more": false
}
}
}Query Parameters
namestringSearch personas by name (partial match)
languagestringFilter by language code (e.g., "en", "es", "fr")
emotionstringFilter by emotional state (frustrated, happy, confused, neutral, etc.)
difficultystringFilter by difficulty level (easy, medium, hard)
tagsstringFilter by tags (comma-separated)
createdBystringFilter by creator user ID
sortBystringSort field (name, createdAt, updatedAt, usage)
sortOrderstringSort direction (asc, desc)
limitnumberMaximum number of results (default: 50, max: 100)
offsetnumberNumber of results to skip for pagination
Filtering Examples
curl -X GET "https://api.chanl.ai/api/v1/workspaces/ws_123/personas?emotion=frustrated" \
-H "Authorization: Bearer <access_token>"curl -X GET "https://api.chanl.ai/api/v1/workspaces/ws_123/personas?tags=support,billing" \
-H "Authorization: Bearer <access_token>"curl -X GET "https://api.chanl.ai/api/v1/workspaces/ws_123/personas?name=angry" \
-H "Authorization: Bearer <access_token>"curl -X GET "https://api.chanl.ai/api/v1/workspaces/ws_123/personas?sortBy=usage&sortOrder=desc" \
-H "Authorization: Bearer <access_token>"