XISUITEDokumentation

Tenants

3 Endpunkte. Basis-URL: https://xapi.ambertech.cloud/api/v1

Resolve a slug to an org and verify membership#

GET/tenants/by-slug/{slug}Token

Used 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

NameOrtTypBeschreibung
slugPflichtPfadstring–

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
Beispiel (cURL)
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#

GET/tenants/meToken

Returns 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
Beispiel (cURL)
curl -X GET "https://xapi.ambertech.cloud/api/v1/tenants/me" \
  -H "Authorization: Bearer $XISUITE_TOKEN"

Switch the active tenant for the current session#

POST/tenants/switchToken

Body 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-Bodyapplication/jsonSwitchTenantDto

NameTypBeschreibung
organizationIdstring

Target organization UUID. Mutually exclusive with `slug`. Exactly one of the two must be provided.

slugstring

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
Beispiel (cURL)
curl -X POST "https://xapi.ambertech.cloud/api/v1/tenants/switch" \
  -H "Authorization: Bearer $XISUITE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"organizationId":"…","slug":"…"}'
Stand: 25. Oktober 2026© 2026 XISUITE · AmberTech Solutions