1. Docs
  2. API Reference
  3. Change the role a pending invite grants

Change the role a pending invite grants

PATCH/portal/v1/accounts/{accountSlug}/user-invites/{id}

Replaces the administrator role (and scope) a pending invitation will grant on acceptance, so a mistake can be corrected without revoking and resending. Requires admin_governance.manage.

Authentication

Bearer TokenAuthorization

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

Requires capability administrators.manageGovernance

Invite, deactivate, and remove administrators. Granted through an administrator role in the Admin Workspace; a valid token without it is refused with 403.

Path Parameters

idstring Required

Request body

application/json

admin_role_idstring Required

Administrator role the invitee holds on acceptance

scope_typeenum Required

How far the granted authority reaches. Must match the role's scope.

one of "account" · "environment" · "node"

environment_idstring Optional

Environment the authority applies within — required unless scope_type is 'account'

application_node_idstring Optional

Hierarchy node — required when scope_type is 'node'

Responses

application/json

  • dataUserInviteResponseDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

Errors

When the request can't be completed, the response body includes a stable error code you can branch on.

403account.capability_requiredForbidden
When it happens

The signed-in user's administrator roles do not grant the capability this endpoint requires.

Remediation

Ask an account administrator to grant a role carrying the capability named in the Authentication section, then retry.

Returned object

Request
curl -X PATCH "https://auth.canopy-io.com/portal/v1/accounts/{accountSlug}/user-invites/value" \
  -H "Authorization: Bearer $CANOPY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "admin_role_id": "string",
    "scope_type": "account",
    "environment_id": "string",
    "application_node_id": "string"
  }'
Response
{
  "data": {
    "id": "string",
    "email": "string",
    "first_name": "string",
    "last_name": "string",
    "name": "string",
    "status": "pending",
    "expires_at": "2026-04-20T12:00:00.000Z",
    "invited_by": "string",
    "created_at": "2026-04-20T12:00:00.000Z",
    "is_administrator_invite": false,
    "admin_role_id": "string",
    "environment_id": "string",
    "scope_type": "account",
    "application_node_id": "string"
  }
}
Related endpoints
GETList invites
POSTCreate an invite
GETGet invite summary
POSTResend an invite
DELETERevoke an invite
Was this page helpful?

Tell us how we can improve this guide.