Webhooks (v1)

Create a webhook

Snyk sends a ping event to the newly configured webhook so you can check you're able to receive the transports.### Required permissions

  • View Organization

  • View Outbound Webhooks

  • Create Outbound Webhooks

post

/org/{orgId}/webhooks

Path parameters
orgIdstringrequired

The organization ID to list projects for. The API_KEY must have access to this organization.

Example: 4a18d42f-0706-4ad0-b127-24078731fbed
Body
urlstring

Webhooks can only be configured for URLs using the https protocol. http is not allowed.

secretstring

This is a password you create, that Snyk uses to sign our transports to you, so you be sure the notification is authentic. Your secret should: Be a random string with high entropy; Not be used for anything else; Only known to Snyk and your webhook transport consuming code;

any
Example: {"url":"https://my.app.com/webhook-handler/snyk123","secret":"a8be22bb7bed43a3ac24de3580093560"}
Responses
curl -L \
  --request POST \
  --url 'https://api.snyk.io/v1/org/{orgId}/webhooks' \
  --header 'Content-Type: application/json; charset=utf-8' \
  --data '{"url":"https://my.app.com/webhook-handler/snyk123","secret":"a8be22bb7bed43a3ac24de3580093560"}'
{
  "id": "d3cf26b3-2d77-497b-bce2-23b33cc15362",
  "url": "https://my.app.com/webhook-handler/snyk123"
}

List webhooks

Snyk sends a ping event to the newly configured webhook so you can check you're able to receive the transports

Required permissions

  • View Organization

  • View Outbound Webhooks

get

/org/{orgId}/webhooks

Path parameters
orgIdstringrequired

The organization ID to list projects for. The API_KEY must have 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}/webhooks' \
  --header 'Content-Type: application/json; charset=utf-8'
{
  "total": 1,
  "results": [
    {
      "id": "d3cf26b3-2d77-497b-bce2-23b33cc15362",
      "url": "https://my.app.com/webhook-handler/snyk123"
    }
  ]
}

Retrieve a webhook

Required permissions

  • View Organization

  • View Outbound Webhooks

get

/org/{orgId}/webhooks/{webhookId}

Path parameters
orgIdstringrequired

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

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

The webhook ID.

Example: 463c1ee5-31bc-428c-b451-b79a3270db08
Header parameters
Content-Typestring · enumrequired
Example: application/json
Options: application/json
Responses
curl -L \
  --url 'https://api.snyk.io/v1/org/{orgId}/webhooks/{webhookId}' \
  --header 'Content-Type: application/json'
{
  "id": "d3cf26b3-2d77-497b-bce2-23b33cc15362",
  "url": "https://my.app.com/webhook-handler/snyk123"
}

Delete a webhook

Required permissions

  • View Organization

  • View Outbound Webhooks

  • Remove Outbound Webhooks

delete

/org/{orgId}/webhooks/{webhookId}

Path parameters
orgIdstringrequired

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

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

The webhook ID.

Example: 463c1ee5-31bc-428c-b451-b79a3270db08
Header parameters
Content-Typestring · enumrequired
Example: application/json
Options: application/json
Responses
curl -L \
  --request DELETE \
  --url 'https://api.snyk.io/v1/org/{orgId}/webhooks/{webhookId}' \
  --header 'Content-Type: application/json'

No body

Ping a webhook

Required permissions

  • View Organization

  • View Outbound Webhooks

post

/org/{orgId}/webhooks/{webhookId}/ping

Path parameters
orgIdstringrequired

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

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

The webhook ID.

Example: 463c1ee5-31bc-428c-b451-b79a3270db08
Header parameters
Content-Typestring · enumrequired
Example: application/json
Options: application/json
Responses
curl -L \
  --request POST \
  --url 'https://api.snyk.io/v1/org/{orgId}/webhooks/{webhookId}/ping' \
  --header 'Content-Type: application/json'

No body

Last updated

Was this helpful?