Create a tenant
Create a tenant in the host's org and become its owner.
POST /tenants
Creates a tenant in the org whose host you called, and makes the caller its
owner. The new tenant is closed: nobody joins it except the people its owner
adds.
Authorization
Authorization: Bearer <access token>: a user token minted by the org whose
host you call. A client_credentials token is refused with 401. Any signed-in user may create a tenant; there is no role
check.
Body
JSON.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Trimmed, 1–80 characters. |
logo | URL | No | https only. When absent, a placeholder generated from the name fills in. |
Any other key is a 400.
Response
201 with the tenant as the caller now holds it, role owner.
{
"id": "tnt_…",
"name": "Acme",
"role": "owner",
"logo": "https://ui-avatars.com/api/?name=Acme&size=128"
}
Errors
| Status | error | When |
|---|---|---|
400 | invalid_request | name is missing, empty or over 80 characters, logo is not an https URL, or an unknown key. error_detail says which. |
401 | unauthorized | No token, or an invalid, expired or ended one. See Authentication. |
Example
curl -X POST https://acme.loginwith.dev/tenants \
-H "Authorization: Bearer eyJ…" \
-H "Content-Type: application/json" \
-d '{"name": "Acme"}'