> 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/getting-started-guides/getting-started-with-the-rest-api.md).

# Getting started with the REST API

How to make your first Snyk REST API call with curl, including finding your Organization ID and authentication token

Follow these steps to make a simple call to the REST API using `curl` in the command line.

You need `curl` and access to a Snyk Organization that has Projects.

1. Log in to [Snyk](https://snyk.io/).
2. In your account, use the left navigation to find an **Organization** where you have Projects you can list.
3. Navigate to your **Organization Settings**, and on the **General** settings page, find your **Organization ID** and copy the value.
4. Navigate to your personal [General Account Settings](https://app.snyk.io/account/) and copy your **API Token**. For instructions, see [Authentication for API](https://docs.snyk.io/developer-tools/snyk-api/authentication-for-api).
5. Use a `curl` command to make your request. Replace the `{orgId}` and API\_TOKEN with your **Organization ID** and **API Token**, respectively. Snyk recommends using 2024-10-15 for the version number unless you are using an earlier version for a specific reason. Using the current day's date will call the most recent version of the API. An example follows:

```sh
curl --request GET \
--url "https://api.snyk.io/rest/orgs/{orgId}/projects?version=2024-10-15" \
--header "Content-Type: application/vnd.api+json" \
--header "Authorization: token API_TOKEN"
```

A successful call returns the `200` status code with a `data` array listing the Projects in the Organization.

{% hint style="info" %}
The API URL to use when calling an API is different for different regions. For a complete list, see [API URLs](https://docs.snyk.io/developer-tools/snyk-api/rest-api/about-the-rest-api#api-urls).

As an example, the`SNYK-US-02`region API URLs are the following:

* **API V1:** <https://api.us.snyk.io/v1/>
* **REST API:** <https://api.us.snyk.io/rest/>
  {% endhint %}

Note that if you use the parameter `target-reference`, you must URL-encode it.

If you have any problems or questions, contact [Snyk support](https://support.snyk.io).


---

# 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/getting-started-guides/getting-started-with-the-rest-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.
