Integrations (v1)

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

Add new integration

post

Add new integration for given organization.

Required permissions

  • View Organization

  • View Integrations

  • Edit Integrations

Path parameters
orgIdstringrequired

The organization ID. The API_KEY must have admin access to this organization.

Example: 4a18d42f-0706-4ad0-b127-24078731fbed
Body
one ofoptional

Responses
curl -L \
  --request POST \
  --url 'https://api.snyk.io/v1/org/{orgId}/integrations' \
  --header 'Content-Type: application/json; charset=utf-8' \
  --data '{
    "type": "acr",
    "credentials": {
      "username": "text",
      "password": "text",
      "registryBase": "text"
    }
  }'
{
  "id": "9a3e5d90-b782-468a-a042-9a2073736f0b"
}

List

get

Required permissions

  • View Organization

  • View Integrations

Path parameters
orgIdstringrequired

The organization public ID. The API_KEY must have admin access to this organization.

Example: 4a18d42f-0706-4ad0-b127-24078731fbed
Header parameters
Content-Typestring · enumrequired
Example: application/json; charset=utf-8
Options: application/json; charset=utf-8
Responses
curl -L \
  --url 'https://api.snyk.io/v1/org/{orgId}/integrations' \
  --header 'Content-Type: application/json; charset=utf-8'
{
  "github": "9a3e5d90-b782-468a-a042-9a2073736f0b",
  "gitlab": "1b3e3d90-c678-347a-n232-6a3453738h1e",
  "bitbucket-cloud": "6jje4c92-e7rn-t59a-f456-8n5675432fe9"
}

Get existing integration by type

get

Required permissions

  • View Organization - View Integrations
Path parameters
orgIdstringrequired

The API_KEY must have admin access to this organization.

Example: 4a18d42f-0706-4ad0-b127-24078731fbed
typeall ofrequired

Integration type.

Integration type.

Header parameters
Content-Typestring · enumrequired
Example: application/json; charset=utf-8
Options: application/json; charset=utf-8
Responses
curl -L \
  --url 'https://api.snyk.io/v1/org/{orgId}/integrations/{type}' \
  --header 'Content-Type: application/json; charset=utf-8'
{
  "id": "9a3e5d90-b782-468a-a042-9a2073736f0b"
}

Update existing integration

put
  • Update integration's credentials for given organization. Integration must be not brokered

  • Enable or disable brokered integration for given organization. Credentials required for disabling brokered integration

Examples:

Required permissions

  • View Organization

  • View Integrations

  • Edit Integrations

Path parameters
orgIdstringrequired

The organization ID. The API_KEY must have admin access to this organization.

Example: 4a18d42f-0706-4ad0-b127-24078731fbed
integrationIdstringrequired

The unique identifier for the configured integration. This can be found on the Integration page in the Settings area for all integrations that have been configured.

Example: 9a3e5d90-b782-468a-a042-9a2073736f0b
Body
all ofoptional

Responses
curl -L \
  --request PUT \
  --url 'https://api.snyk.io/v1/org/{orgId}/integrations/{integrationId}' \
  --header 'Content-Type: application/json; charset=utf-8' \
  --data '{
    "type": "github",
    "broker": {
      "enabled": true
    }
  }'
{
  "id": "9a3e5d90-b782-468a-a042-9a2073736f0b",
  "brokerToken": "4a18d42f-0706-4ad0-b127-24078731fbed"
}

Update

put

Required permissions

  • View Organization

  • View Integrations

  • Edit Integrations

Path parameters
orgIdstringrequired

The organization ID. The API_KEY must have admin access to this organization.

Example: 4a18d42f-0706-4ad0-b127-24078731fbed
integrationIdstringrequired

The unique identifier for the configured integration. This can be found on the Integration page in the Settings area for all integrations that have been configured.

Example: 9a3e5d90-b782-468a-a042-9a2073736f0b
Body
all ofoptional

Responses
curl -L \
  --request PUT \
  --url 'https://api.snyk.io/v1/org/{orgId}/integrations/{integrationId}/settings' \
  --header 'Content-Type: application/json; charset=utf-8' \
  --data '{
    "autoDepUpgradeLimit": 2,
    "autoDepUpgradeIgnoredDependencies": [],
    "autoDepUpgradeEnabled": false,
    "autoDepUpgradeMinAge": 21,
    "pullRequestTestEnabled": true,
    "pullRequestFailOnAnyVulns": false,
    "pullRequestFailOnlyForHighSeverity": true,
    "pullRequestAssignment": "{\"enabled\":true,\"type\":\"manual\",\"assignees\":[\"username\"]}",
    "autoRemediationPrs": {
      "backlogPrsEnabled": false,
      "backlogPrStrategy": "vuln",
      "freshPrsEnabled": true,
      "usePatchRemediation": false
    },
    "manualRemediationPrs": {
      "useManualPatchRemediation": false
    },
    "dockerfileSCMEnabled": true
  }'
{
  "autoDepUpgradeLimit": 2,
  "autoDepUpgradeIgnoredDependencies": [],
  "autoDepUpgradeEnabled": false,
  "autoDepUpgradeMinAge": 21,
  "pullRequestTestEnabled": true,
  "pullRequestFailOnAnyVulns": false,
  "pullRequestFailOnlyForHighSeverity": true,
  "pullRequestAssignment": "{\"enabled\":true,\"type\":\"manual\",\"assignees\":[\"username\"]}",
  "autoRemediationPrs": {
    "backlogPrsEnabled": false,
    "backlogPrStrategy": "vuln",
    "freshPrsEnabled": true,
    "usePatchRemediation": false
  },
  "manualRemediationPrs": {
    "useManualPatchRemediation": false
  },
  "dockerfileSCMEnabled": true
}

