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

# Revoke Token

> Invalidate an access token or refresh token. Use when an agent signs out of your app.

<RequestExample>
  ```typescript TypeScript theme={null}
  const response = await fetch('https://api.commune.email/oauth/revoke', {
    method: 'POST',
    headers: {
      'Authorization': `Basic ${credentials}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({ token: 'comm_oauth_xxx...' }),
  });
  ```

  ```python Python theme={null}
  resp = httpx.post(
      'https://api.commune.email/oauth/revoke',
      headers={
          'Authorization': f'Basic {credentials}',
          'Content-Type': 'application/json',
      },
      json={'token': 'comm_oauth_xxx...'},
  )
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.commune.email/oauth/revoke \
    -H "Authorization: Basic $(echo -n 'comm_client_xxx:comm_secret_xxx' | base64)" \
    -H "Content-Type: application/json" \
    -d '{"token": "comm_oauth_xxx..."}'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  { "message": "Token revoked" }
  ```
</ResponseExample>

### Body

<ParamField body="token" type="string" required>
  The access token or refresh token to revoke.
</ParamField>

### Behavior

* Always returns `200`, even if the token was already revoked or doesn't exist.
* Revoking a refresh token also revokes all access tokens for that agent-client pair.
* Accepts both Basic Auth (integrator-initiated) and Bearer Auth (agent-initiated).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.