POST each time a push or a
commit updates a repo’s refs. Use it to start CI, index new code, or wake an agent when a branch moves.
Set the endpoint
- One endpoint per account, for every repo. Calling
webhook.set()again replaces the URL. - The URL must be
httpsand reachable from the internet. - Each call returns a new signing secret and replaces the old one. There’s no call to read a secret back, so to
rotate it, call
webhook.set()again and deploy the new secret to your receiver.
The event
Each delivery is a JSONpush event. The SDK’s verify functions return it parsed, with camelCase fields in TypeScript
and snake_case in Python.
A ref that was created has a
before of 40 zeros, and a ref that was deleted has an after of 40 zeros.
Verify deliveries
Each request carries anX-Archil-Signature header:
toleranceSeconds (tolerance_seconds in Python).
verifyWebhook(verify_webhook) returns the parsed event, and throwsWebhookVerificationError, with the reason, if the signature is missing, wrong, or too old.verifySignature(verify_signature) returnstrueorfalseinstead.
disk/webhooks, which also exports SIGNATURE_HEADER and EVENT_ID_HEADER. In Python
they’re in archil.git. Both run anywhere, including edge runtimes.
Delivery
- At least once. If your endpoint doesn’t answer with a 2xx within 10 seconds, the git service retries the delivery
with backoff until it does. The same event can arrive more than once, so de-duplicate on
id. - In order per repo. Events for one repo arrive in the order its refs changed. Events for different repos aren’t ordered relative to each other.
- Durable. Each event is recorded on the repo’s disk as part of the push, so an event isn’t lost if the git service restarts before delivering it.
- Forks send no event for their starting state, only for their own pushes and commits afterward. See Forks.