curl --request POST \
--url https://api.example.com/organizations/{organizationId}/roles \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"slug": "<string>",
"name": "<string>",
"description": "<string>",
"permissions": [
"<string>"
]
}
'{
"roleId": "role_org_custom_editor",
"organizationId": "019525fd-4c38-7e30-a5c1-b6e3f4d8a9c2",
"slug": "custom-editor",
"name": "Custom Editor",
"description": "Optional description",
"type": "ORGANIZATION_ROLE",
"permissions": ["users:read", "roles:read"],
"inherited": false,
"createdAt": "2026-03-25T14:00:00.000Z",
"updatedAt": "2026-03-25T14:00:00.000Z"
}
Criar um role customizado da organizacao com um conjunto especifico de permissoes.
curl --request POST \
--url https://api.example.com/organizations/{organizationId}/roles \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"slug": "<string>",
"name": "<string>",
"description": "<string>",
"permissions": [
"<string>"
]
}
'{
"roleId": "role_org_custom_editor",
"organizationId": "019525fd-4c38-7e30-a5c1-b6e3f4d8a9c2",
"slug": "custom-editor",
"name": "Custom Editor",
"description": "Optional description",
"type": "ORGANIZATION_ROLE",
"permissions": ["users:read", "roles:read"],
"inherited": false,
"createdAt": "2026-03-25T14:00:00.000Z",
"updatedAt": "2026-03-25T14:00:00.000Z"
}
curl -X POST https://api.awsales.io/studio/organizations/ORG_ID/roles \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"slug": "custom-editor",
"name": "Custom Editor",
"description": "Can edit content but not manage users",
"permissions": ["content:read", "content:write"]
}'
roles:write.["users:read", "roles:read"]).ENVIRONMENT_ROLE ou ORGANIZATION_ROLE).{
"roleId": "role_org_custom_editor",
"organizationId": "019525fd-4c38-7e30-a5c1-b6e3f4d8a9c2",
"slug": "custom-editor",
"name": "Custom Editor",
"description": "Optional description",
"type": "ORGANIZATION_ROLE",
"permissions": ["users:read", "roles:read"],
"inherited": false,
"createdAt": "2026-03-25T14:00:00.000Z",
"updatedAt": "2026-03-25T14: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 |
409 | role.slug_already_exists | O slug do role ja esta em uso |
404 | permission.not_found | Uma ou mais permissoes nao existem |
500 | internal_server_error | Ocorreu um erro inesperado |