Code Storage provides a webhook system that allows you to receive real-time notifications about Git events across your storage layer. This enables you to integrate Code Storage deeply within your product, CI/CD pipelines, monitoring systems, and more.Documentation Index
Fetch the complete documentation index at: https://code.storage/docs/llms.txt
Use this file to discover all available pages before exploring further.
How webhooks work
Webhooks are HTTP POST requests sent to your specified endpoint whenever certain events occur in your repositories. When you create a webhook subscription, Code Storage will:- Monitor Events: Watch for the events you’ve subscribed to (e.g.,
pushorrepo.sync.*events) - Generate Payloads: Create JSON payloads containing event details
- Sign Requests: Add cryptographic signatures for security verification
- Deliver Webhooks: Send HTTP POST requests to your endpoint with automatic retries
Webhook headers
Every webhook request includes the following headers:Content-Type: application/jsonUser-Agent: Pierre-Webhook/1.0X-Pierre-Event: <event_type>(e.g.,push,repo.sync.started,repo.sync.succeeded,repo.sync.failed)X-Pierre-Signature: t=1642678200,sha256=abc123...(security signature)
Event types
push
Triggered when commits are pushed to a repository.
repo.sync.started
Triggered when a repository sync run begins, before the upstream fetch executes. Useful for
tracking sync progress or updating status indicators in your UI.
repo.sync.succeeded
Triggered when a sync run completes successfully.
repo.sync.failed
Triggered when a sync run fails, including mirror activity failures (after retries are exhausted)
and infrastructure-level failures.
Sync event fields
| Field | Description |
|---|---|
run_count | For started, the number of previously completed runs. For succeeded/failed, includes the run that just finished. |
is_first_sync | true if the repository had never successfully synced before this run began. Useful for detecting initial sync completion without comparing run counts. |
error | Present only on failed events. Possible values: "authentication failed", "failed to clone repository", "failed to push to storage", "repository configuration error", "upstream repository unreachable", "internal error", "session unavailable", "sync failed". |
Cancellations triggered internally (e.g., when a repository is detached from its upstream) do not
produce a
repo.sync.failed event.Securing webhooks
To ensure the webhooks you receive are legitimate and from Code Storage, you must verify the HMAC signature included with each webhook delivery.HMAC Signature Verification
Each webhook includes anX-Pierre-Signature header with the format:
Webhook SDK methods
The SDK provides helper methods to help you validate webhook events quickly.Advanced SDK usage
Custom Validation Options:Common verification errors
When using the SDK, these errors are automatically detected and returned in theresult.error
field:
- Missing signature components: “Invalid signature header format”
- Timestamp too old: “Webhook timestamp too old (X seconds)”
- Future timestamp: “Webhook timestamp is in the future”
- Signature mismatch: “Invalid signature”
- Invalid JSON: “Invalid JSON payload” (when using
validateWebhook) - Missing headers: “Missing or invalid X-Pierre-Signature header”