Chanl

Delete Persona

Permanently delete a persona from the workspace.

Deleting a persona will not affect existing simulations that used this persona, but it will no longer be available for new scenarios.

Request
curl -X DELETE "https://api.chanl.ai/api/v1/workspaces/ws_123/personas/persona_456" \
  -H "Authorization: Bearer <access_token>"
const response = await fetch(`https://api.chanl.ai/api/v1/workspaces/${workspaceId}/personas/${personaId}`, {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer ' + accessToken
  }
});

const { data } = await response.json();
console.log('Persona deleted:', data.message);
import requests

response = requests.delete(
    f'https://api.chanl.ai/api/v1/workspaces/{workspace_id}/personas/{persona_id}',
    headers={'Authorization': f'Bearer {access_token}'}
)

message = response.json()['data']['message']
Response
{
  "success": true,
  "data": {
    "message": "Persona deleted successfully",
    "deleted_at": "2024-01-15T10:30:00Z",
    "impact": {
      "scenarios_affected": 3,
      "active_schedules_affected": 1
    }
  }
}
{
  "success": false,
  "error": {
    "code": "PERSONA_IN_USE",
    "message": "Cannot delete persona that is currently used in active scenarios",
    "details": {
      "active_scenarios": ["scenario_123", "scenario_456"],
      "active_schedules": ["schedule_789"]
    }
  }
}