PT EN

Equipa

URL base: $BUSINESS_API

O objecto

idstring · opcional
device_namestring · opcional

Parsed label such as "Chrome 128 on macOS" or "Mobile app on Android"

user_agentstring · opcional
ip_addressstring · opcional
last_active_atstring (date-time) · opcional
created_atstring (date-time) · opcional
expires_atstring (date-time) · opcional
is_currentboolean · opcional
O objecto
{
  "id": "ses_2c2ff4Evh00LjE4JZcmdbIifJSI",
  "device_name": "Ana Matsinhe",
  "user_agent": "user agent",
  "ip_address": "Av. Julius Nyerere 1420, Maputo",
  "last_active_at": "2026-11-19T09:30:00Z",
  "created_at": "2026-11-19T09:30:00Z",
  "expires_at": "2026-11-19T09:30:00Z",
  "is_current": true
}

Listar sessões de um membro

Registos

GET /team/members/{id}/sessions

Returns, in a data array, the live sessions the member holds in the caller's team, with device name, user agent, IP address, last activity, creation and expiry times. is_current marks the caller's own session. Returns 404 when the member is not active in this team; requires the team read permission.

Parâmetros

idstring · caminho · obrigatório

Membership ID of the team member, as returned by the members list.

Devolve

200 List a team member sessions

Mostrar atributos
dataarray of Session · opcional
Mostrar atributos filhos
idstring · opcional
device_namestring · opcional

Parsed label such as "Chrome 128 on macOS" or "Mobile app on Android"

user_agentstring · opcional
ip_addressstring · opcional
last_active_atstring (date-time) · opcional
created_atstring (date-time) · opcional
expires_atstring (date-time) · opcional
is_currentboolean · opcional

Erros 400 · 401

Permissões business:team:read · Funções: admin, owner

curl -X GET "$BUSINESS_API/team/members/{id}/sessions" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
{
  "data": [
    {
      "id": "ses_2c2ff4Evh00LjE4JZcmdbIifJSI",
      "device_name": "Ana Matsinhe",
      "user_agent": "user agent",
      "ip_address": "Av. Julius Nyerere 1420, Maputo",
      "last_active_at": "2026-11-19T09:30:00Z",
      "created_at": "2026-11-19T09:30:00Z",
      "expires_at": "2026-11-19T09:30:00Z",
      "is_current": true
    }
  ]
}

Terminar as sessões de um membro

Registos

DELETE /team/members/{id}/sessions

Ends every device session the member holds in the caller's team, forcing a new sign-in, and returns the number ended as revoked. Only an owner may end an owner's sessions (403); an unknown member returns 404. Requires the team manage permission and is recorded in the audit trail.

Parâmetros

idstring · caminho · obrigatório

Membership ID of the team member whose sessions are ended.

Devolve

200 End every session of a team member

Mostrar atributos
revokedinteger · opcional

Erros 400 · 401

Permissões business:team:manage · Funções: admin, owner

curl -X DELETE "$BUSINESS_API/team/members/{id}/sessions" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
{
  "revoked": 1
}

Listar convites da equipa

Registos

GET /team/invitations

Returns invitations of the caller's current team (the utility tenant, or the organization when signed in as organization staff) in cursor pages using limit and after. Only pending invitations are returned unless a status query parameter asks for another; pending invitations past their expiry are reported as expired. Requires the team read permission of that context.

Parâmetros

limitinteger · consulta · opcional

Maximum resources to return (default 20, maximum 100).

afterstring · consulta · opcional

Opaque cursor returned by the previous page.

Devolve

200 Invitations scoped to the authenticated utility or organization

Mostrar atributos
dataarray of TeamInvitation · obrigatório
Mostrar atributos filhos
idstring · obrigatório
emailstring · opcional
phonestring · opcional
full_namestring · opcional
rolesarray of string · obrigatório
statusstring · obrigatório

um de pending, accepted, revoked, expired

expires_atstring (date-time) · obrigatório
created_atstring (date-time) · obrigatório
dev_codestring · opcional

Invitation token echoed only in development mode

has_moreboolean · obrigatório
next_cursorstring · opcional

Erros 400 · 401

Permissões business:team:read · Funções: admin, owner

