Getting started with REST API
Learn how to make calls to the REST API.
Follow these steps to make a simple call to the REST API using curl
in the command line.
Log in to Snyk.
Navigate to the Org Settings (gear icon) for an Organization where you have Projects you can list.
Find the Organization ID and copy the value.
Navigate to your General Account Settings and copy your API Token. For instructions, see See How to obtain and authenticate with your API token.
Copy the version string from the URL, for example,
2022-06-08~beta
and paste the version string into the QUERY-STRING PARAMETERSversion
field (required).Use the
curl
command to make your request. Replace the{orgId}
and API_TOKEN with your Organization ID and API Token, respectively. For theversion
parameter, it is advised to use the current day's date.
Note that the API URL to use when calling an API is different for different regions. For a complete list, see API URLs.
As an example, theSNYK-US-02
region API URLs will be the following:
API v1: https://api.us.snyk.io/v1/
REST API: https://api.us.snyk.io/rest/
Note that if you use the parameter target-reference
, you must URL-encode it. If you have any problems or questions, contact Snyk support.
Last updated