Replace a webhook's signing secret

Give a webhook a new signing secret after a leak, a lost answer or as routine, without deleting it, and keep its deliveries arriving while the receiver changes over.

A webhook's secret signs each delivery, and Marfa shows it only in the answer that makes it. Replacing it keeps the webhook: its url, events, type_filter, pending deliveries and delivery history stay as they were. Only the key or app that registered the webhook can replace its secret. Receive webhooks shows how a receiver checks the signature.

Replace the secret

Replace a webhook's secret answers the webhook with its new secret, the only time it is shown:

marfa webhooks replace-secret <webhook-id>

Marfa generates a secret of 64 hexadecimal characters. An agent at /mcp/admin calls marfa_manage_webhook with action set to replace_secret and the webhook's id.

If you lose the answer, replace the secret again. Changing the secret raises the webhook's version, and the audit log records it as webhook.secret.replace, without the secret.

Keep deliveries arriving

Marfa signs with one secret at a time. Every request it sends after the replacement carries the new secret's signature, retries and redeliveries of older events included. A request already on its way keeps the signature it was sent with.

A receiver that still holds only the old secret refuses those requests, and a refusal such as 401 ends a delivery as failed. To lose none, change over in this order:

Make the receiver accept both secrets

Choose the new secret yourself, of at least 32 characters, and have the receiver accept a signature under either one.

Replace the secret with the one you chose

marfa webhooks replace-secret <webhook-id> --secret <new-secret>

A shorter secret is refused 400 validation_error. The CLI doesn't print back a secret you gave.

Drop the old secret

Once deliveries verify under the new secret, remove the old one from the receiver.

After a leak, replace the secret first and repair afterward: redeliver each delivery that failed meanwhile.

The rules are in the events chapter of the contract.

On this page