curl -X GET "$BUSINESS_API/team/invitations" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
{
  "data": [
    {
      "id": "tea_29hCWbtKGjr0MddW6tj00zL8mXp",
      "email": "ana.matsinhe@example.org",
      "phone": "+258841234567",
      "full_name": "Ana Matsinhe",
      "roles": [
        "role"
      ],
      "status": "pending",
      "expires_at": "2026-11-19T09:30:00Z",
      "created_at": "2026-11-19T09:30:00Z",
      "dev_code": "DEV-2026-000142"
    }
  ],
  "has_more": true,
  "next_cursor": "next cursor"
}

Convidar um membro para a equipa

Registos

POST /team/invitations

Sends a one-time invitation token by e-mail, or by text message when only phone is given, offering the listed roles in the caller's current team; the invitation expires after 7 days and replaces any earlier pending invitation for the same recipient. Only an owner can grant the owner role (403), an unknown role or missing e-mail and phone returns 400, someone who is already an active member returns 409, and 503 means the message could not be delivered, in which case the invitation is revoked. Requires the team manage permission and is recorded in the audit trail.

Corpo application/json

emailstring · opcional

Required when phone is absent

phonestring · opcional

Required when email is absent

full_namestring · opcional
rolesarray of string · obrigatório

Devolve

201 Invitation for the authenticated utility or organization team

Mostrar atributos
idstring · obrigatório
emailstring · opcional
phonestring · opcional
full_namestring · opcional
rolesarray of string · obrigatório
statusstring · obrigatório

um de pending, accepted, revoked, expired

expires_atstring (date-time) · obrigatório
created_atstring (date-time) · obrigatório
dev_codestring · opcional

Invitation token echoed only in development mode

Erros 400 · 401 · 503

Permissões business:team:manage · Funções: admin, owner

curl -X POST "$BUSINESS_API/team/invitations" \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
  "email": "ana.matsinhe@example.org",
  "phone": "+258841234567",
  "full_name": "Ana Matsinhe",
  "roles": [
    "role"
  ]
}'
Resposta 201
{
  "id": "tea_29hCWbtKGjr0MddW6tj00zL8mXp",
  "email": "ana.matsinhe@example.org",
  "phone": "+258841234567",
  "full_name": "Ana Matsinhe",
  "roles": [
    "role"
  ],
  "status": "pending",
  "expires_at": "2026-11-19T09:30:00Z",
  "created_at": "2026-11-19T09:30:00Z",
  "dev_code": "DEV-2026-000142"
}

Revogar um convite da equipa

Registos

DELETE /team/invitations/{id}

Revoke a pending invitation from the active utility or organization team

Marks a pending invitation of the caller's team as revoked so its token can no longer be used, and answers 204. Returns 404 when the invitation is not in this team and 409 when it is no longer pending; requires the team manage permission and is recorded in the audit trail.

Devolve

204 Revoke a pending invitation scoped to the authenticated context

Erros 400 · 401

Permissões business:team:manage · Funções: admin, owner

curl -X DELETE "$BUSINESS_API/team/invitations/{id}" \
  -H "Authorization: Bearer sk_test_..."
Resposta 204

Revoke a pending invitation scoped to the authenticated context

Listar membros da equipa

Registos

GET /team/members

Returns the active members of the caller's current team (the utility tenant or the organization) with their user details, roles, status and join date, in cursor pages using limit and after. Requires the team read permission of that context.

Parâmetros

limitinteger · consulta · opcional

Maximum resources to return (default 20, maximum 100).

afterstring · consulta · opcional

Opaque cursor returned by the previous page.

Devolve

200 Members scoped to the authenticated utility or organization

Mostrar atributos
dataarray of TeamMember · obrigatório
Mostrar atributos filhos
idstring · obrigatório
userobject · obrigatório
Mostrar atributos filhos
idstring · obrigatório
emailstring · opcional
phonestring · opcional
full_namestring · obrigatório
localestring · obrigatório

um de pt-MZ, en-US

statusstring · obrigatório

um de active, disabled

email_verifiedboolean · obrigatório
phone_verifiedboolean · obrigatório
created_atstring (date-time) · obrigatório
rolesarray of string · obrigatório
statusstring · obrigatório
joined_atstring (date-time) · obrigatório
has_moreboolean · obrigatório
next_cursorstring · opcional

Erros 400 · 401

