Snyk Tests API

The Tests API from Snyk — 3 operation(s) for tests.

Operations 3

GET /orgs/{org_id}/test_jobs/{job_id} Get a test job. (Early Access) #
POST /orgs/{org_id}/tests Create a new test. (Early Access) #
GET /orgs/{org_id}/tests/{test_id} Get a test. (Early Access) #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/snyk-tests-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

snyk-tests-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Snyk AccessRequests Tests API
  version: REST
servers:
- description: Snyk REST API
  url: https://api.snyk.io/rest
security:
- APIToken: []
- BearerAuth: []
tags:
- name: Tests
paths:
  /orgs/{org_id}/test_jobs/{job_id}:
    get:
      description: '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)`'
      operationId: getJob
      parameters:
      - $ref: '#/components/parameters/io.snyk.api.request.SnykApiRequest.request_id'
      - $ref: '#/components/parameters/io.snyk.api.request.SnykApiRequest.interaction_id'
      - $ref: '#/components/parameters/io.snyk.api.request.SnykApiRequest.version'
      - description: 'Snyk Org ID under which to run or query information

          about a Job or Test.'
        in: path
        name: org_id
        required: true
        schema:
          format: uuid
          type: string
      - description: Job ID returned from the Test API to query.
        in: path
        name: job_id
        required: true
        schema:
          format: uuid
          type: string
      responses:
        '200':
          content:
            application/vnd.api+json:
              schema:
                properties:
                  data:
                    description: JobData represents a Job resource object.
                    properties:
                      attributes:
                        description: JobAttributes represents the attributes of a Job resource
                        properties:
                          created_at:
                            description: Creation time of the job resource
                            format: date-time
                            type: string
                          status:
                            allOf:
                            - enum:
                              - pending
                              - started
                              - finished
                              - errored
                              type: string
                            description: State of the test, whether it is pending, running, complete or errored.
                        required:
                        - status
                        - created_at
                        type: object
                      id:
                        format: uuid
                        type: string
                      relationships:
                        properties:
                          test:
                            allOf:
                            - properties:
                                data:
                                  properties:
                                    id:
                                      format: uuid
                                      type: string
                                    type:
                                      enum:
                                      - tests
                                      type: string
                                  required:
                                  - id
                                  - type
                                  type: object
                              required:
                              - data
                              type: object
                            description: Test resource associated with the finished Job.
                        required:
                        - test
                        type: object
                      type:
                        enum:
                        - test_jobs
                        type: string
                    required:
                    - id
                    - attributes
                    - type
                    type: object
                  jsonapi:
                    $ref: '#/components/schemas/io.snyk.api.common.JsonApi'
                  links:
                    additionalProperties:
                      $ref: '#/components/schemas/io.snyk.api.common.LinkProperty'
                    properties:
                      related:
                        $ref: '#/components/schemas/io.snyk.api.common.LinkProperty'
                      self:
                        $ref: '#/components/schemas/io.snyk.api.common.LinkProperty'
                    type: object
                  meta:
                    $ref: '#/components/schemas/io.snyk.api.common.Meta'
                required:
                - data
                - jsonapi
                - links
                type: object
          description: Successful API response with a single resource
          headers:
            deprecation:
              schema:
                type: string
            snyk-request-id:
              schema:
                type: string
            snyk-version-lifecycle-stage:
              schema:
                type: string
            snyk-version-requested:
              schema:
                type: string
            snyk-version-served:
              schema:
                type: string
            sunset:
              description: 'A header containing the date of when the underlying endpoint will be removed. This header is only present if the endpoint has been deprecated. For information purposes only. Returned as a date in the format: YYYY-MM-DD'
              example: '2021-08-02'
              schema:
                format: date
                type: string
        '303':
          content:
            application/vnd.api+json:
              schema:
                properties:
                  data:
                    description: JobData represents a Job resource object.
                    properties:
                      attributes:
                        description: JobAttributes represents the attributes of a Job resource
                        properties:
                          created_at:
                            description: Creation time of the job resource
                            format: date-time
                            type: string
                          status:
                            allOf:
                            - enum:
                              - pending
                              - started
                              - finished
                              - errored
                              type: string
                            description: State of the test, whether it is pending, running, complete or errored.
                        required:
                        - status
                        - created_at
                        type: object
                      id:
                        format: uuid
                        type: string
                      relationships:
                        properties:
                          test:
                            allOf:
                            - properties:
                                data:
                                  properties:
                                    id:
                                      format: uuid
                                      type: string
                                    type:
                                      enum:
                                      - tests
                                      type: string
                                  required:
                                  - id
                                  - type
                                  type: object
                              required:
                              - data
                              type: object
                            description: Test resource associated with the finished Job.
                        required:
                        - test
                        type: object
                      type:
                        enum:
                        - test_jobs
                        type: string
                    required:
                    - id
                    - attributes
                    - type
                    type: object
                  jsonapi:
                    $ref: '#/components/schemas/io.snyk.api.common.JsonApi'
                  links:
                    additionalProperties:
                      $ref: '#/components/schemas/io.snyk.api.common.LinkProperty'
                    properties:
                      related:
                        $ref: '#/components/schemas/io.snyk.api.common.LinkProperty'
                      self:
                        $ref: '#/components/schemas/io.snyk.api.common.LinkProperty'
                    type: object
                  meta:
                    $ref: '#/components/schemas/io.snyk.api.common.Meta'
                required:
                - data
                - jsonapi
                - links
                type: object
          description: Redirect to another resource after async processing.
          headers:
            deprecation:
              schema:
                type: string
            location:
              required: true
              schema:
                type: string
            snyk-request-id:
              schema:
                type: string
            snyk-version-lifecycle-stage:
              schema:
                type: string
            snyk-version-requested:
              schema:
                type: string
            snyk-version-served:
              schema:
                type: string
            sunset:
              description: 'A header containing the date of when the underlying endpoint will be removed. This header is only present if the endpoint has been deprecated. For information purposes only. Returned as a date in the format: YYYY-MM-DD'
              example: '2021-08-02'
              schema:
                format: date
                type: string
        '400':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/io.snyk.api.common.ErrorDocument'
          description: Invalid input
          headers:
            deprecation:
              schema:
                type: string
            snyk-request-id:
              schema:
                type: string
            snyk-version-lifecycle-stage:
              schema:
                type: string
            snyk-version-requested:
              schema:
                type: string
            snyk-version-served:
              schema:
                type: string
            sunset:
              description: 'A header containing the date of when the underlying endpoint will be removed. This header is only present if the endpoint has been deprecated. For information purposes only. Returned as a date in the format: YYYY-MM-DD'
              example: '2021-08-02'
              schema:
                format: date
                type: string
      summary: Get a test job. (Early Access)
      tags:
      - Tests
      x-snyk-api-lifecycle: released
      x-snyk-api-releases:
      - 2024-10-15~beta
      x-snyk-api-resource: tests
      x-snyk-api-stability: beta
      x-snyk-api-version: 2024-10-15~beta
      x-stability-level: beta
  /orgs/{org_id}/tests:
    post:
      description: '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)`'
      operationId: createTest
      parameters:
      - $ref: '#/components/parameters/io.snyk.api.request.SnykApiRequest.request_id'
      - $ref: '#/components/parameters/io.snyk.api.request.SnykApiRequest.interaction_id'
      - $ref: '#/components/parameters/io.snyk.api.request.SnykApiRequest.version'
      - description: 'Snyk Org ID under which to run or query information

          about a Job or Test.'
        in: path
        name: org_id
        required: true
        schema:
          format: uuid
          type: string
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/TestRequestBody'
        required: true
      responses:
        '202':
          content:
            application/vnd.api+json:
              schema:
                properties:
                  data:
                    properties:
                      attributes:
                        description: JobAttributes represents the attributes of a Job resource
                        properties:
                          created_at:
                            description: Creation time of the job resource
                            format: date-time
                            type: string
                          status:
                            allOf:
                            - enum:
                              - pending
                              - started
                              - finished
                              - errored
                              type: string
                            description: State of the test, whether it is pending, running, complete or errored.
                        required:
                        - status
                        - created_at
                        type: object
                      id:
                        format: uuid
                        type: string
                      type:
                        enum:
                        - test_jobs
                        type: string
                    required:
                    - type
                    - id
                    - attributes
                    type: object
                  jsonapi:
                    $ref: '#/components/schemas/io.snyk.api.common.JsonApi'
                  links:
                    additionalProperties:
                      $ref: '#/components/schemas/io.snyk.api.common.LinkProperty'
                    properties:
                      related:
                        $ref: '#/components/schemas/io.snyk.api.common.LinkProperty'
                      self:
                        $ref: '#/components/schemas/io.snyk.api.common.LinkProperty'
                    type: object
                  meta:
                    $ref: '#/components/schemas/io.snyk.api.common.Meta'
                required:
                - data
                - jsonapi
                - links
                type: object
          description: The request has been accepted for processing, but processing has not yet completed.
          headers:
            content-location:
              description: A pointer to the newly created Test resource
              required: true
              schema:
                format: string
                type: string
            deprecation:
              schema:
                type: string
            snyk-request-id:
              schema:
                type: string
            snyk-version-lifecycle-stage:
              schema:
                type: string
            snyk-version-requested:
              schema:
                type: string
            snyk-version-served:
              schema:
                type: string
            sunset:
              description: 'A header containing the date of when the underlying endpoint will be removed. This header is only present if the endpoint has been deprecated. For information purposes only. Returned as a date in the format: YYYY-MM-DD'
              example: '2021-08-02'
              schema:
                format: date
                type: string
        '400':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/io.snyk.api.common.ErrorDocument'
          description: Invalid input
          headers:
            deprecation:
              schema:
                type: string
            snyk-request-id:
              schema:
                type: string
            snyk-version-lifecycle-stage:
              schema:
                type: string
            snyk-version-requested:
              schema:
                type: string
            snyk-version-served:
              schema:
                type: string
            sunset:
              description: 'A header containing the date of when the underlying endpoint will be removed. This header is only present if the endpoint has been deprecated. For information purposes only. Returned as a date in the format: YYYY-MM-DD'
              example: '2021-08-02'
              schema:
                format: date
                type: string
      summary: Create a new test. (Early Access)
      tags:
      - Tests
      x-snyk-api-lifecycle: released
      x-snyk-api-releases:
      - 2024-10-15~beta
      x-snyk-api-resource: tests
      x-snyk-api-stability: beta
      x-snyk-api-version: 2024-10-15~beta
      x-stability-level: beta
  /orgs/{org_id}/tests/{test_id}:
    get:
      description: '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)`'
      operationId: getTest
      parameters:
      - $ref: '#/components/parameters/io.snyk.api.request.SnykApiRequest.request_id'
      - $ref: '#/components/parameters/io.snyk.api.request.SnykApiRequest.interaction_id'
      - $ref: '#/components/parameters/io.snyk.api.request.SnykApiRequest.version'
      - description: 'Snyk Org ID under which to run or query information

          about a Job or Test.'
        in: path
        name: org_id
        required: true
        schema:
          format: uuid
          type: string
      - $ref: '#/components/parameters/TestIdParam'
      responses:
        '200':
          content:
            application/vnd.api+json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/TestData'
                  jsonapi:
                    $ref: '#/components/schemas/io.snyk.api.common.JsonApi'
                  links:
                    additionalProperties:
                      $ref: '#/components/schemas/io.snyk.api.common.LinkProperty'
                    properties:
                      related:
                        $ref: '#/components/schemas/io.snyk.api.common.LinkProperty'
                      self:
                        $ref: '#/components/schemas/io.snyk.api.common.LinkProperty'
                    type: object
                  meta:
                    $ref: '#/components/schemas/io.snyk.api.common.Meta'
                required:
                - data
                - jsonapi
                - links
                type: object
          description: Successful API response with a single resource
          headers:
            deprecation:
              schema:
                type: string
            snyk-request-id:
              schema:
                type: string
            snyk-version-lifecycle-stage:
              schema:
                type: string
            snyk-version-requested:
              schema:
                type: string
            snyk-version-served:
              schema:
                type: string
            sunset:
              description: 'A header containing the date of when the underlying endpoint will be removed. This header is only present if the endpoint has been deprecated. For information purposes only. Returned as a date in the format: YYYY-MM-DD'
              example: '2021-08-02'
              schema:
                format: date
                type: string
        '400':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/io.snyk.api.common.ErrorDocument'
          description: Invalid input
          headers:
            deprecation:
              schema:
                type: string
            snyk-request-id:
              schema:
                type: string
            snyk-version-lifecycle-stage:
              schema:
                type: string
            snyk-version-requested:
              schema:
                type: string
            snyk-version-served:
              schema:
                type: string
            sunset:
              description: 'A header containing the date of when the underlying endpoint will be removed. This header is only present if the endpoint has been deprecated. For information purposes only. Returned as a date in the format: YYYY-MM-DD'
              example: '2021-08-02'
              schema:
                format: date
                type: string
      summary: Get a test. (Early Access)
      tags:
      - Tests
      x-snyk-api-lifecycle: released
      x-snyk-api-releases:
      - 2024-10-15~beta
      x-snyk-api-resource: tests
      x-snyk-api-stability: beta
      x-snyk-api-version: 2024-10-15~beta
      x-stability-level: beta
