Tests
Create a new test.
Provide the items to be tested by Snyk as well as any configuration parameters for the test to be run.
Currently, scans using the Open Source (SCA) and Code Analysis (SAST) scanners can be run using the Test API.
Tests begun through the Test API yield lists of Findings when finished. These Findings can be retrieved using the ListFindings endpoint.
Successfully creating a new Test will yield a Job ID that can be used to poll for the Test's completion via the GetJob endpoint.
Required permissions
-
View Organization (org.read) -
Test packages (org.package.test)
API key value must be prefixed with "Token ".
Snyk Org ID under which to run or query information about a Job or Test.
The API version requested.
A unique ID assigned to each API request, for tracing and troubleshooting.
Snyk clients can optionally provide this ID.
Identifies the Snyk client interaction in which this API request occurs.
The identifier is an opaque string. though at the time of writing it may either be a uuid or a urn containing a uuid and some metadata.
TestRequestBody represents the request body used when creating an Test.
The request has been accepted for processing, but processing has not yet completed.
Invalid input
Get a test.
A Test returned through this endpoint is intended to be a completed Test with results. The data returned through this endpoint does not contain the Findings for the Test, but a description of the Test that was run and its status.
Tests that completed successfully are marked with an appropriate outcome according to the configured Thresholds.
Facts about the Test (e.g. how many dependencies were present in a Tested SBOM) are attached to this response as well as a summary of the Findings uncovered during the Test.
Any Errors or Warnings that occurred during the Test will be present in the response from this endpoint.
The response will also contain a link to the first page of the Test's Findings.
Required permissions
View Organization (org.read)
API key value must be prefixed with "Token ".
Snyk Org ID under which to run or query information about a Job or Test.
Test ID returned from the Test API to query.
The API version requested.
A unique ID assigned to each API request, for tracing and troubleshooting.
Snyk clients can optionally provide this ID.
Identifies the Snyk client interaction in which this API request occurs.
The identifier is an opaque string. though at the time of writing it may either be a uuid or a urn containing a uuid and some metadata.
Successful API response with a single resource
Invalid input
Get a test job.
The Test API is Asynchronous, and Tests begun through the API are assigned a Job ID which references the in-progress Test. The Job ID is provided in a successful response from the CreateTest endpoint.
This endpoint is used to poll for the status of a Test using its associated Job ID.
When the Job is Finished and the Test is ready for consumption, the Related link will be populated in the response with a link to the finished Test entity.
Required permissions
View Organization (org.read)
API key value must be prefixed with "Token ".
Snyk Org ID under which to run or query information about a Job or Test.
Job ID returned from the Test API to query.
The API version requested.
A unique ID assigned to each API request, for tracing and troubleshooting.
Snyk clients can optionally provide this ID.
Identifies the Snyk client interaction in which this API request occurs.
The identifier is an opaque string. though at the time of writing it may either be a uuid or a urn containing a uuid and some metadata.
Successful API response with a single resource
Redirect to another resource after async processing.
Invalid input
Last updated
Was this helpful?

