Create an invite
/portal/v1/accounts/{accountSlug}/user-invitesCreates a single identity invite in the active Environment and returns it along with a tokenized accept_url. The effective intent is derived server-side from existing identity state — a net-new email becomes activate, an existing identity without active access becomes add_to_app, and password_reset is honored only for an existing identity. An optional role_id + node_id pair (both or neither) seeds an initial role assignment applied at acceptance. Invites expire after 7 days; the email is sent unless send_email: false, in which case the caller delivers accept_url itself. A duplicate pending invite for the same recipient returns 409.
Authentication
AuthorizationJWT access token. Never send alongside X-API-Key: a request carrying both is refused.
administrators.manageGovernanceInvite, deactivate, and remove administrators. Granted through an administrator role in the Admin Workspace; a valid token without it is refused with 403.
Request body
application/json
emailstring Required first_namestring Required last_namestring Required admin_role_idstring Required Administrator role the invitee holds on acceptance. The membership and the grant are created together.
scope_typeenum Required How far the granted authority reaches. Must match the role's scope.
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
data *UserInviteResponseDto
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.
account.capability_requiredForbiddenThe signed-in user's administrator roles do not grant the capability this endpoint requires.
Ask an account administrator to grant a role carrying the capability named in the Authentication section, then retry.
Returned object
curl -X POST "https://auth.canopy-io.com/portal/v1/accounts/{accountSlug}/user-invites" \ -H "Authorization: Bearer $CANOPY_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "email": "string", "first_name": "string", "last_name": "string", "admin_role_id": "string", "scope_type": "account", "environment_id": "string", "application_node_id": "string" }'
{ "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" } }
Tell us how we can improve this guide.