Skip to main content
POST
Create a webhook
  • It receives events for every job you started, from any client: the Dashboard, an MCP client or an API key, except Code editor runs.
  • environments chooses the environments of your Business team whose jobs’ events it gets, any set of them; without it, it gets production’s alone. Naming an environment your team doesn’t have is refused with invalid_request.
  • Events: job.needs_input (a job asks a question; the payload has its questions and the page to answer them), job.input_expiring (three minutes left to answer), job.succeeded and job.failed (a job settled), job.repairing (a repair of a run’s tool is under way, and the run ends by maintenance.deadline_at), job.paused (a build paused; the payload has its question, if it paused on one, and when the pause ends it), job.pause_expiring (an hour left before the pause ends the build) and job.resumed (a paused build is queued or running again). Without events, it receives all eight.
  • No event carries a result. Read the result from the job, through the client that started it.
  • Deliveries are signed with Standard Webhooks, retried for about 14 minutes, and sent only to public HTTPS addresses. A url whose host is, or resolves to, a private, loopback, link-local or other non-public address (localhost included) is refused with invalid_request.
  • Only you can change, test or rotate it; a Business Owner or Admin can also see and delete it. It keeps working if you leave the team.
  • You can hold at most 20 webhooks.
  • Callers: an API key, an MCP OAuth token or a Dashboard session.
  • Permission: jobs:read.
  • Effect: Creates or changes something.
  • Errors: webhook_limit_reached, webhooks_unavailable, and the errors any request can get.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
url
string
required
events
enum<string>[]

an array of at least 1 item(s)

Minimum array length: 1
Available options:
job.needs_input,
job.input_expiring,
job.succeeded,
job.failed,
job.repairing,
job.paused,
job.pause_expiring,
job.resumed
environments
string[]

an array of at most 5 item(s)

Required array length: 1 - 5 elements

a string matching the pattern ^a-z [blocked]?$

Pattern: ^[a-z](?:[a-z0-9-]{0,30}[a-z0-9])?$

Response

The new webhook and its one-time secret

id
string
required

a webhook ID: wh_ and 32 lowercase hex digits

Example:

"wh_0f8e2d1c4b3a49e8a7f6e5d4c3b2a190"

created_by
object
required

The member who made the webhook. Only they can change, test or rotate it, and it carries events for the jobs they started

url
string
required
events
enum<string>[]
required
Available options:
job.needs_input,
job.input_expiring,
job.succeeded,
job.failed,
job.repairing,
job.paused,
job.pause_expiring,
job.resumed
status
enum<string>
required
Available options:
active,
disabled
disabled_reason
enum<string> | null
required

Why a disabled webhook sends nothing: manual (turned off), gone (its receiver answered 410), unreachable (20 failed deliveries in a row) or secret_unreadable (rotate its secret)

Available options:
manual,
gone,
unreachable,
secret_unreadable
created_at
string
required

a string to be decoded into a Date

last_delivery_at
string | null
required

a string to be decoded into a Date

secret
string
required

The Standard Webhooks signing secret (whsec_…), shown only in this response. Verify each delivery's webhook-signature with it.

environments
string[]

The environments of your team whose jobs' events it gets, by key. A webhook made without them, and every webhook made before environments, gets production's alone