> ## Documentation Index
> Fetch the complete documentation index at: https://docs.msu.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Token Revocation

> Revoke a Refresh Token. Typically called on user logout.

Revokes a Refresh Token, invalidating it immediately. Typically called when the user logs out.

## Header parameters

<ParamField header="Content-Type" type="string" required>
  Must be `application/x-www-form-urlencoded`.
</ParamField>

<ParamField header="Authorization" type="string" required>
  Client credentials encoded in Base64: `Basic base64({CLIENT_ID}:{CLIENT_SECRET})`.
</ParamField>

## Body parameters

<ParamField body="token" type="string" required>
  The Refresh Token to revoke.
</ParamField>

<ParamField body="token_type_hint" type="string">
  Token type hint. Fixed value `refresh_token`.
</ParamField>

## Response

Returns `200 OK` on success. No response body.

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://oauth.msu.io/oauth/revoke' \
    --header 'Content-Type: application/x-www-form-urlencoded' \
    --header 'Authorization: Basic base64({CLIENT_ID}:{CLIENT_SECRET})' \
    --data 'token={REFRESH_TOKEN}&token_type_hint=refresh_token'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://oauth.msu.io/oauth/revoke', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': `Basic ${btoa('{CLIENT_ID}:{CLIENT_SECRET}')}`
    },
    body: new URLSearchParams({
      token: '{REFRESH_TOKEN}',
      token_type_hint: 'refresh_token'
    })
  });
  ```

  ```python Python theme={null}
  import requests
  import base64

  credentials = base64.b64encode(b'{CLIENT_ID}:{CLIENT_SECRET}').decode()

  response = requests.post(
    'https://oauth.msu.io/oauth/revoke',
    headers={
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': f'Basic {credentials}'
    },
    data={
      'token': '{REFRESH_TOKEN}',
      'token_type_hint': 'refresh_token'
    }
  )
  ```
</RequestExample>

<ResponseExample>
  ```http Response theme={null}
  HTTP/1.1 200 OK
  ```
</ResponseExample>
