Skip to main content

Tenants

Endpoints for reading the tenant directory and managing tenant-level state from the platform.


Route shapes

URLShape
/tenantsCross-tenant
/tenants/{tenant}/missing-paymentsTenant-scoped

Tenant-scoped URLs name the customer tenant directly in the path. Cross-tenant URLs span every tenant on the platform and require the cross-tenant ability.

Path-encoded operations against the platform tenant (id 1) are rejected with 403. An internal-api token cannot modify publica.la through a {tenant} URL.


Endpoints

MethodEndpointRequired abilitiesDescription
GET/tenantstenants:read, cross-tenantList tenants with an active plan
POST/tenants/{tenant}/missing-paymentstenants:writeFlag a tenant as having unpaid invoices
DELETE/tenants/{tenant}/missing-paymentstenants:writeClear the unpaid-invoices flag

Tenant resource shape

The list endpoint returns a slim, read-friendly projection.

{
"id": "14",
"name": "Ciudad Nueva",
"subdomain": "ciudadnueva-qetffdw-93.app.publica.la",
"final_domain": "ciudadnueva.publicala.me",
"https": true,
"lang": "es"
}

Fields:

FieldTypeDescription
idstringTenant id (serialized as a string so JavaScript clients keep precision)
namestringPublic-facing tenant name
subdomainstringInternal *.app.publica.la subdomain
final_domainstring | nullThe host the tenant is reachable at end-to-end (custom domain or default), or null for tenants without a configured host
httpsboolTenant uses HTTPS
langstringDefault tenant language (ISO 639-1)

Missing-payments resource shape

The mark and clear endpoints share a response shape:

{
"data": {
"tenant_id": "2",
"has_unpaid_invoices_at": "2026-05-05T12:21:32.000000Z",
"dashboard_blocked": false,
"missing_payment_limit_date": "2026-05-19T12:21:32.000000Z"
}
}

Fields:

FieldTypeDescription
tenant_idstringTenant id
has_unpaid_invoices_atdatetime | nullThe moment the tenant was flagged as having unpaid invoices, or null
dashboard_blockedboolWhether the dashboard block is currently engaged (computed from current time)
missing_payment_limit_datedatetimehas_unpaid_invoices_at + 2 weeks. Omitted from the response when has_unpaid_invoices_at is null

The 2-week grace period is fixed by the platform. dashboard_blocked becomes true whenever the current time is past missing_payment_limit_date.


Behavior on tenants without a Stripe customer

A tenant must have a Stripe customer attached for missing-payments operations to apply. The two endpoints handle the no-customer case differently:

  • POST against a tenant without a Stripe customer returns 400 with code tenant_has_no_stripe_customer. The same code covers tenants that have never had a payment-intent record created.
  • DELETE against a tenant without a Stripe customer returns 200. The implicit state is "clear", and a clear of an already-clear state is a no-op.

See also

X

Graph View