POST /api/organizations
Create a new organization. This endpoint allows authenticated users that hold the CREATE_ORGANIZATION permission to create a new organization. In practice this permission is only granted via the superadmin role; no regular, org-scoped role carries it. The creator is not automatically added as a member; a superadmin can provision the initial org users separately. Args: org_data: Organization creation data user_id: Authenticated user ID (injected by require_permission) Returns: OrgResponse: The created organization details Raises: HTTPException: 401 if the user is not authenticated HTTPException: 403 if the user lacks CREATE_ORGANIZATION HTTPException: 409 if organization name already exists HTTPException: 500 if creation fails
Parameters
| Name | In | Type | Required | Description |
|---|
org_id | query | `string | null` | no |
X-Org-Id | header | `string | null` | no |
Request body
| Field | Type | Required | Description |
|---|
name | string | yes | — |
contact_name | string | yes | — |
contact_email | string | yes | — |
Responses
| Status | Description |
|---|
201 | Successful Response |
422 | Validation Error |
Response body
| Field | Type | Required | Description |
|---|
id | string | yes | — |
name | string | yes | — |
contact_name | string | yes | — |
contact_email | string | yes | — |
conversation_expiration | `integer | null` | no |
remote_runtime_resource_factor | `integer | null` | no |
billing_margin | `number | null` | no |
enable_proactive_conversation_starters | boolean | no | — |
sandbox_base_container_image | `string | null` | no |
sandbox_runtime_container_image | `string | null` | no |
org_version | integer | no | — |
agent_settings | `FaheemCodeAgentSettings | LLMAgentSettings | ACPAgentSettings` |
conversation_settings | ConversationSettings | no | — |
search_api_key | `string | null` | no |
sandbox_api_key | `string | null` | no |
max_budget_per_task | `number | null` | no |
v1_enabled | `boolean | null` | no |
credits | `number | null` | no |
is_personal | boolean | no | — |
Operation ID: create_org_api_organizations_post