Create a tenant
Create a tenant in the organization.
POST /organizations/{org}/tenants
Creates a tenant from a name and an optional logo. To set who can join, follow up with Update a tenant.
Authorization
Org owner. Anyone else gets 403 forbidden.
Path parameters
| Name | Type | Description |
|---|---|---|
org | string | The organization: its id (org_…) or its slug. It has to be an org your token can manage (see Who can call it) |
Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | 1–80 characters, trimmed |
logo | string | no | An https URL. A placeholder fills in when it is left out |
No other field is accepted.
Response
201 Created with the created tenant, shaped as in List tenants.
Errors
| Status | error | When |
|---|---|---|
400 | invalid_request | An unknown field, or a value that fails validation. The detail names it |
403 | forbidden | You are not an owner of the org |
404 | not_found | The org does not exist, or your token cannot manage it |
Example
curl -X POST https://loginwith.loginwith.dev/organizations/acme/tenants \
-H "Authorization: Bearer $TOKEN" -H "content-type: application/json" \
-d '{"name": "Acme France"}'