---
title: "Change a forwarding rule's API secret"
method: PATCH
path: "/v1/events/forwarding-rules/{ruleId}"
tags: ["Conversions"]
---

# Change a forwarding rule's API secret

`PATCH /v1/events/forwarding-rules/{ruleId}`

## Request

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

Replaces the `apiSecret` of a rule whose destination needs one, such as a Google Analytics data stream's Measurement Protocol API secret. Before saving, Zernio sends one hit to Google's validation server; Google does not confirm the secret itself, so check GA4 Realtime after the next events.

## Path parameters

- `ruleId` string, required

## Request body

- object
  - `apiSecret` string, required

## Response `200`

Secret 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

## Changes

- **2026-11-12** `bdd7fab40abe`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/zernio/apis/zernio-api/changes/v1/events/forwarding-rules/:ruleId/patch.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)
