Webhooks

Webhooks allow you to monitor and respond to events within your Buildkite organization, providing a real time view of activity and allowing you to extend and integrate Buildkite into your systems.

Events

You can subscribe to one or more of the following events:

EventDescription
pingWebhook notification settings have changed
build.scheduledA build has been scheduled
build.runningA build has started running
build.finishedA build has finished
job.scheduledA job has been scheduled
job.startedA job has started
job.finishedA job has finished
job.activatedA job has been activated
agent.connectedAn agent has connected
agent.lostAn agent has been marked as lost
agent.disconnectedAn agent has disconnected
agent.stoppingAn agent is stopping
agent.stoppedAn agent has stopped

HTTP headers

The following HTTP headers are present in every webhook request, which allow you to identify the event that took place, and to verify the authenticity of the request:

X-Buildkite-EventThe type of event

Example: build.scheduled

X-Buildkite-TokenThe token from your webhook configuration settings, used to verify the authenticity of the webhook request

Example: 309c9c842d8565adec5d7469160059f9

HTTP request body

Each event’s data is sent JSON encoded in the request body. See each event’s documentation to see which keys are available in the payload. For example:

{
  "event": "build.started",
  "build": {
    "keys": "vals"
  },
  "sender": {
    "keys": "vals"
  }
}

Example implementations

The following example repositories show how to receive a webhook event and trigger a LIFX powered build light. You can browse their source, fork them, and deploy them to Heroku directly from their GitHub readmes, or simply use them as an example to implement webhooks in your tool of choice.

:node: Node webhook example application github.com/buildkite/lifx-buildkite-build-light-node

:ruby: Ruby webhook example application github.com/buildkite/lifx-buildkite-build-light-ruby

:php: PHP webhook example application github.com/buildkite/lifx-buildkite-build-light-php

:node: Webtask.io webhook example application github.com/buildkite/lifx-buildkite-build-light-webtask

Build panda

Request logs

The last 50 webhook request and responses are saved, so you can debug and inspect your webhook. Each webhook’s request logs are available on the bottom of their settings page.