Referencia de la API

Identidad

Quién inició sesión y en qué organización.

GET /v1/capabilities

What this environment can do for my organization

Any signed-in member. Tells a client which optional features work in this environment, so it can hide or disable them instead of letting people try and fail. `assistant_builder.available` is `true` when the AI builder (`POST /v1/assistant-builder/messages`) has a model to run on for the caller's organization and `false` when it would answer `503` `builder_not_configured`. Asking does not send a message to the model and does not count against the builder's rate limit or budget. `answering_machine_detection.available` is `true` when the platform's audio detector of answering machines is deployed, so the `audio` voicemail detector of an assistant screens its outbound phone calls; `false` when that detector does nothing. 401 when the token is missing, expired or invalid; 403 with code `organization_suspended` when the organization is suspended; 503 when authentication is not available.

Respuestas

  • 200 Successful Response · CapabilitiesResponse
    NombreTipoRequeridoDescripción
    answering_machine_detectionAnsweringMachineDetectionCapability
    answering_machine_detection.availablebooleansí
    assistant_builderBuilderCapabilitysí
    assistant_builder.availablebooleansí
  • 401 Missing, expired or invalid token. · ErrorResponse
  • 403 Code `organization_suspended`: the organization is suspended. · ErrorResponse
  • 503 Authentication is not available. · ErrorResponse
  • default Default Response · ErrorResponse

POST /v1/invitations

Invite someone to my organization

Solo para usuarios con sesión iniciada (sin API key) · Rol: admin o superior

An `admin` or `owner` invites an email address to their own organization with a role (`owner`, `admin`, `editor`, `viewer`); the identity provider sends the email. The organization is the one in the caller's access token. A role above the caller's own is 403, so only an `owner` can invite an `owner`. 401 when the token is missing, expired or invalid; 403 when the caller is below `admin` or asks for a role above their own; 409 when the email already has a pending invitation or is already a member (permanent, do not retry); 422 when the email or role is invalid; 429 when the organization sends too many invitations (see `Retry-After`); 503 when no identity provider, audit log or audit key is configured, or the provider cannot be reached (retry later). The invitation is recorded in the audit log as `invitation.create`, with the role; the email is not stored, only a keyed hash of it.

Cuerpo de la solicitud

NombreTipoRequeridoDescripción
emailstringsí
rolestringsí (owner, admin, editor, viewer)

Respuestas

  • 201 Successful Response · InvitationResponse
    NombreTipoRequeridoDescripción
    emailstringsí
    rolestringsí (owner, admin, editor, viewer)
  • 401 Missing, expired or invalid token. · ErrorResponse
  • 403 Role too low, or role above the caller's. · ErrorResponse
  • 409 Already invited or already a member; do not retry. · ErrorResponse
  • 429 Too many invitations; retry later. · ErrorResponse
  • 503 Identity provider, audit log or audit key not available. · ErrorResponse
  • default Default Response · ErrorResponse

GET /v1/me

The signed-in member

Send the identity provider's access token as `Authorization: Bearer <token>`. Returns the member's subject, tenant and role (`owner`, `admin`, `editor`, `viewer`) taken from the token's `sub`, `tenant_id` and `role` claims, and `organization_name`: the name of the member's organization (null when it is not known); `platform_admin`: whether the member is an admin of the platform (an owner or admin of the organization flagged `platform` in the identity provider). `can_view_costs` follows the membership’s signed `costs:read` permission. 401 when the token is missing, expired or invalid; 403 with code `organization_suspended` when the organization is suspended (every `/v1` call of its members and API keys answers so); 503 when no identity provider is configured or it cannot be reached.

Respuestas

  • 200 Successful Response · MeResponse
    NombreTipoRequeridoDescripción
    can_view_costsboolean
    organization_namestring | nullsí
    platform_adminbooleansí
    rolestringsí (owner, admin, editor, viewer)
    subjectstringsí
    tenant_idstring (uuid)sí
  • 401 Missing, expired or invalid token. · ErrorResponse
  • 403 Code `organization_suspended`: the organization is suspended. · ErrorResponse
  • 503 Identity provider not available. · ErrorResponse
  • default Default Response · ErrorResponse

POST /v1/organizations

Create my organization

Sign-up: the signed-in user (a valid access token, which does not need a `tenant_id` yet) creates an organization and becomes its `owner`. The response carries the new tenant id; sign in again so the access token picks up `tenant_id` and `role`. After a 503 it is safe to send the same name again: the same user gets the same tenant id and no second organization is created. 401 when the token is missing, expired or invalid; 422 when the name is empty or longer than 120 characters; 429 when the caller signs up too often, or when too many sign-ups come from one client address (see `Retry-After`); 503 when no identity provider is configured or it cannot be reached, or when the rate-limit store cannot be reached.

Cuerpo de la solicitud

NombreTipoRequeridoDescripción
namestringsí

Respuestas

  • 201 Successful Response · OrganizationResponse
    NombreTipoRequeridoDescripción
    namestringsí
    tenant_idstring (uuid)sí
  • 401 Missing, expired or invalid token. · ErrorResponse
  • 429 Too many sign-ups from this account or this client address; retry later. · ErrorResponse
  • 503 Identity provider or rate-limit store not available. · ErrorResponse
  • default Default Response · ErrorResponse