Permissões business:team:read · Funções: admin, owner

curl -X GET "$BUSINESS_API/team/members" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
{
  "data": [
    {
      "id": "tea_2CG53ca1REQBv6SPVO6TpaYfp4u",
      "user": {
        "id": "use_2ZtKedjGsDLWMRDGSD9S0vnswD5",
        "email": "ana.matsinhe@example.org",
        "phone": "+258841234567",
        "full_name": "Ana Matsinhe",
        "locale": "pt-MZ",
        "status": "active",
        "email_verified": true,
        "phone_verified": true,
        "created_at": "2026-11-19T09:30:00Z"
      },
      "roles": [
        "role"
      ],
      "status": "active",
      "joined_at": "2026-11-19T09:30:00Z"
    }
  ],
  "has_more": true,
  "next_cursor": "next cursor"
}

Remover um membro da equipa

Registos

DELETE /team/members/{id}

Remove a member from the active utility or organization team (the last owner cannot be removed)

Ends the member's membership in the caller's team, signs out every session tied to it, and answers 204. Only an owner may remove another owner (403), removing the last owner returns 409, and an unknown or inactive member returns 404. Requires the team manage permission and is recorded in the audit trail.

Devolve

204 Remove a member scoped to the authenticated context

Erros 400 · 401

Permissões business:team:manage · Funções: admin, owner

curl -X DELETE "$BUSINESS_API/team/members/{id}" \
  -H "Authorization: Bearer sk_test_..."
Resposta 204

Remove a member scoped to the authenticated context

Alterar as funções de um membro

Registos

PATCH /team/members/{id}/roles

Replace a member's roles in the active utility or organization team

Replaces the member's roles with the roles array and returns the updated member. The member's existing sessions are revoked so the new permissions take effect at the next sign-in. Only an owner may grant the owner role or demote an owner (403), demoting the last owner returns 409, and an unknown role returns 400; requires the team manage permission.

Corpo application/json

rolesarray of string · obrigatório

Devolve

200 Replace member roles scoped to the authenticated context; the last owner cannot be demoted

Mostrar atributos
idstring · obrigatório
userobject · obrigatório
Mostrar atributos filhos
idstring · obrigatório
emailstring · opcional
phonestring · opcional
full_namestring · obrigatório
localestring · obrigatório

um de pt-MZ, en-US

statusstring · obrigatório

um de active, disabled

email_verifiedboolean · obrigatório
phone_verifiedboolean · obrigatório
created_atstring (date-time) · obrigatório
rolesarray of string · obrigatório
statusstring · obrigatório
joined_atstring (date-time) · obrigatório

Erros 400 · 401

Permissões business:team:manage · Funções: admin, owner

curl -X PATCH "$BUSINESS_API/team/members/{id}/roles" \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
  "roles": [
    "role"
  ]
}'
Resposta 200
{
  "id": "tea_2CG53ca1REQBv6SPVO6TpaYfp4u",
  "user": {
    "id": "use_2ZtKedjGsDLWMRDGSD9S0vnswD5",
    "email": "ana.matsinhe@example.org",
    "phone": "+258841234567",
    "full_name": "Ana Matsinhe",
    "locale": "pt-MZ",
    "status": "active",
    "email_verified": true,
    "phone_verified": true,
    "created_at": "2026-11-19T09:30:00Z"
  },
  "roles": [
    "role"
  ],
  "status": "active",
  "joined_at": "2026-11-19T09:30:00Z"
}

Listar funções

Registos

GET /team/roles

Returns, in a data array, the role definitions that can be assigned in the caller's current team context, the same list used to validate invitations and role changes. Requires the team read permission.

Devolve

200 List the built-in roles of the utility context

Mostrar atributos
dataarray of RoleDefinition · obrigatório
Mostrar atributos filhos
namestring · obrigatório
contextstring · obrigatório

um de platform, tenant, consumer

descriptionstring · obrigatório
scopesarray of string · obrigatório

Erros 400 · 401

Permissões business:team:read · Funções: admin, owner

curl -X GET "$BUSINESS_API/team/roles" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
{
  "data": [
    {
      "name": "Ana Matsinhe",
      "context": "platform",
      "description": "Leitura confirmada no local.",
      "scopes": [
        "scope"
      ]
    }
  ]
}