SastSettings

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

Enable/Disable the Snyk Code settings for an org

patch

Enable/Disable the Snyk Code settings for an org

Authorizations
Path parameters
org_idstring · uuidrequired

The id of the org for which we want to update the Snyk Code setting

Query parameters
versionstringrequired

Requested API version

Example: 2021-06-04
Pattern: ^(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
dataobjectrequired

Responses
curl -L \
  --request PATCH \
  --url 'https://api.snyk.io/rest/orgs/{org_id}/settings/sast?version=text' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --header 'Content-Type: application/vnd.api+json' \
  --data '{
    "data": {
      "attributes": {
        "sast_enabled": true
      },
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "type": "text"
    }
  }'
{
  "data": {
    "attributes": {
      "autofix_enabled": true,
      "sast_enabled": true
    },
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "type": "text"
  },
  "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"
  }
}

Retrieves the SAST settings for an org

get

Retrieves the SAST settings for an org

Authorizations
Path parameters
org_idstring · uuidrequired

The id of the org for which we want to retrieve the SAST settings

Query parameters
versionstringrequired

Requested API version

Example: 2021-06-04
Pattern: ^(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
curl -L \
  --url 'https://api.snyk.io/rest/orgs/{org_id}/settings/sast?version=text' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "data": {
    "attributes": {
      "autofix_enabled": true,
      "sast_enabled": true
    },
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "type": "text"
  },
  "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"
  }
}

Last updated

Was this helpful?

Revision created

Add comment to emphasize required filters hidden in GitBook collapsed field