PT EN

Empresa

URL base: $BUSINESS_API

O objecto

keystring · obrigatório
versionstring · obrigatório
namestring · obrigatório
descriptionstring · opcional
settingsobject · obrigatório

Portable setting snapshots. Implemented kinds are tariffs, billing_schedules, automation_rules, notification_templates, and connector_definitions. Secret references, health state, customer data, and other tenant records are rejected or omitted; connectors are created disabled and schedules remain paused.

idstring · obrigatório
organization_idstring · obrigatório
statestring · obrigatório

um de draft, published

created_bystring · obrigatório
published_bystring · opcional
published_atstring (date-time) · opcional
created_atstring (date-time) · obrigatório
O objecto
[
  {
    "key": "key",
    "version": "version",
    "name": "Ana Matsinhe",
    "description": "Leitura confirmada no local.",
    "settings": {},
    "id": "org_2sCTxsOpzeEdvmgLlwMjjwUVH08",
    "organization_id": "org_2ZNeUPlw01Za6RbKMZDGGbR4cV5",
    "state": "draft",
    "created_by": "created by",
    "published_by": "published by",
    "published_at": "2026-11-19T09:30:00Z",
    "created_at": "2026-11-19T09:30:00Z"
  }
]

Listar modelos de organização disponíveis

Registos

GET /tenant/organization-templates

List published templates from the account's administrative organization

Returns the published templates of the organization that administers this tenant, taken from the active organization link or else the owning organization. The list is empty when the tenant has neither. Only utility staff with business:organization:read can call it.

Devolve

200 Published templates available for explicit adoption

Mostrar atributos
keystring · obrigatório
versionstring · obrigatório
namestring · obrigatório
descriptionstring · opcional
settingsobject · obrigatório

Portable setting snapshots. Implemented kinds are tariffs, billing_schedules, automation_rules, notification_templates, and connector_definitions. Secret references, health state, customer data, and other tenant records are rejected or omitted; connectors are created disabled and schedules remain paused.

idstring · obrigatório
organization_idstring · obrigatório
statestring · obrigatório

um de draft, published

created_bystring · obrigatório
published_bystring · opcional
published_atstring (date-time) · opcional
created_atstring (date-time) · obrigatório

Erros 403

Permissões business:organization:read · Funções: admin, analyst, billing_clerk, customer_service, field_reader, field_supervisor, finance, operations, owner, viewer

curl -X GET "$BUSINESS_API/tenant/organization-templates" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
[
  {
    "key": "key",
    "version": "version",
    "name": "Ana Matsinhe",
    "description": "Leitura confirmada no local.",
    "settings": {},
    "id": "org_2sCTxsOpzeEdvmgLlwMjjwUVH08",
    "organization_id": "org_2ZNeUPlw01Za6RbKMZDGGbR4cV5",
    "state": "draft",
    "created_by": "created by",
    "published_by": "published by",
    "published_at": "2026-11-19T09:30:00Z",
    "created_at": "2026-11-19T09:30:00Z"
  }
]

Listar modelos propostos a esta conta

Registos

GET /tenant/organization-template-adoptions

Returns every template adoption recorded for the caller's tenant, with its state (pending_acceptance, active or detached), version and organization. Only utility staff with business:organization:read can call it.

Devolve

200 Pending and active organization template adoptions for the authenticated tenant

Mostrar atributos
idstring · obrigatório
template_idstring · obrigatório
organization_idstring · obrigatório
tenant_idstring · obrigatório
versionstring · obrigatório
statestring · obrigatório

um de pending_acceptance, active, detached

accepted_bystring · opcional
accepted_atstring (date-time) · opcional
applied_atstring (date-time) · opcional
detached_atstring (date-time) · opcional
created_atstring (date-time) · obrigatório

Erros 403

Permissões business:organization:read · Funções: admin, analyst, billing_clerk, customer_service, field_reader, field_supervisor, finance, operations, owner, viewer

