# Rotate a webhook's secret

> POST /webhooks/{webhookId}/rotate-secret

Source: https://mockflow.com/developers/reference/webhooks/rotate-webhook-secret

**POST** `https://api.mockflow.com/v1/webhooks/{webhookId}/rotate-secret`  
Scopes: `boards:read`

**curl**

```bash
curl https://api.mockflow.com/v1/webhooks/whk_9fa2/rotate-secret \
  -X POST \
  -H "Authorization: Bearer $MOCKFLOW_API_KEY"
```

**JavaScript**

```javascript
const response = await fetch("https://api.mockflow.com/v1/webhooks/whk_9fa2/rotate-secret", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MOCKFLOW_API_KEY}`
  }
});

const data = await response.json();
```

**Python**

```python
import os, requests

response = requests.post(
    "https://api.mockflow.com/v1/webhooks/whk_9fa2/rotate-secret",
    headers={"Authorization": f"Bearer {os.environ['MOCKFLOW_API_KEY']}"},
)

response.raise_for_status()
data = response.json()
```

**200**

```json
{
  "id": "string",
  "secret": "string"
}
```

**429**

```json
{
  "error": {
    "code": "rate_limited",
    "message": "Too many requests.",
    "docsUrl": "https://mockflow.com/developers/concepts/errors#rate_limited"
  },
  "requestId": "req_45d49816999bac40"
}
```

A new signing secret, effective for the next delivery. Update your receiver first.

### Authorization

- `Authorization` (string, required): `Bearer <key>`. The key needs `boards:read` scope. Create and manage keys in the [developer console](/developers/console/), or use an [OAuth app](/developers/concepts/oauth-apps) to act for other people; what each scope unlocks is on the [scopes page](/developers/concepts/scopes).

### Path parameters

- `webhookId` (string, required)

### Response

- `id` (string)
- `secret` (string)

### Errors

- 429 `rate_limited`: Too many requests.
