Appearance
tenants
5 endpoints.
GET /api/v1/tenants/all
List All Tenants
Platform-admin view: every organization on the instance.
200 — Successful Response
json
{
"items": {
"properties": {
"id": {
"type": "string",
"title": "Id"
},
"name": {
"type": "string",
"title": "Name"
},
"slug": {
"type": "string",
"title": "Slug"
},
"plan_tier": {
"type": "string",
"title": "Plan Tier"
},
"status": {
"type": "string",
"title": "Status"
},
"settings": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Settings"
},
"icon_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Icon Url"
},
"member_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Member Count"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"email": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Email"
},
"phone": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Phone"
},
"account_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Account Id"
},
"customer_status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Customer Status"
},
"notes": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Notes"
},
"erp_customer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Erp Customer"
},
"erp_synced_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Erp Synced At"
}
},
"type": "object",
"required": [
"id",
"name",
"slug",
"plan_tier",
"status",
"created_at"
],
"title": "TenantResponse"
},
"type": "array",
"title": "Response List All Tenants Api V1 Tenants All Get"
}POST /api/v1/tenants
Create Tenant
Create a new organization; the caller becomes its owner.
Request body
json
{
"properties": {
"name": {
"type": "string",
"maxLength": 255,
"minLength": 1,
"title": "Name"
},
"slug": {
"type": "string",
"maxLength": 100,
"minLength": 2,
"title": "Slug"
},
"plan_tier": {
"type": "string",
"title": "Plan Tier",
"default": "starter"
}
},
"type": "object",
"required": [
"name",
"slug"
],
"title": "TenantCreate"
}201 — Successful Response
json
{
"properties": {
"id": {
"type": "string",
"title": "Id"
},
"name": {
"type": "string",
"title": "Name"
},
"slug": {
"type": "string",
"title": "Slug"
},
"plan_tier": {
"type": "string",
"title": "Plan Tier"
},
"status": {
"type": "string",
"title": "Status"
},
"settings": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Settings"
},
"icon_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Icon Url"
},
"member_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Member Count"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"email": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Email"
},
"phone": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Phone"
},
"account_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Account Id"
},
"customer_status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Customer Status"
},
"notes": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Notes"
},
"erp_customer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Erp Customer"
},
"erp_synced_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Erp Synced At"
}
},
"type": "object",
"required": [
"id",
"name",
"slug",
"plan_tier",
"status",
"created_at"
],
"title": "TenantResponse"
}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}GET /api/v1/tenants/{tenant_id}
Get Tenant
Read the active organization (must match the X-Tenant-ID header).
200 — Successful Response
json
{
"properties": {
"id": {
"type": "string",
"title": "Id"
},
"name": {
"type": "string",
"title": "Name"
},
"slug": {
"type": "string",
"title": "Slug"
},
"plan_tier": {
"type": "string",
"title": "Plan Tier"
},
"status": {
"type": "string",
"title": "Status"
},
"settings": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Settings"
},
"icon_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Icon Url"
},
"member_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Member Count"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"email": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Email"
},
"phone": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Phone"
},
"account_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Account Id"
},
"customer_status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Customer Status"
},
"notes": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Notes"
},
"erp_customer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Erp Customer"
},
"erp_synced_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Erp Synced At"
}
},
"type": "object",
"required": [
"id",
"name",
"slug",
"plan_tier",
"status",
"created_at"
],
"title": "TenantResponse"
}PATCH /api/v1/tenants/{tenant_id}
Update Tenant
Update org name/plan/settings. Admin+ only. status changes (suspend) are reserved for platform superusers.
Request body
json
{
"properties": {
"name": {
"anyOf": [
{
"type": "string",
"maxLength": 255
},
{
"type": "null"
}
],
"title": "Name"
},
"plan_tier": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Plan Tier"
},
"status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Status"
},
"settings": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Settings"
},
"icon_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Icon Url"
},
"email": {
"anyOf": [
{
"type": "string",
"maxLength": 255
},
{
"type": "null"
}
],
"title": "Email"
},
"phone": {
"anyOf": [
{
"type": "string",
"maxLength": 64
},
{
"type": "null"
}
],
"title": "Phone"
},
"account_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64
},
{
"type": "null"
}
],
"title": "Account Id"
},
"customer_status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Customer Status"
},
"notes": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Notes"
}
},
"type": "object",
"title": "TenantUpdate"
}200 — Successful Response
json
{
"properties": {
"id": {
"type": "string",
"title": "Id"
},
"name": {
"type": "string",
"title": "Name"
},
"slug": {
"type": "string",
"title": "Slug"
},
"plan_tier": {
"type": "string",
"title": "Plan Tier"
},
"status": {
"type": "string",
"title": "Status"
},
"settings": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Settings"
},
"icon_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Icon Url"
},
"member_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Member Count"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"email": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Email"
},
"phone": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Phone"
},
"account_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Account Id"
},
"customer_status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Customer Status"
},
"notes": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Notes"
},
"erp_customer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Erp Customer"
},
"erp_synced_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Erp Synced At"
}
},
"type": "object",
"required": [
"id",
"name",
"slug",
"plan_tier",
"status",
"created_at"
],
"title": "TenantResponse"
}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}DELETE /api/v1/tenants/{tenant_id}
Delete Tenant
Soft-delete an organization. Owner (or platform superuser) only.
The org's memberships and pending invitations are retired with it, and a member left with no other organisation has its login deactivated — the "org deleted but its user still remains" cleanup. A platform account is never touched (superuser / internal / hidden users sit in many customer orgs and are staff, not the org's own people), and a user with memberships elsewhere keeps its account, exactly as app.scripts.revoke_portal_logins_non_portal_accounts_2026_09_20._revoke does. Deactivation (is_active False + token_version bump), not row deletion, so the handle stays reusable for a later purchase — the FK memberships_*_fkey cascades only fire on a hard DELETE, which this estate does not do.
200 — Successful Response
json
{
"properties": {
"id": {
"type": "string",
"title": "Id"
},
"name": {
"type": "string",
"title": "Name"
},
"slug": {
"type": "string",
"title": "Slug"
},
"plan_tier": {
"type": "string",
"title": "Plan Tier"
},
"status": {
"type": "string",
"title": "Status"
},
"settings": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Settings"
},
"icon_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Icon Url"
},
"member_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Member Count"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"email": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Email"
},
"phone": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Phone"
},
"account_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Account Id"
},
"customer_status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Customer Status"
},
"notes": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Notes"
},
"erp_customer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Erp Customer"
},
"erp_synced_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Erp Synced At"
}
},
"type": "object",
"required": [
"id",
"name",
"slug",
"plan_tier",
"status",
"created_at"
],
"title": "TenantResponse"
}