A quick reference for Buildkite webhook payloads and how to work with them. For a complete list of events, see the Buildkite Webhooks Documentation.
Sent when testing webhook configuration:
{
"event": "ping",
"organization": {
"id": "123-org-id",
"name": "Example Org"
}
}
Example of a build.finished
event:
{
"event": "build.finished",
"build": {
"id": "01234567-89ab-cdef-0123-456789abcdef",
"url": "https://api.buildkite.com/v2/organizations/example/pipelines/test/builds/123",
"web_url": "https://buildkite.com/example/test/builds/123",
"number": 123,
"state": "passed",
"pipeline": "test",
"organization": "example"
}
}
Filter Pub/Sub subscriptions based on event types:
# Failed builds only
gcloud pubsub subscriptions create failed-builds \
--topic buildkite-events \
--filter="attributes.event_type = 'build.finished' AND data.build.state = 'failed'"