Skip to content
Skip to Content
Coder Docs

Revoke OAuth2 tokens (RFC 7009).

POST
/oauth2/revoke

Header Parameters

Authorization?string

HTTP Basic credentials, the client_id as the username and the client_secret as the password. A confidential client sends these or the form fields below, not both.

Request Body

application/x-www-form-urlencoded
  1. body
client_id?string

Client ID, required unless sent as the HTTP Basic username

client_secret?string

Client secret, required for a confidential client unless sent as the HTTP Basic password. Public clients (token_endpoint_auth_method=none) send no secret.

token*string

The token to revoke

token_type_hint?string

Hint about token type (access_token or refresh_token)

Response Body

Token successfully revoked. A 200 does not confirm that the token existed or belonged to the client

The samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.

curl -X POST \	"$CODER_URL/oauth2/revoke" \	-H "Content-Type: application/x-www-form-urlencoded" \	--data-binary "@{file}"
Example Response
Empty