PUT /teams/{teamId}/admin/custom-roles/{roleId}/permissions
Replaces the permission set for a custom role in one transaction.
- 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`.
Replaces the permission set for a custom role in one transaction. Body: {permissions: ["files:read", ...]}. Permissions are matched by permissions.code; unknown codes are silently dropped so a stale UI can't poison the grant — the response echoes back the applied + ignored sets for transparency.
The delete-then-insert pattern is simpler than diffing the sets and the table is tiny (a role has ~20 grants max); transaction keeps the role from ending up half-empty if the second statement fails.
Parâmetros
| Nome | Em | Tipo | Obrigatório | Descrição |
|---|---|---|---|---|
teamId | path | string | sim | |
roleId | path | string | sim |
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
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
(corpo) | object | não |
{}Respostas
200
TBD
401
Sem credencial valida
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
403
Sem permissao (nao e owner/admin; token sem escopo; token de integracao em rota nao permitida)
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
429
Limite de requisições excedido.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
500
Erro interno. Tente de novo com backoff; reporte o X-Request-Id.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
Exemplos
O "Try it" está desligado nesta referência. Use os exemplos com a sua credencial de teste.
curl
curl -sS -X PUT 'https://api.axuz.net/teams/TEAM_ID/admin/custom-roles/ROLE_ID/permissions' \
-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/ROLE_ID/permissions", {
method: 'PUT',
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(
"PUT",
"https://api.axuz.net/teams/TEAM_ID/admin/custom-roles/ROLE_ID/permissions",
headers={
"Authorization": f"Bearer {os.environ['AXUZ_TOKEN']}",
},
json={},
timeout=30,
)
res.raise_for_status()
print(res.json())