Token revocation (RFC 7009).
POST
/oauth/revoke
const url = 'https://example.com/api/auth/oauth/revoke';const options = { method: 'POST', headers: { Authorization: 'Basic <credentials>', 'Content-Type': 'application/x-www-form-urlencoded' }, body: new URLSearchParams({ token: 'example', token_type_hint: 'example', client_id: 'example', client_secret: 'example' })};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/auth/oauth/revoke \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data token=example \ --data token_type_hint=example \ --data client_id=example \ --data client_secret=exampleA refresh token issued to the client ends its grant. Any other token, unknown, expired, another client’s or an access token, is answered 200 all the same; access tokens expire on their own within 15 minutes. The client authenticates as at /oauth/token. Limited per client IP, together with /oauth/token.
Authorizations
Section titled “Authorizations”- clientBasic
- None
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/x-www-form-urlencoded
object
token
required
string
token_type_hint
string
client_id
string
client_secret
string
Example generated
token=example&token_type_hint=example&client_id=example&client_secret=exampleResponses
Section titled “Responses”Revoked, or nothing to revoke.
The request was refused (RFC 6749 §5.2).
Media typeapplication/json
An RFC 6749 §5.2 error response.
object
error
required
string
error_description
string
Example
{ "error": "invalid_request"}Headers
Section titled “Headers”Cache-Control
string
Client authentication failed, error invalid_client.
Media typeapplication/json
An RFC 6749 §5.2 error response.
object
error
required
string
error_description
string
Example
{ "error": "invalid_request"}Headers
Section titled “Headers”WWW-Authenticate
string
Cache-Control
string
The body is larger than 64 KiB.
Media typeapplication/problem+json
An RFC 9457 problem.
object
type
required
string
title
required
string
status
required
integer
detail
string
instance
string
request_id
string
errors
object
key
additional properties
string
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "request_id": "example", "errors": { "additionalProperty": "example" }}This client IP is sending too many requests.
Media typeapplication/problem+json
An RFC 9457 problem.
object
type
required
string
title
required
string
status
required
integer
detail
string
instance
string
request_id
string
errors
object
key
additional properties
string
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "request_id": "example", "errors": { "additionalProperty": "example" }}Headers
Section titled “Headers”Retry-After
integer
Seconds to wait.
The service failed; the problem says nothing more.
Media typeapplication/problem+json
An RFC 9457 problem.
object
type
required
string
title
required
string
status
required
integer
detail
string
instance
string
request_id
string
errors
object
key
additional properties
string
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "request_id": "example", "errors": { "additionalProperty": "example" }}