1. Docs
  2. API Reference
  3. Bulk change role on assignments

Bulk change role on assignments

POST/api/v1/assignments/bulk-change-role

Reassigns a batch of existing assignments (assignment_ids) to a single new role_id in one atomic transaction. The target role must be active and non-system (400 otherwise); each assignment is authorized as rbac.manage_assignments at its node, and a change that would collide with an existing identity + role + node triple returns 409. All-or-nothing: any failure aborts the batch. Returns 200 with a { message } confirmation.

Authentication

Bearer TokenAuthorization Option A

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

API KeyX-API-Key Option B

API key for management-tier access. Never send alongside an Authorization header: a request carrying both is refused.

Request body

application/json

assignment_idsstring[] Required
role_idstring Required

Responses

application/json

  • dataMessageResponseDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

Returned object

Request
curl -X POST "https://auth.canopy-io.com/api/v1/assignments/bulk-change-role" \
  -H "X-API-Key: $CANOPY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "assignment_ids": [
      "string"
    ],
    "role_id": "string"
  }'
Response
{
  "data": {
    "message": "string"
  }
}
Related endpoints
GETList all assignments across the Application
GETGet App-wide assignment summary
POSTAssign a role to an identity at a node
PATCHUpdate an assignment
DELETERemove an assignment
POSTBulk remove assignments
POSTBulk-create role assignments. All-or-nothing: any failure rolls back the entire batch
Was this page helpful?

Tell us how we can improve this guide.