Skip to main content
Switch the current user’s active workspace context. Users can belong to multiple workspaces. This endpoint changes the active workspace for subsequent API calls, affecting which data and resources are accessible.
curl -X POST "https://api.chanl.ai/api/v1/auth/switch-workspace" \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "workspace_id": "ws_789"
  }'
{
  "success": true,
  "data": {
    "workspace": {
      "id": "ws_789",
      "name": "Marketing Team",
      "slug": "marketing-team",
      "role": "member",
      "permissions": [
        "read:personas",
        "write:personas",
        "read:scenarios",
        "write:scenarios"
      ]
    },
    "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
  }
}