Skip to main content
GET
/
organizations
/
{organizationId}
/
roles
Listar Roles
curl --request GET \
  --url https://api.example.com/organizations/{organizationId}/roles \
  --header 'Authorization: <authorization>'
[
  {
    "roleId": "role_env_admin",
    "slug": "admin",
    "name": "Admin",
    "description": "Full access to all resources",
    "type": "ENVIRONMENT_ROLE",
    "permissions": ["users:read", "users:write", "roles:read", "roles:write"],
    "inherited": true,
    "createdAt": "2026-01-01T00:00:00.000Z",
    "updatedAt": "2026-01-01T00:00:00.000Z"
  },
  {
    "roleId": "role_org_custom_editor",
    "organizationId": "019525fd-4c38-7e30-a5c1-b6e3f4d8a9c2",
    "slug": "custom-editor",
    "name": "Custom Editor",
    "description": "Custom role for this organization",
    "type": "ORGANIZATION_ROLE",
    "permissions": ["users:read"],
    "inherited": false,
    "createdAt": "2026-03-01T00:00:00.000Z",
    "updatedAt": "2026-03-01T00:00:00.000Z"
  }
]
Retorna uma lista de roles.
curl https://api.awsales.io/studio/organizations/ORG_ID/roles \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
A resposta inclui tanto roles herdados do ambiente quanto roles customizados da organizacao. Use o campo type para distingui-los.
Requer permissao roles:read.

Cabecalhos

Authorization
string
required
Token bearer.

Parametros de Rota

organizationId
string
required
O UUID da organizacao.

Resposta

A resposta e um array de objetos de role.
[
  {
    "roleId": "role_env_admin",
    "slug": "admin",
    "name": "Admin",
    "description": "Full access to all resources",
    "type": "ENVIRONMENT_ROLE",
    "permissions": ["users:read", "users:write", "roles:read", "roles:write"],
    "inherited": true,
    "createdAt": "2026-01-01T00:00:00.000Z",
    "updatedAt": "2026-01-01T00:00:00.000Z"
  },
  {
    "roleId": "role_org_custom_editor",
    "organizationId": "019525fd-4c38-7e30-a5c1-b6e3f4d8a9c2",
    "slug": "custom-editor",
    "name": "Custom Editor",
    "description": "Custom role for this organization",
    "type": "ORGANIZATION_ROLE",
    "permissions": ["users:read"],
    "inherited": false,
    "createdAt": "2026-03-01T00:00:00.000Z",
    "updatedAt": "2026-03-01T00:00:00.000Z"
  }
]

Codigos de Erro

StatusCodigoDescricao
400validation_errorEntrada invalida ou campos obrigatorios ausentes
401unauthorizedAutenticacao ausente ou invalida
403forbiddenPermissoes insuficientes
404organization.not_foundOrganizacao nao encontrada
500internal_server_errorOcorreu um erro inesperado