Skip to main content
POST
/
api
/
{serviceId}
/
auth
/
token
/
revoke
Typescript (SDK)
import { Authlete } from "@authlete/typescript-sdk";

const authlete = new Authlete({
  bearer: process.env["AUTHLETE_BEARER"] ?? "",
});

async function run() {
  const result = await authlete.token.management.revoke({
    serviceId: "<id>",
    tokenRevokeRequest: {
      accessTokenIdentifier: "Z5a40U6dWvw2gMoCOAFbZcM85q4HC0Z--0YKD9-Nf6Q",
    },
  });

  console.log(result);
}

run();
{
  "resultCode": "A312001",
  "resultMessage": "Revoked 1 access token(s).",
  "count": 1
}

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.

subject
string

The subject of a resource owner.

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