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"
}
]
Obter todos os roles da organizacao, incluindo roles herdados do ambiente e roles customizados da organizacao.
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"
}
]
curl https://api.awsales.io/studio/organizations/ORG_ID/roles \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
type para distingui-los.roles:read.[
{
"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"
}
]
| Status | Codigo | Descricao |
|---|---|---|
400 | validation_error | Entrada invalida ou campos obrigatorios ausentes |
401 | unauthorized | Autenticacao ausente ou invalida |
403 | forbidden | Permissoes insuficientes |
404 | organization.not_found | Organizacao nao encontrada |
500 | internal_server_error | Ocorreu um erro inesperado |