Projects
Last updated
Last updated
List all Projects for an Org.
The ID of the org that the projects belong to.
A list of projects is returned for the targeted org
Updates one project of the organization by project ID.
The ID of the Org the project belongs to.
The ID of the project to patch.
The project attributes to be updated.
A project is updated for the targeted org
Delete one project in the organization by project ID.
The ID of the org to which the project belongs to.
The ID of the project.
The project has been deleted
Get one project of the organization by project ID.
The ID of the org to which the project belongs to.
The ID of the project.
A project is returned for the targeted org
const response = await fetch('https://api.snyk.io/rest/orgs/{org_id}/projects?version=text', {
method: 'GET',
headers: {},
});
const data = await response.json();
{
"data": [
{
"attributes": {
"build_args": {
"root_workspace": "text"
},
"business_criticality": [
"medium"
],
"created": "2021-05-29T09:50:54.014Z",
"environment": [
"external",
"hosted"
],
"lifecycle": [
"production"
],
"name": "snyk/goof",
"origin": "github",
"read_only": false,
"settings": {
"auto_dependency_upgrade": {
"ignored_dependencies": [
"typescript"
],
"is_enabled": true,
"is_major_upgrade_enabled": true,
"limit": 10,
"minimum_age": 365
},
"auto_remediation_prs": {
"is_backlog_prs_enabled": true,
"is_fresh_prs_enabled": true,
"is_patch_remediation_enabled": true
},
"manual_remediation_prs": {
"is_patch_remediation_enabled": true
},
"pull_request_assignment": {
"assignees": [
"my-github-username"
],
"is_enabled": true,
"type": "auto"
},
"pull_requests": {
"fail_only_for_issues_with_fix": true,
"policy": "all",
"severity_threshold": "high"
},
"recurring_tests": {
"frequency": "daily"
}
},
"status": "active",
"tags": [
{
"key": "tag-key",
"value": "tag-value"
}
],
"target_file": "package.json",
"target_reference": "main",
"target_runtime": "text",
"type": "maven"
},
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"cli_monitored_at": "2021-05-29T09:50:54.014Z",
"latest_dependency_total": {
"total": 0,
"updated_at": "2025-01-22T20:01:35.006Z"
},
"latest_issue_counts": {
"critical": 0,
"high": 0,
"low": 0,
"medium": 0,
"updated_at": "2025-01-22T20:01:35.006Z"
}
},
"relationships": {
"importer": {
"data": {
"id": "4a72d1db-b465-4764-99e1-ecedad03b06a",
"type": "resource"
},
"links": {
"related": {
"href": "https://example.com/api/resource/4a72d1db-b465-4764-99e1-ecedad03b06a"
}
}
},
"organization": {
"data": {
"id": "4a72d1db-b465-4764-99e1-ecedad03b06a",
"type": "resource"
},
"links": {
"related": {
"href": "https://example.com/api/resource/4a72d1db-b465-4764-99e1-ecedad03b06a"
}
}
},
"owner": {
"data": {
"id": "4a72d1db-b465-4764-99e1-ecedad03b06a",
"type": "resource"
},
"links": {
"related": {
"href": "https://example.com/api/resource/4a72d1db-b465-4764-99e1-ecedad03b06a"
}
}
},
"target": {
"data": {
"id": "4a72d1db-b465-4764-99e1-ecedad03b06a",
"type": "resource"
},
"links": {
"related": {
"href": "https://example.com/api/resource/4a72d1db-b465-4764-99e1-ecedad03b06a"
}
}
}
},
"type": "project"
}
],
"jsonapi": {
"version": "1.0"
},
"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"
},
"meta": {
"count": 0
}
}
const response = await fetch('https://api.snyk.io/rest/orgs/{org_id}/projects/{project_id}?version=text', {
method: 'PATCH',
headers: {
"Content-Type": "application/vnd.api+json"
},
body: JSON.stringify({
"data": {
"type": "project",
"id": "331ede0a-de94-456f-b788-166caeca58bf",
"attributes": {},
"relationships": {}
}
}),
});
const data = await response.json();
{
"data": {
"attributes": {
"build_args": {
"root_workspace": "text"
},
"business_criticality": [
"medium"
],
"created": "2021-05-29T09:50:54.014Z",
"environment": [
"external",
"hosted"
],
"lifecycle": [
"production"
],
"name": "snyk/goof",
"origin": "github",
"read_only": false,
"settings": {
"auto_dependency_upgrade": {
"ignored_dependencies": [
"typescript"
],
"is_enabled": true,
"is_major_upgrade_enabled": true,
"limit": 10,
"minimum_age": 365
},
"auto_remediation_prs": {
"is_backlog_prs_enabled": true,
"is_fresh_prs_enabled": true,
"is_patch_remediation_enabled": true
},
"manual_remediation_prs": {
"is_patch_remediation_enabled": true
},
"pull_request_assignment": {
"assignees": [
"my-github-username"
],
"is_enabled": true,
"type": "auto"
},
"pull_requests": {
"fail_only_for_issues_with_fix": true,
"policy": "all",
"severity_threshold": "high"
},
"recurring_tests": {
"frequency": "daily"
}
},
"status": "active",
"tags": [
{
"key": "tag-key",
"value": "tag-value"
}
],
"target_file": "package.json",
"target_reference": "main",
"target_runtime": "text",
"type": "maven"
},
"id": "331ede0a-de94-456f-b788-166caeca58bf",
"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"
},
"meta": {
"cli_monitored_at": "2021-05-29T09:50:54.014Z"
},
"relationships": {
"importer": {
"data": {
"id": "4a72d1db-b465-4764-99e1-ecedad03b06a",
"type": "resource"
},
"links": {
"related": {
"href": "https://example.com/api/resource/4a72d1db-b465-4764-99e1-ecedad03b06a"
}
}
},
"organization": {
"data": {
"id": "4a72d1db-b465-4764-99e1-ecedad03b06a",
"type": "resource"
},
"links": {
"related": {
"href": "https://example.com/api/resource/4a72d1db-b465-4764-99e1-ecedad03b06a"
}
}
},
"owner": {
"data": {
"id": "4a72d1db-b465-4764-99e1-ecedad03b06a",
"type": "resource"
},
"links": {
"related": {
"href": "https://example.com/api/resource/4a72d1db-b465-4764-99e1-ecedad03b06a"
}
}
},
"target": {
"data": {
"id": "4a72d1db-b465-4764-99e1-ecedad03b06a",
"type": "resource"
},
"links": {
"related": {
"href": "https://example.com/api/resource/4a72d1db-b465-4764-99e1-ecedad03b06a"
}
}
}
},
"type": "project"
},
"jsonapi": {
"version": "1.0"
},
"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"
}
}
const response = await fetch('https://api.snyk.io/rest/orgs/{org_id}/projects/{project_id}?version=text', {
method: 'DELETE',
headers: {},
});
const data = await response.json();
{
"errors": [
{
"detail": "Permission denied for this resource",
"status": "403"
}
],
"jsonapi": {
"version": "1.0"
}
}
const response = await fetch('https://api.snyk.io/rest/orgs/{org_id}/projects/{project_id}?version=text', {
method: 'GET',
headers: {},
});
const data = await response.json();
{
"data": {
"attributes": {
"build_args": {
"root_workspace": "text"
},
"business_criticality": [
"medium"
],
"created": "2021-05-29T09:50:54.014Z",
"environment": [
"external",
"hosted"
],
"lifecycle": [
"production"
],
"name": "snyk/goof",
"origin": "github",
"read_only": false,
"settings": {
"auto_dependency_upgrade": {
"ignored_dependencies": [
"typescript"
],
"is_enabled": true,
"is_major_upgrade_enabled": true,
"limit": 10,
"minimum_age": 365
},
"auto_remediation_prs": {
"is_backlog_prs_enabled": true,
"is_fresh_prs_enabled": true,
"is_patch_remediation_enabled": true
},
"manual_remediation_prs": {
"is_patch_remediation_enabled": true
},
"pull_request_assignment": {
"assignees": [
"my-github-username"
],
"is_enabled": true,
"type": "auto"
},
"pull_requests": {
"fail_only_for_issues_with_fix": true,
"policy": "all",
"severity_threshold": "high"
},
"recurring_tests": {
"frequency": "daily"
}
},
"status": "active",
"tags": [
{
"key": "tag-key",
"value": "tag-value"
}
],
"target_file": "package.json",
"target_reference": "main",
"target_runtime": "text",
"type": "maven"
},
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"cli_monitored_at": "2021-05-29T09:50:54.014Z",
"latest_dependency_total": {
"total": 0,
"updated_at": "2025-01-22T20:01:35.006Z"
},
"latest_issue_counts": {
"critical": 0,
"high": 0,
"low": 0,
"medium": 0,
"updated_at": "2025-01-22T20:01:35.006Z"
}
},
"relationships": {
"importer": {
"data": {
"id": "4a72d1db-b465-4764-99e1-ecedad03b06a",
"type": "resource"
},
"links": {
"related": {
"href": "https://example.com/api/resource/4a72d1db-b465-4764-99e1-ecedad03b06a"
}
}
},
"organization": {
"data": {
"id": "4a72d1db-b465-4764-99e1-ecedad03b06a",
"type": "resource"
},
"links": {
"related": {
"href": "https://example.com/api/resource/4a72d1db-b465-4764-99e1-ecedad03b06a"
}
}
},
"owner": {
"data": {
"id": "4a72d1db-b465-4764-99e1-ecedad03b06a",
"type": "resource"
},
"links": {
"related": {
"href": "https://example.com/api/resource/4a72d1db-b465-4764-99e1-ecedad03b06a"
}
}
},
"target": {
"data": {
"id": "4a72d1db-b465-4764-99e1-ecedad03b06a",
"type": "resource"
},
"links": {
"related": {
"href": "https://example.com/api/resource/4a72d1db-b465-4764-99e1-ecedad03b06a"
}
}
}
},
"type": "project"
},
"jsonapi": {
"version": "1.0"
},
"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"
}
}