Skip to main content

Switch org

POST /api/organizations/{org_id}/switch

Switch to a different organization. This endpoint allows authenticated users to switch their current active organization. The user must be a member of the target organization. Args: org_id: Organization ID to switch to (UUID) user_id: Authenticated user ID (injected by dependency) Returns: OrgResponse: The organization details that was switched to Raises: HTTPException: 422 if org_id is not a valid UUID (handled by FastAPI) HTTPException: 403 if user is not a member of the organization HTTPException: 404 if organization not found HTTPException: 500 if switch fails

Parameters​

NameInTypeRequiredDescription
org_idpathstringyes—
X-Org-Idheader`stringnull`no

Responses​

StatusDescription
200Successful Response
422Validation Error

Response body​

FieldTypeRequiredDescription
idstringyes—
namestringyes—
contact_namestringyes—
contact_emailstringyes—
conversation_expiration`integernull`no
remote_runtime_resource_factor`integernull`no
billing_margin`numbernull`no
enable_proactive_conversation_startersbooleanno—
sandbox_base_container_image`stringnull`no
sandbox_runtime_container_image`stringnull`no
org_versionintegerno—
agent_settings`FaheemCodeAgentSettingsLLMAgentSettingsACPAgentSettings`
conversation_settingsConversationSettingsno—
search_api_key`stringnull`no
sandbox_api_key`stringnull`no
max_budget_per_task`numbernull`no
v1_enabled`booleannull`no
credits`numbernull`no
is_personalbooleanno—

Operation ID: switch_org_api_organizations__org_id__switch_post