Change a machine client's assignment
/api/v1/oauth-clients/{id}/assignments/{assignmentId}Changes the role or the window of one of the machine client's assignments; an assignment held by anyone else reads as 404. Send If-Match with the assignment's version to refuse a stale write (409 assignment.version_mismatch).
Authentication
Bearer Token
Authorization Option A JWT access token. Never send alongside X-API-Key: a request carrying both is refused.
API Key
X-API-Key Option B API key for management-tier access. Never send alongside an Authorization header: a request carrying both is refused.
Path Parameters
idstring Required 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
role_idstring Required effective_fromstring Optional effective_tostring Optional Responses
application/json
data *AssignmentResponseDto
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/api/v1/oauth-clients/value/assignments/value" \ -H "If-Match: "3"" \ -H "X-API-Key: $CANOPY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "role_id": "string", "effective_from": "string", "effective_to": "string" }'
{ "data": { "id": "string", "identity_id": "string", "oauth_client_id": "string", "application_node_id": "string", "role_id": "string", "role_name": "string", "node_name": "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", "updated_at": "2026-04-20T12:00:00.000Z", "version": 0 } }
Tell us how we can improve this guide.