Axuz Developers

POST /teams/{teamId}/admin/custom-roles

— Bug #29 / Sessão 9 — Custom roles are a Business+ feature.

  • Acesso: Admin da equipe
  • Serviço: https://api.axuz.net

Autenticação aceita

  • sessionCookie — Sessão plena Axuz (cookie de sessão da casa). Sessão restrita é 403 enrollment_required.
  • bearerSession — JWT de acesso da sessão em `Authorization: Bearer`.

— Bug #29 / Sessão 9 — Custom roles are a Business+ feature. The plan gate is enforced primarily on the frontend (roles/page.tsx reads the active subscription and hides the modal). Backend defense-in-depth (HTTP call out to axuz_billing_api to verify plan.tier ∈ {business,enterprise}) is deferred until we ship a general entitlement helper — see briefing.txt Fase de entitlements. Until then, an admin who bypasses the UI can still create custom-roles rows; downstream enforcement (permission grants do not bypass natural member RBAC) limits blast radius.

Parâmetros

NomeEmTipoObrigatórioDescrição
teamIdpathstringsim

Corpo da requisição

Corpo JSON. O schema detalhado deste endpoint ainda não está tipado na spec; veja a descrição da operação.

application/json

NomeTipoObrigatórioDescrição
(corpo)objectnão
{}

Respostas

200

TBD

401

Sem credencial valida

NomeTipoObrigatórioDescrição
errorstringsim

403

Sem permissao (nao e owner/admin; token sem escopo; token de integracao em rota nao permitida)

NomeTipoObrigatórioDescrição
errorstringsim

429

Limite de requisições excedido.

NomeTipoObrigatórioDescrição
errorstringsim

500

Erro interno. Tente de novo com backoff; reporte o X-Request-Id.

NomeTipoObrigatórioDescrição
errorstringsim

Exemplos

O "Try it" está desligado nesta referência. Use os exemplos com a sua credencial de teste.

curl

curl -sS -X POST 'https://api.axuz.net/teams/TEAM_ID/admin/custom-roles' \
  -H "Authorization: Bearer $AXUZ_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Node.js

const res = await fetch("https://api.axuz.net/teams/TEAM_ID/admin/custom-roles", {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.AXUZ_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({}),
});
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
console.log(await res.json());

Python

import os
import requests

res = requests.request(
    "POST",
    "https://api.axuz.net/teams/TEAM_ID/admin/custom-roles",
    headers={
        "Authorization": f"Bearer {os.environ['AXUZ_TOKEN']}",
    },
    json={},
    timeout=30,
)
res.raise_for_status()
print(res.json())