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

Bulk change role on assignments

POST/portal/v1/accounts/{accountSlug}/applications/{appSlug}/environments/{envSlug}/assignments/bulk-change-role

Authentication

  • Bearer Token Authorization

    JWT access token

Request body

  • assignment_idsstring[]*
  • role_idstring*

Code samples

cURLJavaScriptPythonGo
curl -X POST "https://api.canopy.dev/portal/v1/accounts/{accountSlug}/applications/{appSlug}/environments/{envSlug}/assignments/bulk-change-role" \
  -H "Authorization: Bearer $CANOPY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "assignment_ids": [
      "string"
    ],
    "role_id": "string"
  }'

Responses

200 Roles updated
{
  "message": "string"
}

application/json

  • messagestring*
400 System roles cannot be assigned to identities — they are reserved for platform administration
401 Invalid or expired token
403 This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)

Returned object

On this page

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