> For the complete documentation index, see [llms.txt](https://docs.edgetag.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.edgetag.io/api/getting-started/oauth-2.0/implementation/invalidating-token.md).

# Invalidating token

If you wish to invalidate the token, you will need to call our API.  (see [Implementation page](/api/getting-started/oauth-2.0/implementation.md) for URLs).

{% tabs %}
{% tab title="JavaScript" %}

```javascript
const accessToken = 'aYsxMIy3XguB9YORh2GzAL8E60MsVvXbG8IHxNFooSo'
const tokenUrl = 'http://api-sandbox.edgetag.io/v1/oauth-app/client/revoke'

const body = new URLSearchParams({
  token: accessToken,
  token_type_hint: 'access_token',
})

const response = await fetch(tokenUrl.toString(), {
  method: 'POST',
  headers: {
    'Content-Type': 'application/x-www-form-urlencoded',
    Authorization: `Basic ${btoa(clientId + ':' + clientSecret)}`,
  },
  body
})
```

{% endtab %}

{% tab title="CURL" %}

```bash
curl --request POST \
  --url http://api-sandbox.edgetag.io/v1/oauth-app/client/revoke \
  --header 'Authorization: Basic ZDAyNzJjNDItN2VjYy00ODk5LWExYTctMDgwMWE4YTlkYTJmOmQwMjcyYzQyLTdlY2MtNDg5OS1hMWE3LTA4MDFhOGE5ZGEyZg==' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data token=aYsxMIy3XguB9YORh2GzAL8E60MsVvXbG8IHxNFooSo \
  --data token_type_hint=access_token
```

{% endtab %}
{% endtabs %}

For the access token, use the latest valid access token for that user. This will immediately invalidate users' access.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.edgetag.io/api/getting-started/oauth-2.0/implementation/invalidating-token.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
