> For the complete documentation index, see [llms.txt](https://docs.snyk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snyk.io/developer-tools/snyk-api/oauth2-api.md).

# OAuth2 API

The Snyk OAuth2 API for Snyk Apps, compliant with RFC 6749

Snyk provides an OAuth2 API, primarily for use with [Snyk Apps](/developer-tools/snyk-api/using-specific-snyk-apis/snyk-apps-apis.md). It complies with RFC 6749.

Most endpoints are served from the Snyk API subdomain (for example, <https://api.snyk.io>), with the one exception being `/oauth2/authorize` which is served on the main app subdomain (for example, <https://app.snyk.io>).

{% openapi src="/files/fqxBKtJCy00T9Llx8vmK" path="/oauth2/authorize" method="get" %}
[oauth-app-spec.yaml](https://558411700-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIEEjSXQQu36y0vmFV8zf%2Fuploads%2Fgit-blob-c5deed075973ba16e5ec51bb7e894d02107164ff%2Foauth-app-spec.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/vLbxFiYT2fYQqAubVzPV" path="/token" method="post" %}
[oauth-api-spec.yaml](https://558411700-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIEEjSXQQu36y0vmFV8zf%2Fuploads%2Fgit-blob-688a641e25b6bd8b33a94ac151f6adba5ecd370f%2Foauth-api-spec.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/vLbxFiYT2fYQqAubVzPV" path="/revoke" method="post" %}
[oauth-api-spec.yaml](https://558411700-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIEEjSXQQu36y0vmFV8zf%2Fuploads%2Fgit-blob-688a641e25b6bd8b33a94ac151f6adba5ecd370f%2Foauth-api-spec.yaml?alt=media)
{% endopenapi %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.snyk.io/developer-tools/snyk-api/oauth2-api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
