Skip to content

Snyk API API

by snyk.io

No authHTTPSDevelopment
Open documentation ↗

Overview

The Snyk API is available to customers on [Business and Enterprise plans](https://snyk.io/plans) and allows you to programatically integrate with Snyk. ## REST API We are in the process of building a new, improved API (`https://api.snyk.io/rest`) built using the OpenAPI and JSON API standards. We welcome you to try it out as we shape and release endpoints until it, ultimately, becomes a full replacement for our current API. Looking for our REST API docs? Please head over to [https://apidocs.snyk.io](https://apidocs.snyk.io) ## API vs CLI vs Snyk integration The API detailed below has the ability to test a package for issues, as they are defined by Snyk. It is important to note that for many package managers, using this API will be less accurate than running the [Snyk CLI](https://snyk.io/docs/using-snyk) as part of your build pipe, or just using it locally on your package. The reason for this is that more than one package version fit the requirements given in manifest files. Running the CLI locally tests the actual deployed code, and has an accurate snapshot of the dependency versions in use, while the API can only infer it, with inferior accuracy. It should be noted that the Snyk CLI has the ability to output machine-readable JSON output (with the `--json` flag to `snyk test`). A third option, is to allow Snyk access to your development flow via the existing [Snyk integrations](https://snyk.io/docs/). The advantage to this approach is having Snyk monitor every new pull request, and suggest fixes by opening new pull requests. This can be achieved either by integrating Snyk directly to your source code management (SCM) tool, or via a broker to allow greater security and auditability. If those are not viable options, this API is your best choice. ## API url The base URL for all API endpoints is https://api.snyk.io/api/v1/ ## Authorization To use this API, you must get your token from Snyk. It can be seen on https://snyk.io/account/ after you register with Snyk and login. The token should be supplied in an `Authorization` header with the token, preceded by `token`: ```http Authorization: token API_KEY ``` Otherwise, a 401 "Unauthorized" response will be returned. ```http HTTP/1.1 401 Unauthorized { "code": 401, "error": "Not authorised", "message": "Not authorised" } ``` ## Overview and entities The API is a REST API. It has the following entities: ### Test result The test result is the object returned from the API giving the results of testing a package for issues. It has the following fields: | Property | Type | Description | Example | |----------------:|---------|-------------------------------------------------------|-----------------------------------------------------------------| | ok | boolean | Does this package have one or more issues? | false | | issues | object | The issues found. See below for details. | See below | | dependencyCount | number | The number of dependencies the package has. | 9 | | org | object | The organization this test was carried out for. | {"name": "anOrg", "id": "5d7013d9-2a57-4c89-993c-0304d960193c"} | | licensesPolicy | object | The organization's licenses policy used for this test | See in the examples | | packageManager | string | The package manager for this package | "maven" | | | | | | ### Issue An issue is either a vulnerability or a license issue, according to the organization's policy. It has the following fields: | Property | Type | Description | Example | |---------------:|---------------|----------------------------------------------------------------------------------------------------------------------------|----------------------------------------| | id | string | The issue ID | "SNYK-JS-BACKBONE-10054" | | url | string | A link to the issue details on snyk.io | "https://snyk.io/vuln/SNYK-JS-BACKBONE-10054 | | title | string | The issue title | "Cross Site Scripting" | | type | string | The issue type: "license" or "vulnerability". | "license" | | paths | array | The paths to the

Snyk API is a development API from snyk.io. It needs no API key. It is served over HTTPS. Its OpenAPI description documents 103 endpoints.

At a glance

Authentication
No auth
HTTPS
Yes
CORS
Unknown
Category
Development
Base URL
https://api.snyk.io/api/v1
Version
1.0.0
Endpoints
103
Spec updated
2023-03-06

Make a first request

Replace the placeholders; the documentation says exactly where credentials go.

cURL
curl -X GET "https://api.snyk.io/api/v1/orgs" \
  -H "Accept: application/json"
JavaScript
const response = await fetch("https://api.snyk.io/api/v1/orgs", {
  method: "GET",
  headers: {
    "Accept": "application/json",
  },
});
const data = await response.json();
console.log(data);
Python
import requests

response = requests.request(
    "GET",
    "https://api.snyk.io/api/v1/orgs",
    headers={
    "Accept": "application/json",
    },
    timeout=30,
)
print(response.json())

Endpoints

MethodPathWhat it does
POST/group/{groupId}/auditGet group level audit logs
GET/group/{groupId}/membersList all members in a group
POST/group/{groupId}/org/{orgId}/membersAdd a member to an organization within a group
GET/group/{groupId}/orgsList all organizations in a group
GET/group/{groupId}/rolesList all roles in a group
GET/group/{groupId}/settingsView group settings
PUT/group/{groupId}/settingsUpdate group settings
GET/group/{groupId}/tagsList all tags in a group
POST/group/{groupId}/tags/deleteDelete tag from group
POST/monitor/dep-graphMonitor Dep Graph
POST/orgCreate a new organization
DELETE/org/{orgId}Remove organization
POST/org/{orgId}/auditGet organization level audit logs
POST/org/{orgId}/dependenciesList all dependencies
GET/org/{orgId}/entitlement/{entitlementKey}Get an organization's entitlement value
GET/org/{orgId}/entitlementsList all entitlements
GET/org/{orgId}/integrationsList
POST/org/{orgId}/integrationsAdd new integration
PUT/org/{orgId}/integrations/{integrationId}Update existing integration
DELETE/org/{orgId}/integrations/{integrationId}/authenticationDelete credentials
POST/org/{orgId}/integrations/{integrationId}/authentication/provision-tokenProvision new broker token
POST/org/{orgId}/integrations/{integrationId}/authentication/switch-tokenSwitch between broker tokens
POST/org/{orgId}/integrations/{integrationId}/cloneClone an integration (with settings and credentials)
POST/org/{orgId}/integrations/{integrationId}/importImport targets
GET/org/{orgId}/integrations/{integrationId}/import/{jobId}Get import job details
GET/org/{orgId}/integrations/{integrationId}/settingsRetrieve
PUT/org/{orgId}/integrations/{integrationId}/settingsUpdate
GET/org/{orgId}/integrations/{type}Get existing integration by type
POST/org/{orgId}/inviteInvite users
POST/org/{orgId}/licensesList all licenses
GET/org/{orgId}/membersList Members
PUT/org/{orgId}/members/update/{userId}Update a member's role in the organization
PUT/org/{orgId}/members/{userId}Update a member in the organization
DELETE/org/{orgId}/members/{userId}Remove a member from the organization
GET/org/{orgId}/notification-settingsGet organization notification settings
PUT/org/{orgId}/notification-settingsSet notification settings
GET/org/{orgId}/project/{projectId}Retrieve a single project
PUT/org/{orgId}/project/{projectId}Update a project
DELETE/org/{orgId}/project/{projectId}Delete a project
POST/org/{orgId}/project/{projectId}/activateActivate
POST/org/{orgId}/project/{projectId}/aggregated-issuesList all Aggregated issues
POST/org/{orgId}/project/{projectId}/attributesApplying attributes
POST/org/{orgId}/project/{projectId}/deactivateDeactivate
GET/org/{orgId}/project/{projectId}/dep-graphGet Project dependency graph
POST/org/{orgId}/project/{projectId}/historyList all project snapshots
POST/org/{orgId}/project/{projectId}/history/{snapshotId}/aggregated-issuesList all project snapshot aggregated issues
GET/org/{orgId}/project/{projectId}/history/{snapshotId}/issue/{issueId}/pathsList all project snapshot issue paths
GET/org/{orgId}/project/{projectId}/ignore/{issueId}Retrieve ignore
POST/org/{orgId}/project/{projectId}/ignore/{issueId}Add ignore
PUT/org/{orgId}/project/{projectId}/ignore/{issueId}Replace ignores
DELETE/org/{orgId}/project/{projectId}/ignore/{issueId}Delete ignores
GET/org/{orgId}/project/{projectId}/ignoresList all ignores
POST/org/{orgId}/project/{projectId}/issue/{issueId}/jira-issueCreate jira issue
GET/org/{orgId}/project/{projectId}/issue/{issueId}/pathsList all project issue paths
GET/org/{orgId}/project/{projectId}/jira-issuesList all jira issues
PUT/org/{orgId}/project/{projectId}/moveMove project to a different organization
GET/org/{orgId}/project/{projectId}/settingsList project settings
PUT/org/{orgId}/project/{projectId}/settingsUpdate project settings
DELETE/org/{orgId}/project/{projectId}/settingsDelete project settings
POST/org/{orgId}/project/{projectId}/tagsAdd a tag to a project
POST/org/{orgId}/project/{projectId}/tags/removeRemove a tag from a project
POST/org/{orgId}/projectsList all projects
GET/org/{orgId}/provisionList pending user provisions
POST/org/{orgId}/provisionProvision a user to the organization
DELETE/org/{orgId}/provisionDelete pending user provision
GET/org/{orgId}/settingsView organization settings
PUT/org/{orgId}/settingsUpdate organization settings
GET/org/{orgId}/webhooksList webhooks
POST/org/{orgId}/webhooksCreate a webhook
GET/org/{orgId}/webhooks/{webhookId}Retrieve a webhook
DELETE/org/{orgId}/webhooks/{webhookId}Delete a webhook
POST/org/{orgId}/webhooks/{webhookId}/pingPing a webhook
GET/orgsList all the organizations a user belongs to
POST/reporting/counts/issuesGet issue counts
POST/reporting/counts/issues/latestGet latest issue counts
POST/reporting/counts/projectsGet project counts
POST/reporting/counts/projects/latestGet latest project counts
POST/reporting/counts/testsGet test counts
POST/reporting/issues/Get list of issues
POST/reporting/issues/latestGet list of latest issues
POST/test/composerTest composer.json & composer.lock file
POST/test/dep-graphTest Dep Graph
POST/test/golangdepTest Gopkg.toml & Gopkg.lock File
POST/test/govendorTest vendor.json File
POST/test/gradleTest gradle file
GET/test/gradle/{group}/{name}/{version}Test for issues in a public package by group, name and version
POST/test/mavenTest maven file
GET/test/maven/{groupId}/{artifactId}/{version}Test for issues in a public package by group id, artifact id and version
POST/test/npmTest package.json & package-lock.json File
GET/test/npm/{packageName}/{version}Test for issues in a public package by name and version
POST/test/pipTest requirements.txt file
GET/test/pip/{packageName}/{version}Test for issues in a public package by name and version
POST/test/rubygemsTest gemfile.lock file
GET/test/rubygems/{gemName}/{version}Test for issues in a public gem by name and version
POST/test/sbtTest sbt file
GET/test/sbt/{groupId}/{artifactId}/{version}Test for issues in a public package by group id, artifact id and version
POST/test/yarnTest package.json & yarn.lock File
GET/user/meGet My Details
GET/user/me/notification-settings/org/{orgId}Get organization notification settings
PUT/user/me/notification-settings/org/{orgId}Modify organization notification settings

Showing the first 100 of 103 endpoints; the full list is in the documentation.

Questions

Does the Snyk API API need an API key?

No. The Snyk API API can be called without an API key or sign-up, which makes it handy for prototypes and front-end demos.

Does the Snyk API API support HTTPS?

Yes, the Snyk API API is served over HTTPS.

How many endpoints does the Snyk API API have?

Its OpenAPI description lists 103 endpoints in version 1.0.0. The first 100 are shown on this page.

What are alternatives to the Snyk API API?

Other Development APIs include Cloudflare, Azure DevOps, IPify, App Store Connect API, StackExchange.

Compare alternatives →

Listed from APIs.guru (CC0).