POST
/api/organizationsAuthenticatedCreate an organization
Creates an organization and makes the caller its owner. When the admin_only_organization_creation server setting is on, only platform administrators may create organizations. Reserved (hardcoded) organization ids are refused.
operationId
post_api_organizationsOrganizationsAuthentication & permissionsAuthenticated
Any authenticated user
- Accepted credentials
- Auth server session (refresh token cookie)
cookie "refresh_token_<auth_server_app_id>" - Access token (cookie)
cookie "access_token_<auth_server_app_id>" - Access token (Bearer)
Authorization: Bearer <JWT>
- Auth server session (refresh token cookie)
- Who may call
- Any authenticated user
Request body
Required — created_by is ignored and set to the caller.
application/json
OrganizationDefinition
| Property | Type | Description |
|---|---|---|
| organization_id* | string | minLength: 4maxLength: 32pattern: ^[a-z][a-z0-9_-]+$ |
| name* | string | minLength: 1maxLength: 64pattern: ^[a-zA-Z0-9]([a-zA-Z0-9 _-]*[a-zA-Z0-9])?$ |
| created_at* | number | exclusiveMinimum: 0 |
| created_by | string (uuid) | null (uuid) | null |
JSONExample
"organization_id""string"
"name""string"
"created_at"1.5
"created_by""123e4567-e89b-12d3-a456-426614174000"
Responses
application/json
ResourceCreationResponse
| Property | Type | Description |
|---|---|---|
| success* | true | |
| message* | string | |
| resource_id* | string | Identifier of the created / affected resource |
JSONExample
"success"true
"message""string"
"resource_id""string"
Example request
bashcurl
curl -X POST 'https://auth.schemavaults.com/api/organizations' \
-b 'refresh_token_<auth_server_app_id>=<value>' \
-H 'Content-Type: application/json' \
-d '{
"organization_id": "string",
"name": "string",
"created_at": 1.5,
"created_by": "123e4567-e89b-12d3-a456-426614174000"
}'