Assets

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

Create Asset (Early Access)

post

Create a new asset

Required permissions

  • View Organization (org.read)
Authorizations
Path parameters
org_idstring · uuidRequired

The organization ID

Query parameters
versionstringRequired

Requested API version

Example: 2021-06-04Pattern: ^(wip|work-in-progress|experimental|beta|((([0-9]{4})-([0-1][0-9]))-((3[01])|(0[1-9])|([12][0-9]))(~(wip|work-in-progress|experimental|beta))?))$
Body

Defines the request body structure for the Create Asset operation.

Responses
201

Asset created

application/vnd.api+json
post
POST /rest/orgs/{org_id}/assets HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 502

{
  "data": {
    "attributes": {
      "asset_type": "files_collection",
      "content_hash": "sha256:abcdef1234567890abcdef1234567890abcdef1234567890abcdef123456",
      "file_paths": [
        "src/main.js",
        "static/index.html",
        "config/settings.json"
      ],
      "fs_path": "/var/www/my-project",
      "hostname": "dev-server-01.example.com"
    },
    "meta": {
      "discovery": {
        "source": "cli",
        "type": "sca"
      }
    },
    "relationships": {
      "projects": {
        "data": {
          "id": "a1b2c3d4-e4f5-a6b7-c8d9-e0f1a2b3c4d5",
          "type": "projects"
        },
        "meta": {
          "name": "My Example Project (CLI Scan)"
        }
      }
    },
    "type": "assets"
  }
}
{
  "data": {
    "attributes": {
      "created_at": "2025-08-21T12:03:51.611Z",
      "deleted_at": "2025-08-21T12:03:51.611Z",
      "modified_at": "2025-08-21T12:03:51.611Z",
      "scope": {
        "org_id": "c7e8f9a0-b1c2-d3e4-f5a6-b7c8d9e0f1a2"
      },
      "aliases": [
        "[email protected]:snyk/assets-api.git"
      ],
      "scm_id": "gh_123456789",
      "url": "https://github.com/snyk/assets-api.git",
      "asset_type": "repository"
    },
    "id": "a0b1c2d3-e4f5-a6b7-c8d9-e0f1a2b3c4d5",
    "relationships": {
      "packages": {
        "data": [
          {
            "id": "text",
            "type": "text"
          }
        ],
        "meta": {}
      },
      "parent": {
        "data": {
          "id": "text",
          "type": "text"
        },
        "meta": {}
      },
      "projects": {
        "data": {
          "id": "text",
          "type": "text"
        },
        "meta": {}
      },
      "targets": {
        "data": [
          {
            "id": "text",
            "type": "text"
          }
        ],
        "meta": {}
      }
    },
    "type": "assets"
  },
  "jsonapi": {
    "version": "2024-10-14"
  },
  "links": {
    "self": {}
  },
  "meta": {}
}

List Assets (Early Access)

get

List assets with optional filtering

Required permissions

  • View Organization (org.read)
Authorizations
Path parameters
org_idstring · uuidRequired

The organization ID

Query parameters
versionstringRequired

Requested API version

Example: 2021-06-04Pattern: ^(wip|work-in-progress|experimental|beta|((([0-9]{4})-([0-1][0-9]))-((3[01])|(0[1-9])|([12][0-9]))(~(wip|work-in-progress|experimental|beta))?))$
limitinteger · min: 1 · max: 100Optional

Number of records to return, up to 100.

Default: 10
starting_afterstringOptional

Return 'limit' records after the record identified by cursor position 'starting_after'.

ending_beforestringOptional

Return 'limit' records before the record identified by cursor position 'ending_before'.

Responses
200

List of assets

application/vnd.api+json
Responseall of

Represents a JSON API response document containing a collection of Asset resources as its primary data.

