Revoke all active sessions for an identity
/portal/v1/accounts/{accountSlug}/identities/{id}/revoke-sessionsRevokes every active session / refresh token for one identity across all Environments, forcing re-authentication everywhere — the primary incident-response action for a suspected-compromised account. Does not deactivate or delete the identity; profile, memberships, and assignments are untouched. An optional reason is recorded on the session.all_revoked audit row, and the count of revoked sessions is returned. Returns 404 when the identity is not found.
Authentication
AuthorizationJWT access token. Never send alongside X-API-Key: a request carrying both is refused.
identities.manageIdentitiesManage end-user identities across the account. 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
reasonstring Optional Optional human-readable reason recorded on the audit row (e.g. 'phishing-reported', 'password-compromise', 'policy-change'). Surfaces in the identity's activity feed during incident review.
Responses
application/json
data *RevokeSessionsResponseDto
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.
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}/identities/value/revoke-sessions" \ -H "Authorization: Bearer $CANOPY_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "reason": "string" }'
{ "data": { "message": "string", "revoked_count": 0 } }
Tell us how we can improve this guide.