Tenants
3 Endpunkte. Basis-URL: https://xapi.ambertech.cloud/api/v1
Resolve a slug to an org and verify membership#
/tenants/by-slug/{slug}TokenUsed by Next.js middleware when validating /spaces/<slug>/... URLs. Returns 404 when the slug does not match any organization, 403 with `{ code: "NOT_A_MEMBER", organizationId, organizationName }` when the org exists but the caller has no membership row.
Parameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
slugPflicht | Pfad | string | – |
Antworten
- 200OK
- 401Not authenticated
- 403Caller is not a member of this organization. Response body carries `code: "NOT_A_MEMBER"` plus `organizationId` and `organizationName` so the frontend can offer a "Request access" CTA.
- 404Slug does not match any organization
curl -X GET "https://xapi.ambertech.cloud/api/v1/tenants/by-slug/{slug}" \
-H "Authorization: Bearer $XISUITE_TOKEN"List all organizations the current user is a member of#
/tenants/meTokenReturns one row per organization_members entry for the caller, oldest first. Includes denormalised name, slug, role, and switcher-chip branding (logo_light_url + primary_color). Member counts are not included in this response.
Antworten
- 200OK
- 401Not authenticated
curl -X GET "https://xapi.ambertech.cloud/api/v1/tenants/me" \
-H "Authorization: Bearer $XISUITE_TOKEN"Switch the active tenant for the current session#
/tenants/switchTokenBody must carry exactly one of `organizationId` or `slug`. On success, writes a signed `active_org_id` HttpOnly cookie and records the switch in `tenant_switch_audit`. No-op when the target equals the currently active tenant. 403 NOT_A_MEMBER when the caller is not a member of the target.
Request-Body
| Name | Typ | Beschreibung |
|---|---|---|
organizationId | string | Target organization UUID. Mutually exclusive with `slug`. Exactly one of the two must be provided. |
slug | string | Target organization slug. Mutually exclusive with `organizationId`. |
Antworten
- 200OK
- 400Body provided neither or both of `organizationId` / `slug`, or a slug failed the regex.
- 401Not authenticated
- 403Not a member of target tenant
- 404Target tenant not found
curl -X POST "https://xapi.ambertech.cloud/api/v1/tenants/switch" \
-H "Authorization: Bearer $XISUITE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"organizationId":"…","slug":"…"}'