Skip to content
OpenTrain AIOpenTrain AIOpenTrain AIDocs

Ask OpenTrain

Answers from the documentation, with sources.

What would you like to do with OpenTrain?

AI answers can be mistaken. Check the linked sources. Don’t include private account information.

Open app

DEVELOPER DOCUMENTATION

Revoke Token by ID

Revoke a personal API token — it stops working immediately and irreversibly.

DELETE/api/public/v1/tokens/{tokenId}

Revokes one personal API token by ID. The token stops authenticating immediately and revocation is irreversible — to restore access, create a new token. Find the tokenId via GET /tokens.

Tokens belonging to another account return 404 — the API never confirms the existence of a token the caller does not own. To revoke by presenting the token itself instead of its ID (RFC 7009), use POST /api/agent/identity/revoke.

Requirements: any valid token — token management needs no specific scope or feature flag, and works pre-claim.

tokenIdstringpathrequired

The token ID (not the ot_pat_ secret) from GET /tokens.

tokenobject

The revoked token record — same shape as the entries in GET /tokens, now with status: "revoked" and revokedAt set.

StatuscodeMeaning
401UNAUTHORIZEDMissing or invalid token
404NOT_FOUNDNo such token, or it belongs to another account (details: {tokenId})