curl -X GET "$BUSINESS_API/tenant/organization-template-adoptions" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
[
  {
    "id": "org_27V0IXXc4PdUU9dGwVzoc5xWqTd",
    "template_id": "tem_2wwLTWQZrCq3poE3JiMXbI6xTEk",
    "organization_id": "org_2ZNeUPlw01Za6RbKMZDGGbR4cV5",
    "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
    "version": "version",
    "state": "pending_acceptance",
    "accepted_by": "accepted by",
    "accepted_at": "2026-11-19T09:30:00Z",
    "applied_at": "2026-11-19T09:30:00Z",
    "detached_at": "2026-11-19T09:30:00Z",
    "created_at": "2026-11-19T09:30:00Z"
  }
]

Aceitar um modelo de organização

Registos

POST /tenant/organization-templates/{templateID}/accept

Accept and apply a pending organization template as the account owner

Applies the template's settings to the caller's tenant and marks the adoption active. Accepting an adoption that is already active returns it unchanged; one that is detached returns 409, and 404 is returned when the template has been changed or unpublished since the adoption was requested. Only a tenant owner can call it, and the acceptance is written to the organization's audit trail.

Parâmetros

templateIDstring · caminho · obrigatório

ID of the organization template whose pending adoption is accepted.

Devolve

200 Template copied and adoption recorded

Mostrar atributos
idstring · obrigatório
template_idstring · obrigatório
organization_idstring · obrigatório
tenant_idstring · obrigatório
versionstring · obrigatório
statestring · obrigatório

um de pending_acceptance, active, detached

accepted_bystring · opcional
accepted_atstring (date-time) · opcional
applied_atstring (date-time) · opcional
detached_atstring (date-time) · opcional
created_atstring (date-time) · obrigatório

Erros 403 · 404

Permissões business:organization:read · Funções: admin, analyst, billing_clerk, customer_service, field_reader, field_supervisor, finance, operations, owner, viewer

curl -X POST "$BUSINESS_API/tenant/organization-templates/{templateID}/accept" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
{
  "id": "org_27V0IXXc4PdUU9dGwVzoc5xWqTd",
  "template_id": "tem_2wwLTWQZrCq3poE3JiMXbI6xTEk",
  "organization_id": "org_2ZNeUPlw01Za6RbKMZDGGbR4cV5",
  "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
  "version": "version",
  "state": "pending_acceptance",
  "accepted_by": "accepted by",
  "accepted_at": "2026-11-19T09:30:00Z",
  "applied_at": "2026-11-19T09:30:00Z",
  "detached_at": "2026-11-19T09:30:00Z",
  "created_at": "2026-11-19T09:30:00Z"
}

Desligar um modelo de organização

Registos

DELETE /tenant/organization-templates/{templateID}

Detach the account from a shared template while keeping copied settings

Moves an active adoption to detached and records the time, so later versions of the template are no longer tied to this tenant. Only a tenant owner can call it (403 otherwise); 404 when the tenant has no adoption of that template and 409 when the adoption is not active. The action is written to the organization's audit trail.

Parâmetros

templateIDstring · caminho · obrigatório

ID of the organization template whose adoption is detached.

Devolve

200 Adoption detached; copied account settings are retained

Mostrar atributos
idstring · obrigatório
template_idstring · obrigatório
organization_idstring · obrigatório
tenant_idstring · obrigatório
versionstring · obrigatório
statestring · obrigatório

um de pending_acceptance, active, detached

accepted_bystring · opcional
accepted_atstring (date-time) · opcional
applied_atstring (date-time) · opcional
detached_atstring (date-time) · opcional
created_atstring (date-time) · obrigatório

Erros 403 · 404

Permissões business:organization:read · Funções: admin, analyst, billing_clerk, customer_service, field_reader, field_supervisor, finance, operations, owner, viewer

