Create a tenant.
curl --request POST \ --url https://auth.example.com/api/admin/tenants \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "id": "acme", "name": "Acme Corp" }'Create a tenant as a platform-level administrator. The server assigns lifecycle state, default status, and timestamps; callers provide only the tenant identifier and display metadata. This endpoint does not use X-Tenant-Id because the target tenant is being created.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”Tenant creation input. The server sets lifecycle_state, is_default, created_at, and updated_at; those fields must not be supplied by callers.
object
Stable tenant identifier. Must be a DNS-label-style lowercase value.
Optional human-facing tenant code. Defaults to id when omitted.
Examples
Create a tenant with the default tenant code.
{ "id": "acme", "name": "Acme Corp"}Create a tenant with an explicit tenant code.
{ "id": "acme-prod", "tenant_code": "acme", "name": "Acme Corp", "description": "Production tenant for Acme Corp."}Responses
Section titled “ Responses ”Tenant mutation response. Timestamps and lifecycle fields are assigned by the server and are not accepted in the create request body.
Tenant row returned by create, update, set-default, and other tenant mutation operations.
object
Unix timestamp in seconds.
Unix timestamp in seconds.
Present on tenant D1 pool create and provisioning retry responses.
object
Examples
Tenant created in the shared control-plane database.
{ "id": "acme", "tenant_code": "acme", "name": "Acme Corp", "description": "Production tenant for Acme Corp.", "lifecycle_state": "active", "is_default": false, "created_at": 1770000000, "updated_at": 1770000000}Tenant created with a preallocated tenant D1 slot.
{ "id": "acme", "tenant_code": "acme", "name": "Acme Corp", "description": "Production tenant for Acme Corp.", "lifecycle_state": "active", "is_default": false, "created_at": 1770000000, "updated_at": 1770000000, "provisioning": { "mode": "tenant-d1-preallocated-pool", "slot_id": "slot_01HQ0X9Q7Y2T6J4ZC8M3N2P1A0", "smoke_test": "passed" }}