---
title: "Rotate an organization webhook's signing secret"
description: "A new signing secret, returned once. `POST /api/v1/organizations/{id}/webhooks/{webhook_id}/rotate-secret`"
url: https://www.unitpost.com/docs/platform/post-organizations-id-webhooks-webhook-id-rotate-secret
section: "Platform API reference"
updated: 2026-11-17
---
# Rotate an organization webhook's signing secret

`POST /api/v1/organizations/{id}/webhooks/{webhook_id}/rotate-secret`

A new signing secret, returned once. For 24 hours (until `previous_secret_expires_at`) every delivery is signed with the new and the old secret, so switch your receiver inside that window. Takes an organization key (`ok_live_…`) with `organizations:write`.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The organization's id (`org_…`), from `GET /whoami` or Organization → API. |
| `webhook_id` | path | string | yes | The organization webhook endpoint's id (`wh_…`). |

## Response fields (200)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `previous_secret_expires_at` | string | yes | Until this time deliveries are signed with the new AND the old secret, so switch your receiver to the new one before then. |

## Responses

| Status | Description |
| --- | --- |
| 200 | The endpoint with its new secret. |
| 401 | Missing or invalid organization key (a workspace key is refused). |
| 403 | API access not approved for the organization, the key lacks the capability, or no User-Agent. |
| 404 | Not this key's organization, or not one of its webhook endpoints (a workspace's endpoint is a 404 here). |
| 409 | Another rotation of this secret finished first. Rotate again. |
| 429 | The organization's rate limit. |

## Example request

```bash
curl -X POST 'https://www.unitpost.com/api/v1/organizations/org_123/webhooks/wh_123/rotate-secret' \
  -H 'Authorization: Bearer YOUR_ORG_KEY' \
  -H 'User-Agent: my-app/1.0'
```

## Example response (200)

```json
{
  "object": "webhook",
  "id": "id_123",
  "name": "Example",
  "url": "https://example.com",
  "events": [
    "email.sent"
  ],
  "status": "enabled",
  "include_text": false,
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z",
  "backlog": {
    "queued": 0,
    "failed": 0
  },
  "signing_secret": "string",
  "previous_secret_expires_at": "2026-01-01T00:00:00.000Z"
}
```

## Links

- HTML reference (with Node.js, Python, Ruby, PHP, Laravel, Go, Java, Rust, .NET and CLI examples): https://www.unitpost.com/docs/platform/post-organizations-id-webhooks-webhook-id-rotate-secret
- OpenAPI 3.1 (full schemas): https://www.unitpost.com/api/v1/openapi.json
