Scenarios for using the Snyk API

The Snyk API scenarios identify procedures you can use to accomplish tasks with Snyk applications using the API. The scenarios listed on this page are grouped in Snyk processes and provided in a repository or on the user docs site. Links are included.

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

Manage Snyk Organization structure

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: Create a new organization View organization settings Update organization settings Clone an integration with settings and credentials

Assign all users in a given list to all the Organizations a company has (all Organizations in a Group)

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

Endpoints used: List all members in a group Invite users

Add users to organizations at scale ahead of the first login

Scenario: Provision users to Orgs via API

Endpoint used: Provision a user to the organization

Import and set up Snyk Projects

Identify and import new repositories only

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

Endpoints used: Get targets by org ID Import targets

Import fresh container images

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

Endpoints used: List all projects Import targets Get import job details Delete a project

Detect and import new Projects in a repository into a target

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

Endpoints used: List all projects Import targets

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: Get targets by org ID Import targets

Manage Snyk Projects

Tag all Projects in Snyk

Scenario: Tag projects in Snyk (complete procedure)

Endpoints used: List all Projects for an Org with the given Org ID

Move Projects from one Organization to another

Scenario: Move projects between organisations (complete procedure)

The API token used must have Group Admin access. If you are moving between Organizations in different Groups, you must use a personal API token with Group Admin permissions in both Groups. Service Accounts cannot move projects between Organizations in different Groups.

Historical data for reporting will be lost.

Endpoints used: Move project to a different organization

Integrate with SCMs

Rotate or change your Broker token for any reason

Scenario: Broker-token-rotation (complete procedure)

Endpoints used: List all the organizations a user belongs to (group admin only) Add new integration 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 List (integrations) Update (integration settings) 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 List webhooks Delete a webhook Create a webhook

Retrieve and manage issues

Retrieve a Project snapshot for every Project in a given Group

Scenario: Retrieve-project-snapshots (complete procedure)

Endpoints used: List all organizations in a group Get list of latest issues

Find all Projects affected by a vulnerability

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

Endpoints used: Get list of issues List all organizations in a group List all projects

Bulk ignore issues

Scenario: bulk-ignore-issues (complete procedure)

Endpoints used: List all projects for an org with the given Org ID Get list of latest issues (To get all issues but Code) Get issues by org ID (To get all Code issues)

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: List all projects List all aggregated issues (no Code) Get issues by org iID REST experimental Get a Snyk Code issue by its ID Retrieve ignore

Last updated

More information

Snyk privacy policy

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