get
GET /rest/orgs/{org_id}/assets HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Accept: */*
{
  "data": [
    {
      "attributes": {
        "created_at": "2025-08-21T12:03:51.611Z",
        "deleted_at": "2025-08-21T12:03:51.611Z",
        "modified_at": "2025-08-21T12:03:51.611Z",
        "scope": {
          "org_id": "c7e8f9a0-b1c2-d3e4-f5a6-b7c8d9e0f1a2"
        },
        "aliases": [
          "[email protected]:snyk/assets-api.git"
        ],
        "scm_id": "gh_123456789",
        "url": "https://github.com/snyk/assets-api.git",
        "asset_type": "repository"
      },
      "id": "a0b1c2d3-e4f5-a6b7-c8d9-e0f1a2b3c4d5",
      "relationships": {
        "packages": {
          "data": [
            {
              "id": "text",
              "type": "text"
            }
          ],
          "meta": {}
        },
        "parent": {
          "data": {
            "id": "text",
            "type": "text"
          },
          "meta": {}
        },
        "projects": {
          "data": {
            "id": "text",
            "type": "text"
          },
          "meta": {}
        },
        "targets": {
          "data": [
            {
              "id": "text",
              "type": "text"
            }
          ],
          "meta": {}
        }
      },
      "type": "assets"
    }
  ],
  "jsonapi": {
    "version": "2024-10-14"
  },
  "links": {
    "last": "https://api.snyk.io/rest/orgs/ORG_ID/assets?page[offset]=100&page[limit]=10",
    "next": "https://api.snyk.io/rest/orgs/ORG_ID/assets?page[offset]=10&page[limit]=10",
    "self": "https://api.snyk.io/rest/orgs/ORG_ID/assets?page[offset]=0&page[limit]=10"
  },
  "meta": {}
}

Get an Asset by its ID (Early Access)

get

Retrieve an asset by its unique identifier

Required permissions

  • View Organization (org.read)
Authorizations
Path parameters
asset_idstring · uuidRequired

The unique identifier of the asset

org_idstring · uuidRequired

The organization ID

Query parameters
versionstringRequired

Requested API version

Example: 2021-06-04Pattern: ^(wip|work-in-progress|experimental|beta|((([0-9]{4})-([0-1][0-9]))-((3[01])|(0[1-9])|([12][0-9]))(~(wip|work-in-progress|experimental|beta))?))$
Responses
200

Asset found

application/vnd.api+json
get
GET /rest/orgs/{org_id}/assets/{asset_id} HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Accept: */*
{
  "data": {
    "attributes": {
      "created_at": "2025-08-21T12:03:51.611Z",
      "deleted_at": "2025-08-21T12:03:51.611Z",
      "modified_at": "2025-08-21T12:03:51.611Z",
      "scope": {
        "org_id": "c7e8f9a0-b1c2-d3e4-f5a6-b7c8d9e0f1a2"
      },
      "aliases": [
        "[email protected]:snyk/assets-api.git"
      ],
      "scm_id": "gh_123456789",
      "url": "https://github.com/snyk/assets-api.git",
      "asset_type": "repository"
    },
    "id": "a0b1c2d3-e4f5-a6b7-c8d9-e0f1a2b3c4d5",
    "relationships": {
      "packages": {
        "data": [
          {
            "id": "text",
            "type": "text"
          }
        ],
        "meta": {}
      },
      "parent": {
        "data": {
          "id": "text",
          "type": "text"
        },
        "meta": {}
      },
      "projects": {
        "data": {
          "id": "text",
          "type": "text"
        },
        "meta": {}
      },
      "targets": {
        "data": [
          {
            "id": "text",
            "type": "text"
          }
        ],
        "meta": {}
      }
    },
    "type": "assets"
  },
  "jsonapi": {
    "version": "2024-10-14"
  },
  "links": {
    "self": {}
  },
  "meta": {}
}

Get an Asset by its ID (Early Access)

get

Get an Asset by its ID

Required permissions

  • View Groups (group.read)
Authorizations
Path parameters
asset_idstring · uuidRequired

Unique identifier for the Asset

group_idstring · uuidRequired

Group ID

Query parameters
versionstringRequired

Requested API version

Example: 2021-06-04Pattern: ^(wip|work-in-progress|experimental|beta|((([0-9]{4})-([0-1][0-9]))-((3[01])|(0[1-9])|([12][0-9]))(~(wip|work-in-progress|experimental|beta))?))$
Responses
200

Asset found

