1. Docs
  2. API Reference
  3. Give an integration a role

Give an integration a role

POST/api/v1/organizations/{id}/oauth-clients/{clientId}/assignments

Gives an integration a role at a node inside its organization. The role must be one the organization may give integrations (403 organization.integration_role_not_grantable) and within the granting administrator's ceiling (403 assignment.grant_ceiling); a node outside the organization answers 409 oauth.client_outside_organization.

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
clientIdstring Required

Request body

application/json

node_idstring Required

The node the role is held at.

role_idstring Required

The role the client holds there.

effective_fromstring Optional

When the role starts to apply. Omitted, from now.

effective_tostring Optional

When the role stops applying. Omitted, never.

Responses

application/json

  • dataAssignmentResponseDto*

application/json

  • errorApiErrorBodyDto*

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, and a correlation_id (also sent as the X-Correlation-Id header). Quote the correlation id when you contact support: it identifies the exact request in Canopy's logs.

403organization.integrations_disabledForbidden
When it happens

The Environment does not let organizations create integrations: <code>organization_integrations_enabled</code> is off, which it is by default. Every route under <code>/api/v1/organizations/{org_id}/oauth-clients</code> answers this until the developer turns it on.

Remediation

Turn on <strong>Let organizations create integrations</strong> on <strong>Tenant → Authentication → Tokens</strong> and choose <strong>Roles integrations may hold</strong>, or send <code>organization_integrations_enabled: true</code> with <code>organization_integration_role_ids</code> to the Environment's auth settings.

403organization.integration_role_not_grantableForbidden
When it happens

The role is not one an integration may hold: it is not among the Environment's <strong>Roles integrations may hold</strong>, or it has since gained <code>canopy:organization.manage</code> or <code>canopy:access.manage</code>.

Remediation

Give a role from <code>GET /api/v1/organizations/{org_id}/oauth-client-roles</code>. To offer another, the developer adds it under <strong>Roles integrations may hold</strong> on <strong>Tenant → Authentication → Tokens</strong>.

403assignment.grant_ceilingForbidden
When it happens

The caller is an identity (a customer's own administrator, acting with its session token) granting a role it may not: the role carries a permission the caller does not hold at the target node or above. Applies to creating an assignment (the organization's assignments route included), changing an assignment's role, and creating an invitation that carries a role. Console users, API keys, and the organization's own administrator inside its organization are never bounded; removing an assignment never is.

Remediation

Grant a role whose every permission the caller holds at that node, read the roles the caller may grant from <code>GET /api/v1/organizations/{id}/nodes/{nodeId}/grantable-roles</code> and offer only those, or make the change with your API key.

404organization.integration_not_foundNot found
When it happens

No integration with that <code>client_id</code> belongs to the organization. A machine client the developer pinned to the organization is not one of its integrations and reads as not found here.

Remediation

List the organization's integrations (<code>GET /api/v1/organizations/{org_id}/oauth-clients</code>) and use a <code>client_id</code> from there. Manage a developer's client on <code>/api/v1/oauth-clients</code>.

409oauth.client_outside_organizationConflict
When it happens

A role was given to a machine client pinned to an organization at a node outside that organization. A pinned client holds roles only at the organization's node or beneath it.

Remediation

Give the role at the organization's node or a node beneath it. A client that must act across the Environment is registered without an organization.

Returned object

Request
curl -X POST "https://auth.canopy-io.com/api/v1/organizations/value/oauth-clients/value/assignments" \
  -H "X-API-Key: $CANOPY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "node_id": "string",
    "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
GETWhat the caller administers in an organization
GETList the organization's tree as the caller sees it
GETList who holds a role at a node in the organization
GETSummarize who holds a role at a node in the organization
GETList the roles the caller may grant at a node
GETList the organization's members, for granting a role at a node
POSTGrant a role at a node beneath the organization
PATCHChange a grant in the organization
DELETETake a grant in the organization away
GETList organizations
POSTCreate an organization
DELETEDelete every organization
GETGet an organization
PATCHUpdate an organization
DELETEDelete an organization
GETGet an organization's authentication policy
PATCHUpdate an organization's authentication policy
POSTRegenerate the organization's SSO recovery codes
POSTStart a test sign-in on the organization's connection
GETRead the organization's test sign-in
GETList the organization's domain claims
POSTClaim a domain for the organization
POSTVerify one of the organization's domains
DELETERemove one of the organization's domain claims
GETList an organization's SSO connections
POSTBind an SSO connection to an organization
DELETEUnbind an SSO connection from an organization
GETList an organization's members
POSTAdd a member to an organization
DELETERemove a member from an organization
POSTReset a member's multi-factor authentication
GETList an organization's invitations
POSTInvite a member into an organization
GETList the roles an organization may assign
DELETERevoke an organization invitation
GETGet an organization's SSO connection
POSTSet up an organization's SSO connection
PATCHChange an organization's SSO connection
DELETERemove an organization's SSO connection
POSTActivate an organization's SSO connection
POSTDisable an organization's SSO connection
POSTImport the identity provider's SAML metadata
GETList the connection's recent sign-ins
GETList the roles the organization's SSO sign-ins may arrive with
GETGet the service-provider values for an organization's SSO connection
GETGet an organization's directory connection
POSTCreate an organization's directory connection
DELETERemove an organization's directory connection
GETList an organization's directory-sync tokens
POSTMint a directory-sync token for an organization
POSTReplace a directory-sync token without an outage
DELETERevoke a directory-sync token
GETRecent directory-sync activity for an organization
GETList the roles an organization's directory may grant
PUTReplace the roles an organization's directory may grant
GETList an organization's integrations
POSTCreate an integration
GETList the roles an organization may give its integrations
GETGet one of an organization's integrations
PATCHRename, disable or enable an integration
DELETEDelete an integration
POSTRotate an integration's secret
GETList an integration's roles
PATCHChange one of an integration's roles
DELETETake one of an integration's roles away
GETList the groups an organization's provider has pushed
PUTMap a pushed group to one of the available roles
DELETEClear a pushed group's role mapping
Was this page helpful?

Tell us how we can improve this guide.