1. Docs
  2. API Reference
  3. Logout and revoke tokens

Logout and revoke tokens

POST/v1/auth/logout

Revokes the current session and clears the refresh, pre-auth, and session-marker cookies. Guarded by UserJwtGuard; reads the refresh token from its cookie and accepts a revoke_all flag — when true, every active refresh token for the user is revoked (sign out everywhere) rather than just the current one. Returns the revoked_count.

Request body

application/json

revoke_allboolean Optional

Revoke all sessions

Responses

application/json

  • dataRevokeResponseDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

Returned object

Request
curl -X POST "https://auth.canopy-io.com/v1/auth/logout" \
  -H "Content-Type: application/json" \
  -d '{
    "revoke_all": false
  }'
Response
{
  "data": {
    "revoked_count": 0
  }
}
Related endpoints
POSTRegister a new user
POSTCreate an additional Account for the authenticated admin (no new user)
GETReview the parked account-creation intent before resuming
POSTResume a deferred account creation parked at the register form
DELETEDismiss the parked account-creation intent without creating anything
POSTLook up invite details by token
POSTAccept an invite
POSTAuthenticate and receive tokens
POSTSelect an Account from a pre-auth session (multi-Account login)
POSTSwitch the active Application in an authenticated session
POSTRefresh access token
GETVerify email address
POSTResend verification email
POSTResend verification email by token
POSTRequest password reset
POSTReset password with token
POSTChange password (authenticated)
GETGet current user profile
GETGet current user avatar image
POSTUpload profile avatar
DELETERemove profile avatar
POSTRequest an email-address change
POSTConfirm an email-address change
GETGet current user permissions
GETList the Accounts the current user belongs to
GETList active sessions
DELETERevoke all sessions
DELETERevoke a specific session
Was this page helpful?

Tell us how we can improve this guide.