application/vnd.api+json
get
GET /rest/groups/{group_id}/assets/{asset_id} HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Accept: */*
{
  "data": {
    "attributes": {
      "app_context": {},
      "archived": true,
      "base_image": "text",
      "browse_url": "https://example.com",
      "class": {
        "locked": true,
        "name": "A",
        "rank": 1
      },
      "coverage_controls": [
        {
          "category": "security",
          "gap": true,
          "issues_count": {
            "critical": 1,
            "high": 2,
            "low": 0,
            "medium": 0
          },
          "last_scan": "2023-10-10T08:00:00Z",
          "name": "control1"
        }
      ],
      "created_at": "2025-08-21T12:03:51.611Z",
      "default_branch_name": "main",
      "developers": [
        {
          "discovered_by": "github",
          "email": "[email protected]",
          "url": "https://github.com/johndoe",
          "username": "johndoe"
        }
      ],
      "file_path": "text",
      "image_digests": [
        "text"
      ],
      "image_id": "text",
      "image_registries": [
        "text"
      ],
      "image_repositories": [
        "text"
      ],
      "image_tags": [
        "text"
      ],
      "languages": {
        "ANY_ADDITIONAL_PROPERTY": 1
      },
      "name": "text",
      "repository_freshness": "Ynl0ZXM=",
      "repository_url": "text",
      "risk_factors": [
        "text"
      ],
      "sources": [
        "text"
      ],
      "tags": [
        "text"
      ],
      "updated_at": "2025-08-21T12:03:51.611Z"
    },
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "relationships": {
      "assets": {
        "links": {
          "related": "text"
        }
      },
      "organizations": {
        "data": [
          {
            "attributes": {
              "name": "text"
            },
            "id": "text",
            "type": "text"
          }
        ]
      },
      "projects": {
        "links": {
          "related": "text"
        }
      }
    },
    "removed": true,
    "type": "repository"
  },
  "jsonapi": {
    "version": "text"
  },
  "links": {
    "self": "https://example.com/api/this_resource"
  }
}

List asset projects with pagination (Early Access)

get

List asset projects with pagination

Required permissions

  • View Groups (group.read)
Authorizations
Path parameters
group_idstring · uuidRequired

Group ID

asset_idstring · uuidRequired

Unique identifier for the Asset

Query parameters
starting_afterstringOptional

Return records after the record identified by cursor position starting_after

ending_beforestringOptional

Return records before the record identified by cursor position ending_before

limitnumber · min: 10 · max: 100Optional

Number of records to return

Default: 10
versionstringRequired

Requested API version

Example: 2021-06-04Pattern: ^(wip|work-in-progress|experimental|beta|((([0-9]{4})-([0-1][0-9]))-((3[01])|(0[1-9])|([12][0-9]))(~(wip|work-in-progress|experimental|beta))?))$
Responses
200

Assets found

application/vnd.api+json
get
GET /rest/groups/{group_id}/assets/{asset_id}/relationships/projects HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Accept: */*
{
  "data": [
    {
      "attributes": {
        "issues_counts": {
          "critical": 1,
          "high": 1,
          "low": 1,
          "medium": 1
        },
        "last_scan": "text",
        "name": "text",
        "organization_id": "text",
        "organization_name": "text",
        "project_type": "text",
        "target_file": "text",
        "target_id": "text",
        "target_reference": "text",
        "test_surface": "text",
        "url": "text"
      },
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "type": "project"
    }
  ],
  "jsonapi": {
    "version": "text"
  },
  "links": {
    "first": "https://example.com/api/resource",
    "last": "https://example.com/api/resource",
    "next": "https://example.com/api/resource",
    "prev": "https://example.com/api/resource",
    "related": "https://example.com/api/resource",
    "self": "https://example.com/api/resource"
  }
}

List related assets with pagination (Early Access)

get

List related assets with pagination

Required permissions

  • View Groups (group.read)
Authorizations
Path parameters
group_idstring · uuidRequired

Group ID

asset_idstring · uuidRequired

Unique identifier for the Asset

Query parameters
starting_afterstringOptional

Return records after the record identified by cursor position starting_after

ending_beforestringOptional

Return records before the record identified by cursor position ending_before

limitnumber · min: 10 · max: 100Optional

Number of records to return

Default: 10
versionstringRequired

Requested API version

Example: 2021-06-04Pattern: ^(wip|work-in-progress|experimental|beta|((([0-9]{4})-([0-1][0-9]))-((3[01])|(0[1-9])|([12][0-9]))(~(wip|work-in-progress|experimental|beta))?))$
typestring · enumOptional

Filter by asset type

Possible values:
Responses
200

Related assets found

