SlackSettings

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

Create new Slack notification default settings.

Create new Slack notification default settings for a given tenant.

POSThttps://api.snyk.io/rest/orgs/{org_id}/slack_app/{bot_id}
Path parameters
org_id*string (uuid)

Org ID

bot_id*Uuid (string (uuid))

Bot ID

Query parameters
Body

Create new Slack notification default settings for a tenant.

data*object
Response

Default settings created successfully

Headers
Body
dataSlackDefaultSettingsData (object)
jsonapiJsonApi (object)
linksSelfLink (object)
Request
const response = await fetch('https://api.snyk.io/rest/orgs/{org_id}/slack_app/{bot_id}', {
    method: 'POST',
    headers: {
      "Content-Type": "application/vnd.api+json"
    },
    body: JSON.stringify({
      "data": {
        "type": "slack",
        "attributes": {
          "target_channel_id": "slack://channel?team=team-id&id=channel-id",
          "severity_threshold": "high"
        }
      }
    }),
});
const data = await response.json();
Response
{
  "data": {
    "attributes": {
      "severity_threshold": "high",
      "target_channel_id": "slack://channel?team=team-id&id=channel-id",
      "target_channel_name": "channel-name"
    },
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "type": "slack"
  },
  "jsonapi": {
    "version": "1.0"
  },
  "links": {
    "self": "https://example.com/api/this_resource"
  }
}

Get Slack integration default notification settings.

Get Slack integration default notification settings for the provided tenant ID and bot ID.

GEThttps://api.snyk.io/rest/orgs/{org_id}/slack_app/{bot_id}
Path parameters
org_id*string (uuid)

Org ID

bot_id*Uuid (string (uuid))

Bot ID

Query parameters
Response

Default settings created successfully

Headers
Body
dataSlackDefaultSettingsData (object)
jsonapiJsonApi (object)
linksSelfLink (object)
Request
const response = await fetch('https://api.snyk.io/rest/orgs/{org_id}/slack_app/{bot_id}', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "data": {
    "attributes": {
      "severity_threshold": "high",
      "target_channel_id": "slack://channel?team=team-id&id=channel-id",
      "target_channel_name": "channel-name"
    },
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "type": "slack"
  },
  "jsonapi": {
    "version": "1.0"
  },
  "links": {
    "self": "https://example.com/api/this_resource"
  }
}

Remove the given Slack App integration

Remove the given Slack App integration

DELETEhttps://api.snyk.io/rest/orgs/{org_id}/slack_app/{bot_id}
Path parameters
org_id*string (uuid)

Org ID

bot_id*Uuid (string (uuid))

Bot ID

Query parameters
Response

Slack App integration successfully removed

Headers
Request
const response = await fetch('https://api.snyk.io/rest/orgs/{org_id}/slack_app/{bot_id}', {
    method: 'DELETE',
    headers: {},
});
const data = await response.json();
Response
{
  "errors": [
    {
      "detail": "Permission denied for this resource",
      "status": "403"
    }
  ],
  "jsonapi": {
    "version": "1.0"