1. Docs
  2. API Reference
  3. Change a machine client's assignment

Change a machine client's assignment

PATCH/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 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.

Path Parameters

idstring Required
assignmentIdstring Required

Headers

  • If-Match

    Optimistic-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

  • dataAssignmentResponseDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

Returned object

Request
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"
  }'
Response
{
  "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
  }
}
Related endpoints
GETList OAuth clients for Application
POSTRegister a new OAuth client
GETActive/inactive OAuth client counts for the environment
GETGet OAuth client details
PATCHUpdate OAuth client
DELETEDelete OAuth client
POSTRotate an OAuth client's secret
GETList a machine client's role assignments
POSTAssign a role to a machine client at a node
DELETERemove a machine client's assignment
GETGet where a machine client holds each permission
Was this page helpful?

Tell us how we can improve this guide.