How to Archive Webhooks to Google Cloud Storage (GCS)

Store every incoming webhook in Google Cloud Storage with Service Connections — no code. Keep an auditable payload archive for compliance and replay.

How to Archive Webhooks to Google Cloud Storage (GCS)

When a webhook drives something important — a payment, an order, a deploy — you eventually want a record of exactly what the provider sent, not just whether your handler succeeded. An archive in Google Cloud Storage gives you that: an auditable, replayable history of every payload, ready to load into BigQuery. Webhook Relay Service Connections write webhooks to GCS for you, with no code.

How it works

Webhook Relay has service connections (your cloud credentials) and outputs (where to send data). Attach a GCS output to a bucket, and every webhook that arrives is stored as an object:

Provider --> Webhook Relay bucket --> GCS output --> gs://your-bucket/...

This runs alongside your normal delivery — you can forward the webhook to your app and archive it to GCS at the same time.

1. Create a GCP service connection

Add a service connection for GCP using a service account whose key can write objects to your bucket (the roles/storage.objectCreator role is enough). Webhook Relay encrypts secrets at rest (AES-256-GCM) and never returns them in full. See the GCS service connection docs for the exact steps.

2. Attach a GCS output

Add a GCS output to the bucket that receives your webhooks:

  • Bucket name (required).
  • Prefix (optional) — e.g. stripe/.
  • Formatjson (full webhook with headers, the default), body_only (raw body), or har.

Objects are written under a dated key so they're easy to browse and lifecycle:

{prefix}/{year}/{month}/{day}/{log_id}.json

3. Point your provider at the bucket URL

Use the bucket's public Webhook Relay endpoint as the webhook URL in your provider, then test:

curl -X POST https://your-webhook-relay-endpoint \
  -H 'Content-Type: application/json' \
  -d '{"event":"invoice.paid","id":"in_123"}'

An object appears in GCS within seconds.

Why archive webhooks

  • Audit & compliance. Keep an immutable record of what each provider sent, with retention via object lifecycle rules.
  • Debug after the fact. Inspect the exact payload that caused a problem, even days later.
  • Replay. Re-feed stored payloads into a new service or a rebuilt handler.
  • Load into BigQuery. Point an external table or a load job at the archive for analytics.

Going further

Inspect a webhook first or create a free account to set up the GCS archive.

Frequently asked questions

How do I save webhooks to a Google Cloud Storage bucket?

Create a Webhook Relay GCP service connection with a service account that can write objects, attach a GCS output (bucket name) to a bucket, then point your provider at the bucket's webhook URL. Every incoming webhook is written to GCS as an object — no code required.

What format are the webhooks stored in?

You choose: 'json' stores the full webhook (method, headers, query and body), 'body_only' stores just the raw request body, and 'har' stores HTTP Archive format. Objects are written under a dated path like prefix/year/month/day/log_id.json.

Why archive webhooks to Google Cloud Storage?

An immutable archive lets you audit exactly what a provider sent, debug issues after the fact, replay events into a new system, and meet compliance/retention requirements — independent of whether your live handler succeeded. From GCS you can also load straight into BigQuery.