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

NameTypeDescription
orgstringThe organization: its id (org_…) or its slug. It has to be an org your token can manage (see Who can call it)
tenantIdstringThe tenant, tnt_…

Body

FieldTypeRequiredDescription
namestringno1–80 characters, trimmed
logostringnoAn https URL
modestringnoclosed, 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_domainsstring[]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

StatuserrorWhen
400invalid_requestAn empty body, an unknown field, or a value that fails validation. The detail names it
400invalid_requestA workspace provider that cannot prove membership
403forbiddenYou are not an owner of the org
404not_foundNo such tenant in this org, or the id is not a tnt_ id
404not_foundThe 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"]}'