application/vnd.api+json
get
GET /rest/groups/{group_id}/assets/{asset_id}/relationships/assets HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Accept: */*
{
  "data": [
    {
      "attributes": {
        "app_context": {},
        "archived": true,
        "base_image": "text",
        "browse_url": "https://example.com",
        "class": {
          "locked": true,
          "name": "A",
          "rank": 1
        },
        "coverage_controls": [
          {
            "category": "security",
            "gap": true,
            "issues_count": {
              "critical": 1,
              "high": 2,
              "low": 0,
              "medium": 0
            },
            "last_scan": "2023-10-10T08:00:00Z",
            "name": "control1"
          }
        ],
        "created_at": "2025-08-21T12:03:51.611Z",
        "default_branch_name": "main",
        "developers": [
          {
            "discovered_by": "github",
            "email": "[email protected]",
            "url": "https://github.com/johndoe",
            "username": "johndoe"
          }
        ],
        "file_path": "text",
        "image_digests": [
          "text"
        ],
        "image_id": "text",
        "image_registries": [
          "text"
        ],
        "image_repositories": [
          "text"
        ],
        "image_tags": [
          "text"
        ],
        "languages": {
          "ANY_ADDITIONAL_PROPERTY": 1
        },
        "name": "text",
        "repository_freshness": "Ynl0ZXM=",
        "repository_url": "text",
        "risk_factors": [
          "text"
        ],
        "sources": [
          "text"
        ],
        "tags": [
          "text"
        ],
        "updated_at": "2025-08-21T12:03:51.611Z"
      },
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "relationships": {
        "assets": {
          "links": {
            "related": "text"
          }
        },
        "organizations": {
          "data": [
            {
              "attributes": {
                "name": "text"
              },
              "id": "text",
              "type": "text"
            }
          ]
        },
        "projects": {
          "links": {
            "related": "text"
          }
        }
      },
      "removed": true,
      "type": "repository"
    }
  ],
  "jsonapi": {
    "version": "text"
  },
  "links": {
    "first": "https://example.com/api/resource",
    "last": "https://example.com/api/resource",
    "next": "https://example.com/api/resource",
    "prev": "https://example.com/api/resource",
    "related": "https://example.com/api/resource",
    "self": "https://example.com/api/resource"
  }
}

List Assets with filters (Early Access)

post

List Assets with filters

Required permissions

  • View Groups (group.read)
Authorizations
Path parameters
group_idstring · uuidRequired

Group ID

Query parameters
versionstringRequired

Requested API version

Example: 2021-06-04Pattern: ^(wip|work-in-progress|experimental|beta|((([0-9]{4})-([0-1][0-9]))-((3[01])|(0[1-9])|([12][0-9]))(~(wip|work-in-progress|experimental|beta))?))$
Body
any ofOptional
objectOptional

Empty body

or
Responses
200

Assets found

application/vnd.api+json
post
POST /rest/groups/{group_id}/assets/search HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 88

{
  "query": {
    "attributes": {
      "attribute": "type",
      "operator": "equal",
      "values": [
        "repository"
      ]
    }
  }
}
{
  "data": [
    {
      "attributes": {
        "app_context": {},
        "archived": true,
        "base_image": "text",
        "browse_url": "https://example.com",
        "class": {
          "locked": true,
          "name": "A",
          "rank": 1
        },
        "coverage_controls": [
          {
            "category": "security",
            "gap": true,
            "issues_count": {
              "critical": 1,
              "high": 2,
              "low": 0,
              "medium": 0
            },
            "last_scan": "2023-10-10T08:00:00Z",
            "name": "control1"
          }
        ],
        "created_at": "2025-08-21T12:03:51.611Z",
        "default_branch_name": "main",
        "developers": [
          {
            "discovered_by": "github",
            "email": "[email protected]",
            "url": "https://github.com/johndoe",
            "username": "johndoe"
          }
        ],
        "file_path": "text",
        "image_digests": [
          "text"
        ],
        "image_id": "text",
        "image_registries": [
          "text"
        ],
        "image_repositories": [
          "text"
        ],
        "image_tags": [
          "text"
        ],
        "languages": {
          "ANY_ADDITIONAL_PROPERTY": 1
        },
        "name": "text",
        "repository_freshness": "Ynl0ZXM=",
        "repository_url": "text",
        "risk_factors": [
          "text"
        ],
        "sources": [
          "text"
        ],
        "tags": [
          "text"
        ],
        "updated_at": "2025-08-21T12:03:51.611Z"
      },
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "relationships": {
        "assets": {
          "links": {
            "related": "text"
          }
        },
        "organizations": {
          "data": [
            {
              "attributes": {
                "name": "text"
              },
              "id": "text",
              "type": "text"
            }
          ]
        },
        "projects": {
          "links": {
            "related": "text"
          }
        }
      },
      "removed": true,
      "type": "repository"
    }
  ],
  "jsonapi": {
    "version": "text"
  },
  "links": {
    "first": "https://example.com/api/resource",
    "last": "https://example.com/api/resource",
    "next": "https://example.com/api/resource",
    "prev": "https://example.com/api/resource",
    "related": "https://example.com/api/resource",
    "self": "https://example.com/api/resource"
  }
}

Last updated

Was this helpful?