Webhooks are delivered with a Content-Type of application/json, with the event payload as JSON in the request body. We also send the following headers:
X-Snyk-Event - the name of the event
X-Snyk-Transport-ID - a GUID to identify this delivery
X-Snyk-Timestamp - an ISO 8601 timestamp for when the event occurred, for example: 2020-09-25T15:27:53Z
X-Hub-Signature - the HMAC hex digest of the request body, used to secure your webhooks and ensure the request did indeed come from Snyk
User-Agent - identifies the origin of the request, for example: Snyk-Webhooks/XXX
After your server is configured to receive payloads, it listens for any payload sent to the endpoint you configured. For security reasons, you should limit requests to those coming from Snyk.
While consuming a webhook event, X-Snyk-Event header must be checked, as an end-point may receive multiple event types as described.
ping
The ping event happens after a new webhook is created, and can also be manually triggered using the ping webhook API. This is useful to test that your webhook receives data from Snyk correctly.
This event is triggered every time an existing project is tested and a new snapshot is created. It is triggered on every test of a project, whether or not there are new issues. This event is not triggered when a new project is created or imported. Currently supported targets/scan types are Open Source and container.
POST/webhook-handler/snyk123HTTP/1.1Host:my.app.comX-Snyk-Event:project_snapshot/v0X-Snyk-Transport-ID:998fe884-18a0-45db-8ae0-e379eea3bc0aX-Snyk-Timestamp:2020-09-25T15:27:53ZX-Hub-Signature:sha256=7d38cdd689735b008b3c702edd92eea23791c5f6User-Agent:Snyk-Webhooks/044aaddContent-Type:application/json{"project":{...},//projectobjectmatchingAPIresponses"org":{...},//organizationobjectmatchingAPIresponses"group":{...},//groupobjectmatchingAPIresponses"newIssues": [], // array of issues object matching API responses"removedIssues": [], // array of issues object matching API responses}