---
title: "Add a forwarding rule"
method: POST
path: "/v1/events/forwarding-rules"
tags: ["Conversions"]
---

# Add a forwarding rule

`POST /v1/events/forwarding-rules`

## Request

- Base URL: `https://zernio.com/api`
- URL: `https://zernio.com/api/v1/events/forwarding-rules`
- Auth: HTTP bearer

Saves where a profile's events go: every event sent to `POST /v1/events` for that profile is then forwarded to this destination.

Pick `destinationId` from `GET /v1/ads/conversions/destinations`. Set `eventNames` to forward only those events, such as only `Purchase`; leave it out to forward every event.

## Request body

- object
  - `profileId` string, required
  - `accountId` string, required: Connected ads account ID that owns the destination.
  - `destinationId` string, required: The platform destination: a pixel, a conversion action, a conversion rule, or a GA4 web stream measurement id (`G-…`).
  - `eventNames` string[]
  - `sources` string[]: Forward only events from these sources, such as only `web` for a tracked website. Leave it out to forward events from every source.
  - `apiSecret` string: Google Analytics streams only: the stream's Measurement Protocol API secret (GA4 Admin › Data streams). Optional when the connection has edit access, since Zernio then creates it. Checked against Google's validation server, stored encrypted, never returned. Change it with `PATCH /v1/events/forwarding-rules/{ruleId}`.

## Response `201`

Rule saved.

- object
  - `forwardingRule` ForwardingRule
    - `id` string: Rule ID, used to delete it.
    - `profileId` string
    - `accountId` string
    - `destinationId` string: Platform destination (pixel, conversion action, rule, ...).
    - `eventNames` string[], nullable: Event names forwarded to this destination; null forwards every event.
    - `sources` string[], nullable: Event sources forwarded to this destination; null forwards events from every source.
    - `apiSecretVerified` boolean: Only when an `apiSecret` was saved by this request. Google Analytics never confirms a Measurement Protocol API secret, so it is `false` there: the first events in GA4 Realtime prove the secret is right.
    - `createdAt` string, date-time

## Other responses

- `400`: Invalid request
- `401`: Missing or invalid API key. `code` is `missing_credentials` when no Authorization header was sent and `invalid_credentials` when the key is unknown, revoked or expired.
- `404`: Resource not found
- `409`: The profile already forwards events to this destination (code `invalid_resource_state`).

## Changes

- **2026-11-12** `bdd7fab40abe`: 2 info
  - added the new optional request property `apiSecret`
  - added the optional property `forwardingRule/apiSecretVerified` to the response with the `201` status
- **2026-11-11** `05cafa483b36`: 1 warning, 1 info
  - added the new `stripe` enum value to the `forwardingRule/sources/items/` response property for the response status `201`
  - added the new `stripe` enum value to the request property `sources/items/`
- **2026-11-11** `34f8dbff5e0d`: 2 info
  - added the new optional request property `sources`
  - added the optional property `forwardingRule/sources` to the response with the `201` status
- **2026-11-10** `362eda0b2547`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/zernio/apis/zernio-api/changes/v1/events/forwarding-rules/post.md)

---

[API](https://skmtc.dev/zernio/apis/zernio-api.md) - [All operations](https://skmtc.dev/zernio/apis/zernio-api/llms.txt) - [OpenAPI document](https://skmtc.dev/zernio/apis/zernio-api/revisions/21ba7421089d?raw)
