---
title: "GCP Cloud Storage | WebhookRelay"
meta:
  "og:description": "Receive GCS object notifications as webhooks and upload webhook data to Google Cloud Storage using Webhook Relay service connections."
  "og:title": "GCP Cloud Storage"
  description: "Receive GCS object notifications as webhooks and upload webhook data to Google Cloud Storage using Webhook Relay service connections."
---

![Stripes](https://webhookrelay.com/docs/service-connections/gcp_gcs/images/stripes.svg)

Documentation

**Fundamentals**

# **GCP Cloud Storage**

Receive GCS object notifications as webhooks and upload webhook data to Google Cloud Storage using Webhook Relay service connections.

Connect Webhook Relay to **Google Cloud Storage (GCS)** to store incoming webhook data as GCS objects (output).

## [Prerequisites](#prerequisites)

- A [GCP service connection](https://webhookrelay.com/docs/service-connections/gcp_gcs/docs/service-connections) with a service account that has Cloud Storage permissions
- A GCS bucket in your GCP project

### [GCP Roles](#gcp-roles)

**For GCS Output (upload objects):**

- `roles/storage.objectCreator`

## [GCS Output — Upload Webhook Data to Cloud Storage](#gcs-output-upload-webhook-data-to-cloud-storage)

GCS outputs store incoming webhook data as objects in your GCS bucket. Each webhook is saved as a separate file.

![GCP GCS output](https://webhookrelay.com/docs/service-connections/gcp_gcs/images/docs/sc/add_gcp_gcs.png)

### [Configuration](#configuration)

| Field | Required | Description |
| --- | :---: | --- |
| `bucket_name` | Yes | GCS bucket name |
| `prefix` | No | Object name prefix (e.g. `webhooks/`) |
| `file_format` | No | Storage format: `json` (default), `body_only`, `har` |

### [Object Path](#object-path)

Objects are stored with a date-based path:

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

For example: `webhooks/2026/02/24/<WEBHOOK UUID>.json`

![Browse your GCP GCS bucket](https://webhookrelay.com/docs/service-connections/gcp_gcs/images/docs/sc/sc_gcs_buckets.png)

## [Example: Bridge AWS SNS to GCS](#example-bridge-aws-sns-to-gcs)

Archive [AWS SNS](https://webhookrelay.com/docs/service-connections/gcp_gcs/docs/service-connections/aws_sns) notifications as objects in a GCS bucket. Useful when your storage and analytics are on GCP but events originate in AWS:

1. Create an [AWS service connection](https://webhookrelay.com/docs/service-connections/gcp_gcs/docs/service-connections) with SNS subscribe permissions
2. Create a [GCP service connection](https://webhookrelay.com/docs/service-connections/gcp_gcs/docs/service-connections) with GCS write permissions
3. Create a bucket in Webhook Relay
4. Add an **AWS SNS input** on the bucket
5. Add a **GCS output** on the bucket

Every message published to the SNS topic is stored as an object in your GCS bucket.

### [Transform Before Storing](#transform-before-storing)

Use a [Function](https://webhookrelay.com/docs/service-connections/gcp_gcs/docs/webhooks/functions) to extract or reshape the data before writing to GCS:

```
const snsMessage = JSON.parse(r.body)

// Store just the message content with metadata
const archived = {
    source: "aws-sns",
    topic: snsMessage.TopicArn,
    message: JSON.parse(snsMessage.Message),
    timestamp: snsMessage.Timestamp
}

r.setBody(JSON.stringify(archived))
```

See the [JSON encoding](https://webhookrelay.com/docs/service-connections/gcp_gcs/docs/webhooks/functions/manipulating-json) guide for more transformation examples.

Did this page help you?