curl -X DELETE "$BUSINESS_API/tenant/organization-templates/{templateID}" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
{
  "id": "org_27V0IXXc4PdUU9dGwVzoc5xWqTd",
  "template_id": "tem_2wwLTWQZrCq3poE3JiMXbI6xTEk",
  "organization_id": "org_2ZNeUPlw01Za6RbKMZDGGbR4cV5",
  "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
  "version": "version",
  "state": "pending_acceptance",
  "accepted_by": "accepted by",
  "accepted_at": "2026-11-19T09:30:00Z",
  "applied_at": "2026-11-19T09:30:00Z",
  "detached_at": "2026-11-19T09:30:00Z",
  "created_at": "2026-11-19T09:30:00Z"
}

Listar associações a organizações por aprovar

Registos

GET /tenant/organization-links/pending

List organization link requests awaiting this tenant owner's consent

Returns the requests from organizations to link this tenant that are still waiting for a decision, so an owner can approve or reject them. Only a utility staff member holding the owner role can call it; anyone else receives 403.

Devolve

200 Pending organization link requests for the authenticated tenant

Mostrar atributos
idstring · obrigatório
organization_idstring · obrigatório
tenant_idstring · obrigatório
tenant_namestring · opcional
tenant_slugstring · opcional
statestring · obrigatório

um de pending_consent, active, removal_pending, removed, owned

consent_approved_bystring · obrigatório
consent_approved_atstring (date-time) · opcional
added_bystring · obrigatório
notice_period_untilstring (date-time) · opcional
grantsobject · obrigatório

Erros 403

Permissões business:organization:read · Funções: admin, analyst, billing_clerk, customer_service, field_reader, field_supervisor, finance, operations, owner, viewer

curl -X GET "$BUSINESS_API/tenant/organization-links/pending" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
[
  {
    "id": "org_2BfeY3PegjBaQbr8EdxWUjNy4BN",
    "organization_id": "org_2ZNeUPlw01Za6RbKMZDGGbR4cV5",
    "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
    "tenant_name": "Ana Matsinhe",
    "tenant_slug": "tenant slug",
    "state": "pending_consent",
    "consent_approved_by": "consent approved by",
    "consent_approved_at": "2026-11-19T09:30:00Z",
    "added_by": "added by",
    "notice_period_until": "2026-11-19T09:30:00Z",
    "grants": {
      "key": [
        "value"
      ]
    }
  }
]

Obter a configuração da empresa

Registos

GET /tenant

Returns the caller's tenant record: ID, slug, name, status, kind, workspace state, country, locale, currency and timezone, the owning organization, and any template or closure dates. Requires business:organization:read.

Devolve

200 Tenant configuration

Mostrar atributos
idstring · obrigatório
owner_organization_idstring · obrigatório
slugstring · obrigatório
namestring · obrigatório
statusstring · obrigatório

um de provisioning, active, suspended, closed

kindstring · obrigatório

um de live, sandbox

workspace_statestring · obrigatório

um de sandbox_only, unverified, verifying, live, restricted, suspended, closed, sandbox

parent_tenant_idstring · opcional
copied_from_tenant_idstring · opcional
template_keystring · opcional
closed_atstring · opcional · anulável
deletion_due_atstring · opcional · anulável
country_codestring · opcional
localestring · obrigatório
currencystring · obrigatório
timezonestring · obrigatório

Permissões business:organization:read · Funções: admin, analyst, billing_clerk, customer_service, field_reader, field_supervisor, finance, operations, owner, viewer

curl -X GET "$BUSINESS_API/tenant" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
{
  "id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
  "owner_organization_id": "own_2Hj8Qbz4glBOQR5aWPneq1JWux7",
  "slug": "slug",
  "name": "Ana Matsinhe",
  "status": "provisioning",
  "kind": "live",
  "workspace_state": "sandbox_only",
  "parent_tenant_id": "par_21NQMtrA6ldIklFucB3eoRxCqDB",
  "copied_from_tenant_id": "cop_2sEl3AsnbMmfvSknXeeX3YMH7WK",
  "template_key": "template key",
  "closed_at": "2026-11-19T09:30:00Z",
  "deletion_due_at": "2026-11-19T09:30:00Z",
  "country_code": "MZ",
  "locale": "pt",
  "currency": "MZN",
  "timezone": "Africa/Maputo"
}