TestingAPIs is still being built. If something breaks, email support@testingapis.com.

Revoke an access or refresh token

POSThttps://api.testingapis.com/api/auth/oauth/revokeSign in to see this endpoint's URL

Revoke an access or refresh token (RFC 7009).

Body (form or JSON): token. Returns 200 even for unknown tokens.

Request body

Optional. application/x-www-form-urlencoded. Token to revoke.

Example body
token={{oauthAccessToken}}

Responses

200
Revoked, or already unknown.
400
token missing.

Example

Request
curl -X POST "https://api.testingapis.com/api/auth/oauth/revoke" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -H "Authorization: Basic YXBpYmVlLWNsaWVudDphcGliZWUtc2VjcmV0" \
  --data-urlencode "token={{oauthAccessToken}}" \
  -H "X-TestingApis-Key: YOUR_API_KEY"
Response200 OK
{"revoked": true, "message": "Token revoked."}

Sign in to see the details

The parameters, request and response examples and the live Try it panel for this endpoint are for signed-in members. Accounts are free and take a few seconds to create.