Tests
Create a new test.
Required permissions
-
View Organization (org.read)
-
Test packages (org.package.test)
The org id
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. to be safe, the
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
POST /rest/orgs/{org_id}/tests HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 421
{
"data": {
"attributes": {
"config": {
"local_policy": {
"fail_on_upgradable": false,
"risk_score_threshold": 1,
"severity_threshold": "critical",
"suppress_pending_ignores": false
},
"publish_report": true,
"timeout": {
"outcome": "pass",
"seconds": 1
}
},
"subject": {
"bundle_id": "text",
"locator": {
"paths": [
"text"
],
"type": "local_path"
},
"type": "deepcode_bundle"
},
"subject_locators": [
{
"paths": [
"package.json"
],
"type": "local_path"
}
]
},
"type": "tests"
}
}
{
"data": {
"attributes": {
"created_at": "2025-09-09T22:02:13.940Z",
"status": "pending"
},
"id": "123e4567-e89b-12d3-a456-426614174000",
"type": "test_jobs"
},
"jsonapi": {
"version": "1.0"
},
"links": {
"related": "https://example.com",
"self": "https://example.com",
"ANY_ADDITIONAL_PROPERTY": "https://example.com"
},
"meta": {
"ANY_ADDITIONAL_PROPERTY": "anything"
}
}
Get a test.
Required permissions
View Organization (org.read)
The org id
The test id
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. to be safe, the
Successful API response with a single resource
Invalid input
GET /rest/orgs/{org_id}/tests/{test_id} HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Accept: */*
{
"data": {
"attributes": {
"config": {
"local_policy": {
"fail_on_upgradable": false,
"risk_score_threshold": 1,
"severity_threshold": "critical",
"suppress_pending_ignores": false
},
"publish_report": true,
"timeout": {
"outcome": "pass",
"seconds": 1
}
},
"created_at": "2025-09-09T22:02:13.940Z",
"effective_summary": {
"count": 30,
"count_by": {
"result_type": {
"sast": 12,
"sca": 18
},
"severity": {
"critical": 2,
"high": 3,
"low": 15,
"medium": 10
}
}
},
"outcome": {
"breached_policies": {
"ids": [
"123e4567-e89b-12d3-a456-426614174000"
],
"local_policy": true
},
"reason": "policy_breach",
"result": "pass"
},
"raw_summary": {
"count": 30,
"count_by": {
"result_type": {
"sast": 12,
"sca": 18
},
"severity": {
"critical": 2,
"high": 3,
"low": 15,
"medium": 10
}
}
},
"state": {
"errors": [
{
"code": "text",
"detail": "text",
"id": "123e4567-e89b-12d3-a456-426614174000",
"links": {
"about": "https://example.com",
"ANY_ADDITIONAL_PROPERTY": "https://example.com"
},
"meta": {},
"source": {
"parameter": "text",
"pointer": "text"
},
"status": "text",
"title": "text"
}
],
"execution": "pending",
"warnings": [
{
"code": "text",
"detail": "text",
"id": "123e4567-e89b-12d3-a456-426614174000",
"links": {
"about": "https://example.com",
"ANY_ADDITIONAL_PROPERTY": "https://example.com"
},
"meta": {},
"source": {
"parameter": "text",
"pointer": "text"
},
"status": "text",
"title": "text"
}
]
},
"subject": {
"bundle_id": "text",
"locator": {
"paths": [
"text"
],
"type": "local_path"
},
"type": "deepcode_bundle"
},
"subject_locators": [
{
"paths": [
"package.json"
],
"type": "local_path"
}
]
},
"id": "123e4567-e89b-12d3-a456-426614174000",
"links": {
"findings": "https://example.com"
},
"type": "tests"
},
"jsonapi": {
"version": "1.0"
},
"links": {
"related": "https://example.com",
"self": "https://example.com",
"ANY_ADDITIONAL_PROPERTY": "https://example.com"
},
"meta": {
"ANY_ADDITIONAL_PROPERTY": "anything"
}
}
Get a test job.
Required permissions
View Organization (org.read)
The org id
The job id
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. to be safe, the
Successful API response with a single resource
Redirect to another resource after async processing.
Invalid input
GET /rest/orgs/{org_id}/test_jobs/{job_id} HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Accept: */*
{
"data": {
"attributes": {
"created_at": "2025-09-09T22:02:13.940Z",
"status": "pending"
},
"id": "123e4567-e89b-12d3-a456-426614174000",
"relationships": {
"test": {
"data": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"type": "tests"
}
}
},
"type": "test_jobs"
},
"jsonapi": {
"version": "1.0"
},
"links": {
"related": "https://example.com",
"self": "https://example.com",
"ANY_ADDITIONAL_PROPERTY": "https://example.com"
},
"meta": {
"ANY_ADDITIONAL_PROPERTY": "anything"
}
}
Last updated
Was this helpful?