Team administration
Roles, audit, export, trash and moderation for owners/admins.
| Método | Path | Resumo | Access |
|---|---|---|---|
| GET | /teams/{teamId}/admin/audit | Is paginated and filterable. | Team admin |
| GET | /teams/{teamId}/admin/custom-roles | Responde GET /admin/custom-roles — devolve até 200 roles custom do team. | Team admin |
| POST | /teams/{teamId}/admin/custom-roles | — Bug #29 / Sessão 9 — Custom roles are a Business+ feature. | Team admin |
| DELETE | /teams/{teamId}/admin/custom-roles/{roleId} | Responde DELETE /admin/custom-roles/{roleId} — remove a role custom do team. | Team admin |
| POST | /teams/{teamId}/admin/custom-roles/{roleId}/assign/{userId} | Turns repeated calls into no-ops. | Team admin |
| DELETE | /teams/{teamId}/admin/custom-roles/{roleId}/assign/{userId} | Responde DELETE /admin/custom-roles/{roleId}/ assign/{userId} — remove a role custom da membership do user no team. | Team admin |
| PUT | /teams/{teamId}/admin/custom-roles/{roleId}/permissions | Replaces the permission set for a custom role in one transaction. | Team admin |
| GET | /teams/{teamId}/admin/export/audit.csv | Audit_events (Neon), streaming pra encoding/csv. | Team admin |
| GET | /teams/{teamId}/admin/export/audit.json | Responde GET /admin/export/audit.json — mesma data do exportAuditCSV, JSON pra piping (jq/scripts). | Team admin |
| GET | /teams/{teamId}/admin/export/members.csv | Responde GET /admin/export/members.csv — dump dos membros ativos paginando via ListMembers (keyset). | Team admin |
| GET | /teams/{teamId}/admin/export/members.json | Responde GET /admin/export/members.json — array JSON com membros ativos, via ListMembers keyset (mesmo shape do CSV). | Team admin |
| GET | /teams/{teamId}/admin/export/tasks.csv | Responde GET /admin/export/tasks.csv — dump das tarefas não deletadas com board/coluna e responsáveis (e-mails em uma célula), em streami... | Team admin |
| GET | /teams/{teamId}/admin/export/tasks.json | Responde GET /admin/export/tasks.json — array JSON das tarefas (assignees como slice de e-mails), em streaming por páginas. | Team admin |
| GET | /teams/{teamId}/admin/invites | Returns pending (not accepted, not revoked, not expired) team invites so admins can see who's been invited and re-send / revoke. | Team admin |
| POST | /teams/{teamId}/admin/invites | Creates a workspace-wide invite backed by the `team_invites` table (migration 045). | Team owner |
| DELETE | /teams/{teamId}/admin/invites/{inviteId} | Responde DELETE /admin/invites/{inviteId} — marca o team_invite como revoked_at=now(). | Team admin |
| DELETE | /teams/{teamId}/admin/members/{userId} | Sets membership.status='removed' so auth lookups fail. | Team admin |
| PUT | /teams/{teamId}/admin/members/{userId}/role | Body {role: 'owner'|'admin'|'member'|'guest'}. | Team admin |
| POST | /teams/{teamId}/admin/members/bulk/change-role | Aplica o mesmo `role` a até `bulkMaxItems` usuários do team. | Team admin |
| POST | /teams/{teamId}/admin/members/bulk/message | Cria uma notificação in-app pra até 100 usuários selecionados do team. | Team admin |
| POST | /teams/{teamId}/admin/members/bulk/remove | Marca membership.status='removed' pra até 100 users do team num único request. | Team admin |
| GET | /teams/{teamId}/admin/retention | Devolve a política do workspace, ou `trash_retention_days: null` com `effective_source: "global"` quando não há linha. | Team admin |
| PUT | /teams/{teamId}/admin/retention | Grava (upsert) o prazo do workspace; `trash_retention_days: null` APAGA a linha, devolvendo o workspace ao global — é a única forma de de... | Team admin |
| GET | /teams/{teamId}/admin/session-policy | Responde GET /admin/session-policy — devolve a policy (idle timeout, max concorrentes, 2FA-for-admins, invite domains, default invite role). | Team admin |
| PUT | /teams/{teamId}/admin/session-policy | Responde PUT /admin/session-policy — upsert da session_policies. | Team admin |
| GET | /teams/{teamId}/admin/settings | Responde GET /admin/settings — devolve workspace_branding (logo/colors/timezone/locale/custom_domain). | Team admin |
| PUT | /teams/{teamId}/admin/settings | Responde PUT /admin/settings — upsert do workspace_branding. | Team admin |
| DELETE | /teams/{teamId}/admin/team | — soft-delete do team. | Team owner |
| PATCH | /teams/{teamId}/admin/team-brand | — atualiza team brand. | Team admin |
| GET | /teams/{teamId}/admin/team-settings | Returns the team_settings row. | Team admin |
| PUT | /teams/{teamId}/admin/team-settings | Upserts the whole settings bag. | Team admin |
| GET | /teams/{teamId}/admin/trash | Responde GET /admin/trash — lista items soft-deleted do team para admins/owner. | Team admin |
| POST | /teams/{teamId}/admin/trash/purge | Responde POST /admin/trash/purge — DELETA fisicamente linha já soft-deleted. | Team admin |
| POST | /teams/{teamId}/admin/trash/restore | Responde POST /admin/trash/restore — anula deleted_at do registro (kind,id) trazendo de volta pro workspace. | Team admin |
| GET | /teams/{teamId}/moderation/bans | Responde GET /teams/{teamId}/moderation/bans — devolve os bans ativos (lifted_at IS NULL) do team, ordenados por mais recentes, cap 200. | Team admin |
| POST | /teams/{teamId}/moderation/bans | Responde POST /teams/{teamId}/moderation/bans — bane um user no escopo do team. | Team admin |
| DELETE | /teams/{teamId}/moderation/bans/{banId} | Responde DELETE /teams/{teamId}/moderation/bans/{banId} — revoga (soft) um ban, gravando lifted_at/lifted_by. | Team admin |
| GET | /teams/{teamId}/moderation/reports | Responde GET /teams/{teamId}/moderation/reports — fila do team, opcionalmente filtrada por status via query. | Team admin |
| POST | /teams/{teamId}/moderation/reports | Responde POST /teams/{teamId}/moderation/reports — qualquer membro do team pode reportar (entity_type ∈ post|feed_post|file|user). | Team member |
| POST | /teams/{teamId}/moderation/reports/{reportId}/resolve | Is the main moderation action. | Team admin |