components:
  schemas:
    UploadResource:
      description: 'Resource referring to an Upload Revision created through the

        File Upload API (currently in Closed Beta).


        Revisions contain collections of files uploaded by clients to

        Snyk for testing.


        UploadResources can be marked either as SBOM or Source to

        indicate the contents of the Revision.


        SBOM UploadResources should provide the following fields:

        - type

        - revision_id

        - name

        - file_patterns (may be empty)


        Source UploadResources should provide the following fields:

        - type

        - revision_id

        - repository_url

        - root_folder_id

        - file_patterns (may be empty)


        Currently supported scans utilizing UploadResources are:

        - SBOM (SCA): (1) UploadResource containing an SBOM

        - SBOM + Reachability Analysis (SCA): (1) UploadResource containing an SBOM, (1) UploadResource containing Source files.

        - Secrets: (1) UploadResource containing Source files'
      example:
        content_type: source
        file_patterns: []
        repository_url: https://github.com/example/repo
        revision_id: 00000000-0000-0000-0000-000000000000
        root_folder_id: .
        type: upload
      properties:
        content_type:
          description: 'Content present in the Upload Revision.


            Currently only SBOMs and Source files are accepted

            content types.'
          enum:
          - sbom
          - source
          type: string
        file_patterns:
          description: 'File Patterns to include in the scan. Elements must be less than 256 characters.


            Currently unsupported. Provide an empty list.'
          items:
            $ref: '#/components/schemas/String256'
          maxItems: 20
          type: array
        name:
          description: 'A name to assign to the SBOM contained in the UploadRevision.


            Overrides the filename in the UploadRevision.'
          maxLength: 256
          type: string
        repository_url:
          description: Repository URL at which the Source files are stored.
          maxLength: 1024
          type: string
        revision_id:
          description: 'The ID returned from the File Upload API for a given Revision.

            The File Upload API is released in Closed Beta.

            Customers with access may view the preview documentation for

            information on its usage.'
          example: 5025c59b-c4dd-48e3-b98a-e98d838f4c9b
          maxLength: 1024
          type: string
        root_folder_id:
          description: Folder inside the UploadRevision at which the Source files are located.
          maxLength: 1024
          type: string
        scm_context:
          $ref: '#/components/schemas/ScmContext'
        type:
          enum:
          - upload
          type: string
      required:
      - type
      - revision_id
      - content_type
      - file_patterns
      type: object
    io.snyk.api.common.ErrorDocument:
      properties:
        errors:
          items:
            $ref: '#/components/schemas/io.snyk.api.common.Error'
          minItems: 1
          type: array
        jsonapi:
          $ref: '#/components/schemas/io.snyk.api.common.JsonApi'
      required:
      - jsonapi
      - errors
      type: object
    ContainerScanConfiguration:
      description: Scan configuration parameters for the Container scanner.
      type: object
    io.snyk.api.common.JsonApi:
      properties:
        version:
          description: Version of the JSON API specification this server supports.
          enum:
          - '1.0'
          type: string
      required:
      - version
      type: object
    TestSubjectLocator:
      discriminator:
        mapping:
          local_path: '#/components/schemas/LocalPathLocator'
          other: '#/components/schemas/OtherLocator'
          project_entity: '#/components/schemas/ProjectEntityLocator'
          project_name: '#/components/schemas/ProjectNameLocator'
          scm_repo: '#/components/schemas/ScmRepoLocator'
        propertyName: type
      oneOf:
      - $ref: '#/components/schemas/ProjectEntityLocator'
      - $ref: '#/components/schemas/ProjectNameLocator'
      - $ref: '#/components/schemas/ScmRepoLocator'
      - $ref: '#/components/schemas/LocalPathLocator'
      - $ref: '#/components/schemas/OtherLocator'
    BaseResourceCreateItem:
      description: BaseResources contain a single instance of testable content.
      example:
        resource:
          content_type: source
          file_patterns: []
          repository_url: https://github.com/example/repo
          revision_id: 00000000-0000-0000-0000-000000000000
          root_folder_id: .
          type: upload
        type: base
      properties:
        resource:
          allOf:
          - $ref: '#/components/schemas/BaseResourceVariantCreateItem'
          description: The specific representation of what content to test.
        type:
          enum:
          - base
          type: string
      required:
      - type
      - resource
      type: object
    PolicyRefSet:
      description: A set of local and/or managed policies.
      properties:
        ids:
          items:
            $ref: '#/components/schemas/Uuid'
          type: array
        local_policy:
          type: boolean
      required:
      - ids
      type: object
    ScmRepoLocator:
      description: ScmRepoLocator locates a test subject by SCM repository coordinates.
      properties:
        branch_name:
          description: 'Branch name, if known and applicable to locating the test subject.


            If not specified, the branch name can be assumed to be the "default

            integration branch" of the repository.'
          type: string
        type:
          enum:
          - scm_repo
          type: string
        url:
          description: URL of the SCM repository.
          format: uri
          type: string
      required:
      - type
      - url
      type: object
    TestResourceCreateItem:
      anyOf:
      - $ref: '#/components/schemas/BaseResourceCreateItem'
      - $ref: '#/components/schemas/DiffResourceCreateItem'
      description: 'TestResources contain single instances of testable content

        to be provided to Snyk scanners.'
      discriminator:
        mapping:
          base: '#/components/schemas/BaseResourceCreateItem'
          diff: '#/components/schemas/DiffResourceCreateItem'
        propertyName: type
    TestConfiguration:
      description: Test configuration.
      properties:
        local_policy:
          allOf:
          - $ref: '#/components/schemas/LocalPolicy'
          description: 'Inline configured policy options for determining outcome of this specific test.


            If centrally managed policies are in scope, inline policies are overridden

            by managed policies. Policy references explain which policies were

            effective for test evaluation.'
        project_business_criticality:
          maxLength: 256
          type: string
        project_environment:
          items:
            type: string
          maxItems: 10
          type: array
        project_lifecycle:
          items:
            type: string
          maxItems: 10
          type: array
        project_tags:
          items:
            type: string
          maxItems: 10
          type: array
        publish_report:
          description: Publish findings into a report, viewable in the Snyk web UI.
          type: boolean
        scan_config:
          $ref: '#/components/schemas/ScanConfiguration'
        target_name:
          maxLength: 256
          type: string
        target_reference:
          description: Fields from CLI.
          maxLength: 1024
          type: string
        timeout:
          allOf:
          - $ref: '#/components/schemas/TimeoutSpec'
          description: 'Maximum test time in seconds, after which execution will be cancelled and

            the test will fail with reason "timeout".'
      type: object
    DiffResource:
      description: 'DiffResources contain two versions of the same content

        to compare against each other.


        The Base and Compare fields contain Resources representing

        an "existing" (base) version as well as a "new" (compare)

        version. Most commonly these Resources will be of the same type,

        e.g. an ScmResource containing a reference the `main` branch being

        compared to an ScmResource containing a reference to a new

        feature branch.


        Currently no scans are supported through the Test API

        for DiffResources.'
      example:
        base:
          file_patterns: []
          integration_id: 00000000-0000-0000-0000-000000000000
          ref: main
          repo_url: https://github.com/example/repo
          type: scm
        compare:
          file_patterns: []
          integration_id: 00000000-0000-0000-0000-000000000000
          ref: feat/homepage
          repo_url: https://github.com/example/repo
          type: scm
        type: diff
      properties:
        base:
          $ref: '#/components/schemas/BaseResourceVariant'
        compare:
          $ref: '#/components/schemas/BaseResourceVariant'
        type:
          enum:
          - diff
          type: string
      required:
      - type
      - base
      - compare
      type: object
    LocalPolicy:
      description: Locally configured policy options for determining outcome of this specific test.
      properties:
        fail_on_upgradable:
          default: false
          description: "Use to fail a test when there is at least one vulnerable finding that can be fixed by upgrading the version of the related\n   dependency. E.g. bumping lodash from 1.1.1 to 1.1.2."
          type: boolean
        ignores:
          description: Defines ignore rules for known issues.
          items:
            $ref: '#/components/schemas/LocalIgnore'
          type: arra

# --- truncated at 32 KB (80 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/snyk/refs/heads/main/openapi/snyk-tests-api-openapi.yml