Give an integration a role
/api/v1/organizations/{id}/oauth-clients/{clientId}/assignmentsGives 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
Authorization Option A JWT access token. Never send alongside X-API-Key: a request carrying both is refused.
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 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
data *AssignmentResponseDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
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.
organization.integrations_disabledForbiddenThe 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.
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.
organization.integration_role_not_grantableForbiddenThe 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>.
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>.
assignment.grant_ceilingForbiddenThe 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.
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.
organization.integration_not_foundNot foundNo 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.
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>.
oauth.client_outside_organizationConflictA 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.
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
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" }'
{ "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.