1. Docs
  2. API Reference
  3. Grant an operational administrator

Grant an operational administrator

POST/portal/v1/accounts/{accountSlug}/admin-assignments

Authentication

Bearer TokenAuthorization

JWT access token. Never send alongside X-API-Key: a request carrying both is refused.

Request body

application/json

userIdstring Required

User receiving the administrator role

adminRoleIdstring Required

Administrator role to grant

environmentIdstring Optional

Environment the authority applies within — omitted for an account-wide grant

scopeTypeenum Required

How far the authority reaches: the whole Account, one Environment, or one hierarchy node and its descendants. Must match the role's scope.

one of "account" · "environment" · "node"

nodeIdstring Optional

Hierarchy node — required when scopeType is 'node'

effectiveFromstring Optional

When the authority becomes effective

effectiveTostring Optional

When the authority expires

Responses

application/json

  • dataAdminAssignmentResponseDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

Returned object

Request
curl -X POST "https://auth.canopy-io.com/portal/v1/accounts/{accountSlug}/admin-assignments" \
  -H "Authorization: Bearer $CANOPY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "userId": "string",
    "adminRoleId": "string",
    "environmentId": "string",
    "scopeType": "account",
    "nodeId": "string",
    "effectiveFrom": "string",
    "effectiveTo": "string"
  }'
Response
{
  "data": {
    "id": "string",
    "admin_role_id": "string",
    "user_id": "string",
    "environment_id": "string",
    "scope_type": "account",
    "application_node_id": "string",
    "effective_from": "2026-04-20T12:00:00.000Z",
    "effective_to": "2026-04-20T12:00:00.000Z",
    "revoked_at": "2026-04-20T12:00:00.000Z",
    "created_at": "2026-04-20T12:00:00.000Z",
    "updated_at": "2026-04-20T12:00:00.000Z"
  }
}
Related endpoints
GETList operational administrators in an Environment
DELETERevoke an operational administrator
Was this page helpful?

Tell us how we can improve this guide.