TypeScript SDK — Account Services: OAuth Token Revocation
Low-level OAuth token revocation endpoint. This method is on client.account.
See the API specifications for the full request/response schema and the authentication guide for OAuth setup.
Methods
revokeOAuthToken
POST /v1/oauth/revokeByToken · Authenticated
Revokes the current OAuth access and refresh tokens. This is the low-level REST endpoint — most users should use OAuthAuth.revoke() instead, which handles token lifecycle, store cleanup, and calls this endpoint under the hood.
Code
This is a POST mutation — never automatically retried.
The preferred approach uses the OAuthAuth class directly. It owns the
revocation request and uses the same configured environment as the OAuth client:
Code
When to use each:
OAuthAuth.revoke()— the recommended path. It loads the stored access token as-is, calls the revocation endpoint, and clears the token store in afinallyblock. It does not refresh an expired token; if the server request fails, the local store is still cleared. Use this for logout flows, token rotation, and session cleanup.client.account.revokeOAuthToken({})— the raw REST call. Use only if you need direct control over the HTTP request (e.g. custom error handling, auditing) and are managing token store cleanup yourself.
Caveat: After revocation, the access token and refresh token are both invalidated. You'll need to complete a new authorization flow to obtain fresh tokens.
What's next
- Authentication — OAuth setup, HMAC auth, and the
OAuthAuthclass - Error Handling —
OAuthTokenErrorandOAuthAuthorizationError