---
title: "How to Archive Webhooks to Google Cloud Storage (GCS) | WebhookRelay"
meta:
  "og:description": "Store every incoming webhook in Google Cloud Storage with Webhook Relay Service Connections — no code. Keep an auditable archive of payloads for compliance and replay."
  "og:title": "How to Archive Webhooks to Google Cloud Storage (GCS)"
  description: "Store every incoming webhook in Google Cloud Storage with Webhook Relay Service Connections — no code. Keep an auditable archive of payloads for compliance and replay."
---

![Stripes](https://webhookrelay.com/blog/webhook-to-gcs/images/stripes.svg)

# **How to Archive Webhooks to Google Cloud Storage (GCS)**

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

![How to Archive Webhooks to Google Cloud Storage (GCS)](https://webhookrelay.com/blog/webhook-to-gcs/images/blog/heroes/route.jpg)

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](https://cloud.google.com/storage) gives you that: an auditable, replayable history of every payload, ready to load into BigQuery. Webhook Relay [Service Connections](https://webhookrelay.com/blog/webhook-to-gcs/docs/service-connections/) write webhooks to GCS for you, with no code.

## [How it works](#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](#_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](https://webhookrelay.com/blog/webhook-to-gcs/docs/service-connections/gcp_gcs/) for the exact steps.

## [2. Attach a GCS output](#_2-attach-a-gcs-output)

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

- **Bucket name** (required).
- **Prefix** (optional) — e.g. `stripe/`.
- **Format** — `json` (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](#_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](#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](#going-further)

- Forward to your app **and** archive at once with [multiple destinations](https://webhookrelay.com/blog/webhook-to-gcs/features/webhook-multiple-destinations/).
- [Transform](https://webhookrelay.com/blog/webhook-to-gcs/features/transform-webhooks/) or [filter](https://webhookrelay.com/blog/webhook-to-gcs/features/forwarding-rules/) before storing.
- Stream straight into a warehouse with [webhooks to BigQuery](https://webhookrelay.com/blog/webhook-to-gcs/blog/webhook-to-bigquery/), or use [S3](https://webhookrelay.com/blog/webhook-to-gcs/blog/webhook-to-s3/) on AWS.

[Inspect a webhook first](https://webhookrelay.com/blog/webhook-to-gcs/webhook-bin/) or [create a free account](https://my.webhookrelay.com/register) to set up the GCS archive.