Projects (v1)

This document uses the v1 API. For more details, see the v1 API.

Update a project

Required permissions

  • View Organization

  • View Project

  • Edit Project

PUThttps://api.snyk.io/v1/org/{orgId}/project/{projectId}
Path parameters
orgId*string

The organization ID the project belongs to. The API_KEY must have access to this organization.

projectId*string

The project ID.

Body
ownerall of
branchstring

The branch that this project should be monitoring

any
Response
Body
namestring
idstring

The project identifier

createdstring

The date that the project was created on

originstring

The origin the project was added from

typestring

The package manager of the project

readOnlyboolean

Whether the project is read-only

testFrequencystring

The frequency of automated Snyk re-test. Can be 'daily', 'weekly or 'never'

totalDependenciesnumber

Number of dependencies of the project

issueCountsBySeverityall of
imageIdstring

For docker projects shows the ID of the image

imageTagstring

For docker projects shows the tag of the image

imageBaseImagestring

For docker projects shows the base image

imagePlatformstring

For docker projects shows the platform of the image

imageClusterstring

For Kubernetes projects shows the origin cluster name

hostnamenullable string

The hostname for a CLI project, null if not set

remoteRepoUrlstring

The project remote repository url. Only set for projects imported via the Snyk CLI tool.

lastTestedDatestring

The date on which the most recent test was conducted for this project

ownernullable object

The user who owns the project, null if not set

{ "id": "e713cf94-bb02-4ea0-89d9-613cce0caed2", "name": "example-user@snyk.io", "username": "exampleUser", "email": "example-user@snyk.io" }

browseUrlstring

URL with project overview

importingUserall of
isMonitoredboolean

Describes if a project is currently monitored or it is de-activated

branchnullable string

The monitored branch (if available)

targetReferencenullable string

The identifier for which revision of the resource is scanned by Snyk. For example this may be a branch for SCM project, or a tag for a container image

tagsarray of string

List of applied tags

attributesstring

Applied project attributes

remediationall of
Request
const response = await fetch('https://api.snyk.io/v1/org/{orgId}/project/{projectId}', {
    method: 'PUT',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "owner": {
        "id": "1acd4d09-5602-4d04-9640-045fe928aaea"
      },
      "branch": "main"
    }),
});
const data = await response.json();
Response
{
  "name": "snyk/goof",
  "id": "af137b96-6966-46c1-826b-2e79ac49bbd9",
  "created": "2018-10-29T09:50:54.014Z",
  "origin": "github",
  "type": "maven",
  "readOnly": false,
  "testFrequency": "daily",
  "totalDependencies": 42,
  "issueCountsBySeverity": {
    "low": 13,
    "medium": 8,
    "high": 1,
    "critical": 3
  },
  "imageId": "sha256:caf27325b298a6730837023a8a342699c8b7b388b8d878966b064a1320043019",
  "imageTag": "latest",
  "imageBaseImage": "alpine:3",
  "imagePlatform": "linux/arm64",
  "imageCluster": "Production",
  "hostname": "text",
  "remoteRepoUrl": "https://github.com/snyk/goof.git",
  "lastTestedDate": "2019-02-05T08:54:07.704Z",
  "browseUrl": "https://app.snyk.io/org/4a18d42f-0706-4ad0-b127-24078731fbed/project/af137b96-6966-46c1-826b-2e79ac49bbd9",
  "importingUser": {
    "id": "e713cf94-bb02-4ea0-89d9-613cce0caed2",
    "name": "example-user@snyk.io",
    "username": "exampleUser",
    "email": "example-user@snyk.io"
  },
  "isMonitored": false,
  "branch": "text",
  "targetReference": "text",
  "tags": [
    "text"
  ],
  "attributes": "text",
  "remediation": {}
}

Retrieve a single project

Required permissions

  • View Organization

  • View Project

  • View Project Snapshot

GEThttps://api.snyk.io/v1/org/{orgId}/project/{projectId}
Path parameters
orgId*string

The organization ID the project belongs to. The API_KEY must have access to this organization.

projectId*string

The project ID.

Header parameters
Response
Body
namestring
idstring

The project identifier

createdstring

The date that the project was created on

originstring

The origin the project was added from

typestring

The package manager of the project

readOnlyboolean

Whether the project is read-only

testFrequencystring

The frequency of automated Snyk re-test. Can be 'daily', 'weekly or 'never'

totalDependenciesnumber

Number of dependencies of the project

issueCountsBySeverityall of
imageIdstring

For docker projects shows the ID of the image

imageTagstring

For docker projects shows the tag of the image

imageBaseImagestring

For docker projects shows the base image

imagePlatformstring

For docker projects shows the platform of the image

imageClusterstring

For Kubernetes projects shows the origin cluster name

hostnamenullable string

The hostname for a CLI project, null if not set

remoteRepoUrlstring

The project remote repository url. Only set for projects imported via the Snyk CLI tool.

lastTestedDatestring

The date on which the most recent test was conducted for this project

ownernullable object

The user who owns the project, null if not set

{ "id": "e713cf94-bb02-4ea0-89d9-613cce0caed2", "name": "example-user@snyk.io", "username": "exampleUser", "email": "example-user@snyk.io" }

browseUrlstring

URL with project overview

importingUserall of
isMonitoredboolean

Describes if a project is currently monitored or it is de-activated

branchnullable string

The monitored branch (if available)

targetReferencenullable string

The identifier for which revision of the resource is scanned by Snyk. For example this may be a branch for SCM project, or a tag for a container image

tagsarray of string

List of applied tags

attributesstring

Applied project attributes

remediationall of
Request
const response = await fetch('https://api.snyk.io/v1/org/{orgId}/project/{projectId}', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "name": "snyk/goof",
  "id": "af137b96-6966-46c1-826b-2e79ac49bbd9",
  "created": "2018-10-29T09:50:54.014Z",
  "origin": "github",
  "type": "maven",
  "readOnly": false,
  "testFrequency": "daily",
  "totalDependencies": 42,
  "issueCountsBySeverity": {
    "low": 13,
    "medium": 8,
    "high": 1,
    "critical": 3
  },
  "imageId": "sha256:caf27325b298a6730837023a8a342699c8b7b388b8d878966b064a1320043019",
  "imageTag": "latest",
  "imageBaseImage": "alpine:3",
  "imagePlatform": "linux/arm64",
  "imageCluster": "Production",
  "hostname": "text",
  "remoteRepoUrl": "https://github.com/snyk/goof.git",
  "lastTestedDate": "2019-02-05T08:54:07.704Z",
  "browseUrl": "https://app.snyk.io/org/4a18d42f-0706-4ad0-b127-24078731fbed/project/af137b96-6966-46c1-826b-2e79ac49bbd9",
  "importingUser": {
    "id": "e713cf94-bb02-4ea0-89d9-613cce0caed2",
    "name": "example-user@snyk.io",
    "username": "exampleUser",
    "email": "example-user@snyk.io"
  },
  "isMonitored": false,
  "branch": "text",
  "targetReference": "text",
  "tags": [
    "text"
  ],
  "attributes": "text",