Webhooks

Receive a Git provider push webhook

Changed on

Public endpoint that receives a push event from a Git provider (typically GitHub). The webhook token in the URL path (:webhook) authenticates the call; no Authorization header is sent.

Accepts application/json only. The optional branch query parameter filters which branch triggers a deploy — if present and body.ref does not match refs/heads/<branch>, the request is accepted with 202 but no deploy is queued. Pushes of tags (or any ref outside refs/heads/) and branch deletions are also answered with 202 and never deployed, before the rate limit, so they cannot hold back a deploy that arrives right after them. The optional restart query parameter (?restart=false) skips the post-deploy application restart.

Responses are text/plain and always say whether a deploy was queued; only the 429 of the 15-second deploy limit is the JSON error body. A 200 is sent only after the deploy job is stored: on a temporary failure the answer is 503 and the push must be redelivered. Rate limited to 1 deploy per 15 seconds per webhook token, and to 10 deliveries over 1 MB (or without Content-Length) a minute per webhook token whatever their outcome (a text 429 RATE_LIMITED, before the payload is read).

post/v2/git/webhook/{webhook}

Request

Path parameters

webhookstring required

Per-application Git webhook token (64 hex chars).

Query parameters

branchstring

Lowercase branch name (≤256 chars). When provided, only matching pushes trigger a deploy.

restart'true' | 'false'

Pass false to skip the post-deploy application restart.

Request body

refstring required

refs/heads/<branch> for push events. Any other ref (a tag) is not deployed.

afterstring

Commit SHA after the push; all zeros when it deletes the branch.

deletedboolean

true when the push deletes the ref; nothing is deployed.

Response

The deploy was queued. It is only answered after the job is stored.

Changes

    • warning

      added the new SNAPSHOTS_UNAVAILABLE enum value to the //// response property for the response status

    • warning

      added the new SNAPSHOTS_UNAVAILABLE enum value to the //// response property for the response status

    • warning

      added the new WRITE_FAILED enum value to the //// response property for the response status

    • warning

      added the new WRITE_FAILED enum value to the //// response property for the response status

    • warning

      added the new WRONG_HOST enum value to the //// response property for the response status

    • warning

      added the new WRONG_HOST enum value to the //// response property for the response status