Skip to main content
POST
Typescript (SDK)
Bulk revocation with clientIdentifier only, clientIdentifier + subject, or subject only deletes at most 20 tokens per request (the default of token.revoke.count.max in ServerConfiguration.java). If the target has more than 20 tokens, the response count will be 20 and the remainder is left untouched. To fully wipe them, call the endpoint repeatedly until count returns 0.

Safe bulk revocation under ongoing service: the lock-then-revoke pattern

When you call /auth/token/revoke repeatedly with clientIdentifier to wipe all tokens for a client that is still serving live traffic, the following problems arise:
  • Each call deletes at most 20 tokens, so a loop is required.
  • During the loop the client can keep issuing and refreshing tokens, so the loop may not converge, or it may collateral-delete legitimate tokens issued after the revocation started.
  • For a public client whose refresh token has leaked (no client_secret to rotate), the attacker can keep refreshing while the cleanup runs.
The safe and reliable pattern is to temporarily lock the client first, then revoke.
  1. Call POST /api/client/lock_flag/update/{clientIdentifier} with clientLocked: true.
  • All subsequent token-endpoint calls for this client (authorization_code, refresh_token, client_credentials, etc.) are rejected with invalid_client (e.g. A458101).
  • Existing tokens are also rejected by /auth/introspection with invalid_token (A097303: โ€œThe client application associated with the presented access token is locked.โ€).
  • This immediately stops the attackerโ€™s refresh path โ€” including the public-client RT-leak case where there is no client_secret to rotate.
  1. Call POST /api/auth/token/revoke with clientIdentifier in a loop until the response count reaches 0.
  • Because issuance is stopped, the loop converges deterministically.
  • All existing tokens are physically deleted, eliminating any leftover leaked tokens.
  1. Call POST /api/client/lock_flag/update/{clientIdentifier} with clientLocked: false to return to normal operation.
  • End users re-authenticate and receive fresh tokens.

Authorizations

Authorization
string
header
required

Authenticate every request with a Service Access Token or Organization Token. Set the token value in the Authorization: Bearer <token> header.

Service Access Token: Scoped to a single service. Use when automating service-level configuration or runtime flows.

Organization Token: Scoped to the organization; inherits permissions across services. Use for org-wide automation or when managing multiple services programmatically.

Both token types are issued by the Authlete console or provisioning APIs.

Path Parameters

serviceId
string
required

A service ID.

Body

accessTokenIdentifier
string

The identifier of an access token to revoke

The hash of an access token is recognized as an identifier as well as the access token itself.

refreshTokenIdentifier
string

The identifier of a refresh token to revoke.

The hash of a refresh token is recognized as an identifier as well as the refresh token itself.

clientIdentifier
string

The client ID of the access token to be revoked.

Both the numeric client ID and the alias are recognized as an identifier of a client.

Bulk revocation with clientIdentifier only or clientIdentifier + subject deletes at most 20 tokens per request (the default of token.revoke.count.max in ServerConfiguration.java). If the target has more than 20 tokens, the response count will be 20 and the remainder is left untouched. To fully wipe them, call the endpoint repeatedly until count returns 0.

subject
string

The subject of a resource owner.

Bulk revocation with clientIdentifier + subject or subject only deletes at most 20 tokens per request (the default of token.revoke.count.max in ServerConfiguration.java). If the target has more than 20 tokens, the response count will be 20 and the remainder is left untouched. To fully wipe them, call the endpoint repeatedly until count returns 0.

Response

Token revoked successfully

resultCode
string

The code which represents the result of the API call.

resultMessage
string

A short message which explains the result of the API call.

count
integer

The number of tokens revoked.

If the target has more than 20 tokens, the response count will be 20 and the remainder is left untouched. To fully wipe them, call the endpoint repeatedly until count returns 0.