Update a tenant
Rename a tenant, change its logo, or change who can join.
PATCH /organizations/{org}/tenants/{tenantId}
The body is the mask: the keys you send change. workspaces and email_domains only make sense with a mode, so they are accepted only together with it, and only the one that matches.
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) |
tenantId | string | The tenant, tnt_… |
Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | no | 1–80 characters, trimmed |
logo | string | no | An https URL |
mode | string | no | closed, public, workspace or domain |
workspaces | { provider, domain }[] | with mode: "workspace" | Required with that mode, refused with any other. Each needs a non-empty provider and domain; the domain is lowercased. The provider has to be one that can prove membership |
email_domains | string[] | with mode: "domain" | Required with that mode, refused with any other. Non-empty strings, lowercased |
closed and public take neither list. An empty list is allowed. At least one field is required.
Response
200 OK with the updated tenant.
{
"id": "tnt_65f1c2a9e4b0d3f7a1c8e908",
"name": "Acme France",
"logo": "https://…",
"mode": "domain",
"email_domains": ["acme.fr"]
}
Errors
| Status | error | When |
|---|---|---|
400 | invalid_request | An empty body, an unknown field, or a value that fails validation. The detail names it |
400 | invalid_request | A workspace provider that cannot prove membership |
403 | forbidden | You are not an owner of the org |
404 | not_found | No such tenant in this org, or the id is not a tnt_ id |
404 | not_found | The org does not exist, or your token cannot manage it |
Example
curl -X PATCH https://loginwith.loginwith.dev/organizations/acme/tenants/tnt_65f1c2a9e4b0d3f7a1c8e908 \
-H "Authorization: Bearer $TOKEN" -H "content-type: application/json" \
-d '{"mode": "domain", "email_domains": ["acme.fr"]}'