Revoke Token
DELETE
/tokens/{token_id}
const url = 'https://example.com/tokens/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = {method: 'DELETE'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url https://example.com/tokens/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0Revoke a token (audited as token.revoke; DESIGN decision 75).
Any token may revoke itself. A session (a signed-in person) may revoke every token of its own user, and an admin-scoped token any token. An agent token without admin scope can revoke only itself: any other id gets the same 404 as an unknown one, so the answer reveals nothing.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”token_id
required
Token Id
string format: uuid
Responses
Section titled “Responses”Successful Response
Media typeapplication/json
Response Revoke Token Tokens Token Id Delete
object
key
additional properties
string
Example generated
{ "additionalProperty": "example"}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Example generated
{ "detail": [ { "ctx": {}, "input": "example", "loc": [ "example" ], "msg": "example", "type": "example" } ]}