Authenticate for the API
To use the Snyk API, you must get your API token from Snyk. You can find your token in your personal General Account Settings after you register with Snyk and log in. In the key field, Click to show. Then, highlight and copy the API key.
If you want a new API token, select Revoke & Regenerate. This will make the previous API token invalid. For details, see Revoke and regenerate a Snyk API token.
When using the API directly, provide the API token in an Authorization
header, as in the following example request, replacing API_TOKEN
with your API Token
If you are using the API through Snyk Apps, provide the access_token
in an Authorization
header preceded by bearer
as follows:
Otherwise, a 401 Unauthorized
response will be returned:
For information on when to use an API token and when to use a service account token, see Authentication for API.
Last updated