Move or re-role an existing assignment
/portal/v1/accounts/{accountSlug}/applications/{appSlug}/environments/{envSlug}/workspace/assignments/{assignmentId}Moves an assignment to another node, changes its role, or reschedules it, and records an assignment.updated audit event. For the dates, an omitted field is left unchanged and null clears that end of the window. Requires access.assign at the assignment's current node and, when moving, at the destination. A new role must also be on the caller's grant ceiling; otherwise the response is 403. A request that changes nothing returns the assignment as it is. Returns 404 for an assignment, destination node or active role not in the Environment, 400 for a system role or an inverted date window, and 409 when the identity already holds the target role at the target node.
Authentication
AuthorizationJWT access token. Never send alongside X-API-Key: a request carrying both is refused.
Path Parameters
accountSlugstring Required The Account's slug. An unknown one answers 404.
appSlugstring Required The Application's slug within the Account.
envSlugstring Required The Environment's slug within the Application.
assignmentIdstring Required Headers
If-MatchOptimistic-lock version of the resource. Send the `version` field returned on read; the server rejects with 409 if the row has changed since.
Request body
application/json
nodeIdstring Optional roleIdstring Optional effectiveFromstring Optional When access begins; null clears it so access starts now
effectiveTostring Optional When access ends; null clears it so access never expires
Responses
application/json
data *WorkspaceAssignmentResponseDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
Returned object
curl -X PATCH "https://auth.canopy-io.com/portal/v1/accounts/value/applications/value/environments/value/workspace/assignments/value" \ -H "If-Match: "3"" \ -H "Authorization: Bearer $CANOPY_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "nodeId": "string", "roleId": "string", "effectiveFrom": "string", "effectiveTo": "string" }'
{ "data": { "id": "string", "identity_id": "string", "application_node_id": "string", "role_id": "string", "effective_from": "2026-04-20T12:00:00.000Z", "effective_to": "2026-04-20T12:00:00.000Z", "created_at": "2026-04-20T12:00:00.000Z" } }
Tell us how we can improve this guide.