Tests

This document uses the REST API. For more details, see the Authentication for API page.

Create a new test. (Early Access)

post

Create a new test.

Required permissions

  • View Organization (org.read)

  • Test packages (org.package.test)

Authorizations
AuthorizationstringRequired

API key value must be prefixed with "Token ".

Path parameters
org_idstring · uuidRequired

The org id

Query parameters
versionstringRequired

The API version requested.

Header parameters
snyk-request-idstring · uuidOptional

A unique ID assigned to each API request, for tracing and troubleshooting.

Snyk clients can optionally provide this ID.

snyk-interaction-idstring · min: 36 · max: 128Optional

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.

Body

TestRequestBody represents the request body used when creating an Test.

Responses
post
/orgs/{org_id}/tests
POST /rest/orgs/{org_id}/tests?version=text HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 710

{
  "data": {
    "attributes": {
      "config": {
        "local_policy": {
          "fail_on_upgradable": false,
          "ignores": [
            {
              "created_at": "2025-11-12T16:08:33.525Z",
              "expires_at": "2025-11-12T16:08:33.525Z",
              "path": [
                "[email protected]",
                "org.apache.logging.log4j:[email protected]"
              ],
              "reason": "False positive",
              "skip_if_fixable": true,
              "vuln_id": "SNYK-JAVA-ORGAPACHELOGGINGLOG4J-31456"
            }
          ],
          "reachability_filter": "reachable",
          "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-11-12T16:08:33.525Z",
      "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. (Early Access)

get

Get a test.

Required permissions

  • View Organization (org.read)
Authorizations
AuthorizationstringRequired

API key value must be prefixed with "Token ".

Path parameters
org_idstring · uuidRequired

The org id

test_idstring · uuidRequired

The test id

Query parameters
versionstringRequired

The API version requested.

Header parameters
snyk-request-idstring · uuidOptional

A unique ID assigned to each API request, for tracing and troubleshooting.

Snyk clients can optionally provide this ID.

snyk-interaction-idstring · min: 36 · max: 128Optional

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.

Responses
200

Successful API response with a single resource

application/vnd.api+json
get
/orgs/{org_id}/tests/{test_id}
GET /rest/orgs/{org_id}/tests/{test_id}?version=text HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Accept: */*
{
  "data": {
    "attributes": {
      "config": {
        "local_policy": {
          "fail_on_upgradable": false,
          "ignores": [
            {
              "created_at": "2025-11-12T16:08:33.525Z",
              "expires_at": "2025-11-12T16:08:33.525Z",
              "path": [
                "[email protected]",
                "org.apache.logging.log4j:[email protected]"
              ],
              "reason": "False positive",
              "skip_if_fixable": true,
              "vuln_id": "SNYK-JAVA-ORGAPACHELOGGINGLOG4J-31456"
            }
          ],
          "reachability_filter": "reachable",
          "risk_score_threshold": 1,
          "severity_threshold": "critical",
          "suppress_pending_ignores": false
        },
        "publish_report": true,
        "timeout": {
          "outcome": "pass",
          "seconds": 1
        }
      },
      "created_at": "2025-11-12T16:08:33.525Z",
      "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. (Early Access)

get

Get a test job.

Required permissions

  • View Organization (org.read)
Authorizations
AuthorizationstringRequired

API key value must be prefixed with "Token ".

Path parameters
org_idstring · uuidRequired

The org id

job_idstring · uuidRequired

The job id

Query parameters
versionstringRequired

The API version requested.

Header parameters
snyk-request-idstring · uuidOptional

A unique ID assigned to each API request, for tracing and troubleshooting.

Snyk clients can optionally provide this ID.

snyk-interaction-idstring · min: 36 · max: 128Optional

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.

Responses
200

Successful API response with a single resource

application/vnd.api+json
get
/orgs/{org_id}/test_jobs/{job_id}
GET /rest/orgs/{org_id}/test_jobs/{job_id}?version=text HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Accept: */*
{
  "data": {
    "attributes": {
      "created_at": "2025-11-12T16:08:33.525Z",
      "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?