Revoke an access or refresh token (RFC 7009)
POST
/oauth/revoke
const url = 'https://api.harperharbor.com/oauth/revoke';const options = { method: 'POST', headers: {'Content-Type': 'application/x-www-form-urlencoded'}, body: new URLSearchParams({token: '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://api.harperharbor.com/oauth/revoke \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data token=exampleForm-encoded (or multipart) field token: an access token or a refresh token (detected by lookup). Revoking either revokes the whole session it belongs to (all access and refresh tokens of that grant); a legacy session-less access token is revoked individually. Returns 200 with an empty body whether or not the token was found.
Request Bodyrequired
Section titled “Request Bodyrequired”object
token
required
string
Examplegenerated
token=exampleobject
token
required
string
Responses
Section titled “Responses”Revoked or not found (empty body).
invalid_request — missing token.
Media typeapplication/json
object
error
required
OAuth error code.
string
redirect_url
Only on the internal consent endpoints when the request expired.
string
retry_after
Seconds to wait before trying again; only with rate_limited.
integer
Examplegenerated
{ "error": "example", "redirect_url": "example", "retry_after": 1}temporarily_unavailable.
Media typeapplication/json
object
error
required
OAuth error code.
string
redirect_url
Only on the internal consent endpoints when the request expired.
string
retry_after
Seconds to wait before trying again; only with rate_limited.
integer
Examplegenerated
{ "error": "example", "redirect_url": "example", "retry_after": 1}