curl --request PATCH \
--url https://api.example.com/organizations/{organizationId}/roles/{slug} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"permissions": [
"<string>"
]
}
'{
"roleId": "role_org_custom_editor",
"organizationId": "019525fd-4c38-7e30-a5c1-b6e3f4d8a9c2",
"slug": "custom-editor",
"name": "Updated Editor",
"description": "Updated custom role description",
"type": "ORGANIZATION_ROLE",
"permissions": ["users:read", "users:write", "roles:read"],
"inherited": false,
"createdAt": "2026-03-25T14:00:00.000Z",
"updatedAt": "2026-03-25T14:30:00.000Z"
}
Atualizar nome, descricao ou permissoes de um role customizado da organizacao.
curl --request PATCH \
--url https://api.example.com/organizations/{organizationId}/roles/{slug} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"permissions": [
"<string>"
]
}
'{
"roleId": "role_org_custom_editor",
"organizationId": "019525fd-4c38-7e30-a5c1-b6e3f4d8a9c2",
"slug": "custom-editor",
"name": "Updated Editor",
"description": "Updated custom role description",
"type": "ORGANIZATION_ROLE",
"permissions": ["users:read", "users:write", "roles:read"],
"inherited": false,
"createdAt": "2026-03-25T14:00:00.000Z",
"updatedAt": "2026-03-25T14:30:00.000Z"
}
curl -X PATCH https://api.awsales.io/studio/organizations/ORG_ID/roles/custom-editor \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Editor",
"permissions": ["content:read", "content:write", "content:publish"]
}'
403 role.cannot_modify_inherited.roles:write.ENVIRONMENT_ROLE ou ORGANIZATION_ROLE).{
"roleId": "role_org_custom_editor",
"organizationId": "019525fd-4c38-7e30-a5c1-b6e3f4d8a9c2",
"slug": "custom-editor",
"name": "Updated Editor",
"description": "Updated custom role description",
"type": "ORGANIZATION_ROLE",
"permissions": ["users:read", "users:write", "roles:read"],
"inherited": false,
"createdAt": "2026-03-25T14:00:00.000Z",
"updatedAt": "2026-03-25T14:30:00.000Z"
}
| Status | Codigo | Descricao |
|---|---|---|
400 | validation_error | Entrada invalida ou campos obrigatorios ausentes |
401 | unauthorized | Autenticacao ausente ou invalida |
403 | forbidden | Permissoes insuficientes |
403 | role.cannot_modify_inherited | Nao e possivel modificar um role herdado |
404 | organization.not_found | Organizacao nao encontrada |
404 | role.not_found | Role nao encontrado |
404 | permission.not_found | Uma ou mais permissoes nao existem |
500 | internal_server_error | Ocorreu um erro inesperado |