Skip to content
Connect an agent

Organisations

Receive a GitHub App event. Called by GitHub, not by clients

Called by GitHub.

POST/github/webhook

TL;DR

QuestionAnswer
What does it do?Receive a GitHub App event. Called by GitHub, not by clients.
What does it take?A JSON body of type object.
What does it return?Status 200 with a body of type GithubWebhookAck.
What can go wrong?400 a header is missing; 401 the signature does not match (github.signature_invalid); 413 the body is larger than 1 MiB; 429 too many requests; 500 the delivery could not be applied; GitHub may send it again; 503 the GitHub App is not set up on this server (github.not_configured). Every failure uses the one error envelope.

What it does

Called by GitHub. Checks X-Hub-Signature-256 over the exact bytes first, refuses a delivery seen before, and makes a few row changes for installation, installation_repositories, push and pull_request events. Anything else is acknowledged and ignored.

Header parameters

FieldTypeRequiredDescription
x-hub-signature-256stringnosha256= and the HMAC SHA-256 of the exact body under the webhook secret.
x-github-eventstringyesThe event, such as installation or pull_request.
x-github-deliverystringyesThe delivery's id, the same when GitHub sends it again.

Request body

The body has the type object.

FieldTypeRequiredDescription

Responses

StatusMeaningBody
200Applied, or a duplicate.GithubWebhookAck
202Ignored: nothing this App acts on.GithubWebhookAck
400A header is missing.ErrorResponse
401The signature does not match (github.signature_invalid).ErrorResponse
413The body is larger than 1 MiB.ErrorResponse
429Too many requests.ErrorResponse
500The delivery could not be applied; GitHub may send it again.ErrorResponse
503The GitHub App is not set up on this server (github.not_configured).ErrorResponse

Response body

A 200 answer has the type GithubWebhookAck.

FieldTypeRequiredDescription
outcome"applied" | "duplicate" | "ignored"yesapplied: rows changed. duplicate: this delivery was applied before. ignored: nothing this App acts on.

See also

DocWhy
API referenceEvery endpoint, and the error envelope
SchemasEvery request and response type
Tool referenceThe operations as callable tools