Switch to a different organization context. Updates session to use the specified organization.
curl --request POST \
--url https://{deploymentHost}/session/switch-organization \
--header 'Content-Type: application/json' \
--data '{
"organization_id": "org_987654321"
}'
{
"status": 200,
"message": "",
"data": {
"organization": {
"id": "org_987654321",
"name": "Tech Startup Inc",
"slug": "tech-startup",
"image_url": "https://cdn.example.com/orgs/tech-startup.jpg"
},
"workspace": {
"id": "workspace_default",
"name": "General",
"slug": "general"
}
},
"session": {
"signin_attempts": [],
"signins": [
{
"id": "signin_987654321",
"user_id": "user_456789123",
"created_at": "2024-01-01T12:00:00Z"
}
],
"signup_attempts": [],
"active_signin": {
"id": "signin_987654321",
"user_id": "user_456789123",
"created_at": "2024-01-01T12:00:00Z"
}
},
"errors": []
}
Session cookie authentication for production deployments. The session token is automatically set as an HTTP-only, secure cookie.
Successfully switched organization
The response is of type object
.
curl --request POST \
--url https://{deploymentHost}/session/switch-organization \
--header 'Content-Type: application/json' \
--data '{
"organization_id": "org_987654321"
}'
{
"status": 200,
"message": "",
"data": {
"organization": {
"id": "org_987654321",
"name": "Tech Startup Inc",
"slug": "tech-startup",
"image_url": "https://cdn.example.com/orgs/tech-startup.jpg"
},
"workspace": {
"id": "workspace_default",
"name": "General",
"slug": "general"
}
},
"session": {
"signin_attempts": [],
"signins": [
{
"id": "signin_987654321",
"user_id": "user_456789123",
"created_at": "2024-01-01T12:00:00Z"
}
],
"signup_attempts": [],
"active_signin": {
"id": "signin_987654321",
"user_id": "user_456789123",
"created_at": "2024-01-01T12:00:00Z"
}
},
"errors": []
}