Scenarios for using Snyk API

The Snyk API scenarios identify procedures you can use to accomplish tasks with Snyk applications using the APIs.

The scenarios are listed on this page under the endpoints they use. They are provided in a repository or on the user docs site (links included).

If you have issues when using these procedures, contact your Technical Success Manager or Solutions Engineer, or submit a ticket to Snyk support.

API v1 Groups

Retrieve a project snapshot for every project in a given group

Scenario: Retrieve-project-snapshots (complete procedure)

Endpoints used: API v1 List all organizations in a group

API v1 (Reporting API) Get list of latest issues

More uses of API v1 Groups

SEE also:

API v1 Import projects

Identify and import new repositories only

Scenario: Identify-and-import-new-repos (complete procedure)

Endpoints used: REST API Get targets by org ID (use latest version)

API v1 Import targets

More uses of API v1 Import projects

SEE also: API v1 Projects: Import fresh Container images

API v1 Projects: Detect and import new projects in a repository into a target

API v1 REST API Targets (beta): Detect new projects (files) in repositories and import them into a target in Snyk on a regular basis

API v1 Integrations

Rotate or change your broker token for any reason

Scenario: Broker-token-rotation (complete procedure)

Endpoints used: API v1 List all the organizations a user belongs to (group admin only)

API v1 Add new integration

API v1 Update existing integration (to enable broker)

For a specific event or time, disable all interactions (pull requests, tests) from Snyk to the code base (source control management repository)

Scenario: disable-all-interaction-from-snyk (complete procedure)

Endpoints used alternative 1: Get integrations from different organizations and then update the settings for each integration API v1 (Integrations) List

API v1 (Integration settings) Update

API v1 Update existing integration

Endpoints used alternative 2: Webhooks approach: remove the Snyk webhook by getting the Webhook Id and using it to delete the webhook API v1 List webhooks

API v1 Delete a webhook

API v1 Create a webhook

More uses of API v1 integrations

SEE also: API v1 Organizations: Create multiple new organizations that all have the same settings in a given group

API v1 Projects: Detect and import new projects in a repository into a target

API v1 Issues (Reporting API)

Find all projects affected by a vulnerability

Scenario: find-all-projects-affected-by-a-vuln.md (complete procedure)

**Endpoints used:**API v1 Issues (Reporting API) Get list of issues

API v1 Issues (Reporting API) List all organizations in a group

API v1 Projects List all projects

Bulk ignore issues

Scenario: bulk-ignore-issues (complete procedure)

Endpoints used: REST API beta Get projects by org ID

API v1 Get list of latest issues (To get all issues but Code)

REST experimental Get a summary of issues within an org (To get all Code issues)

REST API Issues (experimental)

SEE: API v1 Issues: Bulk ignore issues

API v1 Projects: List all issues including Snyk Code issues in all the projects in a group

More uses of API v1 Issues (Reporting API)

SEE also: API v1 Groups: Retrieve a project snapshot for every project in a given group

API v1 Organizations

Create multiple new organizations that all have the same settings in a given group

Scenario: create-multiple-orgs-and-copy-settings (complete procedure)

Endpoints used: API v1 Create a new organization

API v1 View organization settings

API v1 Update organization settings

API v1 Clone an integration with settings and credentials

Assign all users in a given list to all the organizations a company has (all organization in a group)

Scenario: assign-users-to-all-orgs (complete procedure)

Endpoints used: API v1 List all members in a group

API v1 Invite users

Add users to organizations at scale ahead of the first login

Scenario: Provision users to Orgs via API

Endpoint used: API v1 Provision a user to the organization

More uses of API v1 Organizations

SEE also: API v1 Integrations: Rotate or change your broker token for any reason

API v1 Projects

List all issues including Snyk Code issues in all the projects in an organization

Scenario: list-all-issues-for-a-snyk-org (complete procedure)

Endpoints used: API v1 Projects List all projects

API v1 Projects List all aggregated issues (no Code)

REST (experimental) Get summary of issues within an org

REST (experimental) Get a Snyk Code issue by its ID

API v1 Projects (Ignored issues) Retrieve ignore (scroll down)

Tag all projects in Snyk

Scenario: Tag projects in Snyk (complete procedure)

Endpoints used: API v1 List all projects now REST API List all Projects for an Org with the given Org ID

Import fresh Container images

Scenario: import-new-container-images (complete procedure)

Endpoints used: API v1 List all projects

API v1 Import targets

API v1 Get import job details

API v1 Delete a project

Detect and import new projects in a repository into a target

Scenario: detect-and-import-new-projects (complete procedure)

Endpoints used: API v1 List all projects

API v1 Import targets

Move projects from one organisation to another

Scenario: Move projects between organisations (complete procedure)

API token used must have Group Admin access. If moving between orgs in different groups, a personal API token with Group Admin in both groups must be used - Service Accounts are not able to move projects between orgs in different groups.

Historical data for reporting will be lost.

Endpoints used: API v1 Move Projects

More uses of API v1 Projects

SEE also: API v1 Import projects: Identify and import new repositories only

API v1 Issues (Reporting API): Find all projects affected by a vulnerability

API v1 Issues (Reporting API): Bulk ignore issues

REST API Targets (Beta)

Detect new projects (files) in repositories and import them into a target in Snyk on a regular basis

Scenario: Identify-and-import-new-repos (complete procedure)

Endpoint used: REST API Get targets by org ID

API v1 Import targets

API v1 Users and Roles

SEE: Provision users to Orgs via API Remove members from Groups and Orgs via API Update Member Roles via API (also Snyk REST API Users endpoint PATCH https://api.snyk.io/rest/groups/{group_id}/users/{id}?version=2023-01-30~beta)

API v1 Webhooks

SEE: API v1 Integrations: Rotate or change your broker token for any reason

Snyk Webhooks

Last updated

More information

Snyk privacy policy

© 2024 Snyk Limited | All product and company names and logos are trademarks of their respective owners.