General-purpose webhook URLs
Notification pings for events that occur on an application or its environments can be sent to a general-purpose webhook URL. Notifications pings to a webhook URL can be useful for:
- Pinging a testing service whenever a particular environment is updated, such as page speed tests or integration testing to ensure that a checkout process is still working as expected.
- Logging the deployment against a datastore (e.g. a Google spreadsheet).
Request body
The service receiving the Notifications ping must be able to accept an HTTP POST
. The ping is a JSON-formatted request body with the following structure:
{
"domain": "PRIMARY_DOMAIN",
"repo": "GITHUB_ORGANISATION/GITHUB_REPOSITORY",
"branch": "REPOSITORY_BRANCH",
"sha": "COMMIT_SHA",
"status":"success|failed",
"commit_author_username": "COMMIT_AUTHOR",
"commit_message": "COMMIT_MESSAGE"
}
The JSON-formatted request body populated with example data:
{
"domain": "https://example.go-vip.net",
"repo": "wpcomvip/example",
"branch": "develop",
"sha": "bcb2937404b854e8f265670116d2ba69daee23a0",
"status": "success",
"commit_author_username": "janedoe",
"commit_message": "Update README.md"
}
Webhook request header and versions
The webhook request will be sent with an x-wpvip-webhook
HTTP request header. The x-wpvip-webhook
header value is a string indicating the version number of the webhook payload.
The current webhook version is v0
(e.g. x-wpvip-webhook: "v0"
). When changes are made to the payload structure the version number will be incrementally updated.
Last updated: August 03, 2023