Retrieve

get

Required permissions

  • View Organization

  • View Integrations

Path parameters
orgIdstringrequired

The organization ID. The API_KEY must have admin access to this organization.

Example: 4a18d42f-0706-4ad0-b127-24078731fbed
integrationIdstringrequired

The unique identifier for the configured integration. This can be found on the Integration page in the Settings area for all integrations that have been configured.

Example: 9a3e5d90-b782-468a-a042-9a2073736f0b
Header parameters
Content-Typestring · enumrequired
Example: application/json; charset=utf-8
Options: application/json; charset=utf-8
Responses
curl -L \
  --url 'https://api.snyk.io/v1/org/{orgId}/integrations/{integrationId}/settings' \
  --header 'Content-Type: application/json; charset=utf-8'
{
  "autoDepUpgradeLimit": 1,
  "autoDepUpgradeIgnoredDependencies": [
    "text"
  ],
  "autoDepUpgradeEnabled": true,
  "autoDepUpgradeMinAge": 1,
  "pullRequestFailOnAnyVulns": true,
  "pullRequestFailOnlyForHighSeverity": true,
  "pullRequestTestEnabled": true,
  "pullRequestAssignment": "text",
  "autoRemediationPrs": {
    "backlogPrsEnabled": true,
    "backlogPrStrategy": null,
    "freshPrsEnabled": true,
    "usePatchRemediation": true
  },
  "manualRemediationPrs": {
    "usePatchRemediation": true
  },
  "dockerfileSCMEnabled": true
}

Clone an integration (with settings and credentials)

post

Clone an integration, including all of its settings and credentials from one organization to another organization in the same group. This API supports both brokered and non-brokered integrations.

Use this API for when you want to share a Broker token between several Snyk organizations (integrations).

Required permissions

  • View Organization

  • View Integrations

  • Edit Integrations

Path parameters
orgIdstringrequired

Source organization public ID to clone integration settings from. The API_KEY must have access to this organization.

Example: 4a18d42f-0706-4ad0-b127-24078731fbed
integrationIdstringrequired

Source integration public ID to clone.

Example: 4a18d42f-0706-4ad0-b127-24078731fbed
Body
all ofoptional

Responses
curl -L \
  --request POST \
  --url 'https://api.snyk.io/v1/org/{orgId}/integrations/{integrationId}/clone' \
  --header 'Content-Type: application/json' \
  --data '{
    "destinationOrgPublicId": "9a3e5d90-b782-468a-a042-9a2073736f0b1"
  }'
{
  "newIntegrationId": "9a3e5d90-b782-468a-a042-9a2073736f0b"
}

Delete credentials

delete

Required permissions

  • View Organization

  • View Integrations

  • Edit Integrations

Removes any credentials set for this integration. If this is a brokered connection the operation will have no effect.

Path parameters
orgIdstringrequired

The organization ID. The API_KEY must have access to this organization.

Example: 4a18d42f-0706-4ad0-b127-24078731fbed
integrationIdstringrequired

The integration ID.

Example: 4a18d42f-0706-4ad0-b127-24078731fbed
Header parameters
Content-Typestring · enumrequired
Example: application/json
Options: application/json
Responses
curl -L \
  --request DELETE \
  --url 'https://api.snyk.io/v1/org/{orgId}/integrations/{integrationId}/authentication' \
  --header 'Content-Type: application/json'

No body

Switch between broker tokens

post

Switch the existing broker token with the provisioned token for this integration and any other in the same group. Only perform this action when you have a Broker client running with the provisioned token. This action will fail if there is no token provisioned for this integration or any integration in the same group.

Required permissions

  • View Organization

  • View Integrations

  • Edit Integrations

Path parameters
orgIdstringrequired

The API_KEY must have access to this organization.

Example: 4a18d42f-0706-4ad0-b127-24078731fbed
integrationIdstringrequired
Example: 4a18d42f-0706-4ad0-b127-24078731fbed
Header parameters
Content-Typestring · enumrequired
Example: application/json
Options: application/json
Responses
curl -L \
  --request POST \
  --url 'https://api.snyk.io/v1/org/{orgId}/integrations/{integrationId}/authentication/switch-token' \
  --header 'Content-Type: application/json'

No body

Provision new broker token

post

Issue a new and unique provisional broker token for the brokered integration.

Used for zero down-time token rotation with the Snyk Broker. Once provisioned, the token can be used to initialize a new broker client before using the switch API to update the token in use by the integration.

The new provisional token will fail to be created if the integration, or any other integration in the same group, already has one provisioned.

Required permissions

  • View Organization

  • View Integrations

  • Edit Integrations

Path parameters
orgIdstringrequired

The API_KEY must have access to this organization.

Example: 4a18d42f-0706-4ad0-b127-24078731fbed
integrationIdstringrequired
Example: 4a18d42f-0706-4ad0-b127-24078731fbed
Header parameters
Content-Typestring · enumrequired
Example: application/json
Options: application/json
Responses
curl -L \
  --request POST \
  --url 'https://api.snyk.io/v1/org/{orgId}/integrations/{integrationId}/authentication/provision-token' \
  --header 'Content-Type: application/json'
{
  "id": "9a3e5d90-b782-468a-a042-9a2073736f0b",
  "provisionalBrokerToken": "4a18d42f-0706-4ad0-b127-24078731fbed"
}

Last updated

Was this helpful?

Revision created

Add comment to emphasize required filters hidden in GitBook collapsed field