> ## Documentation Index
> Fetch the complete documentation index at: https://docs.yativo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Regenerate Webhook Secret

> Issue a new signing secret for an existing webhook endpoint

Regenerate the HMAC signing secret for a webhook. Use this after a secret is suspected to be compromised, or as part of a routine secret rotation policy.

```
POST https://api.yativo.com/api/v1/business/webhook/{webhook_id}/regenerate-secret
```

<Note>
  Requires `Idempotency-Key` header. After regeneration, update `YATIVO_WEBHOOK_SECRET` in your environment immediately — the old secret stops working right away.
</Note>

## Path parameters

<ParamField path="webhook_id" type="string" required>
  The ID of the webhook whose secret you want to regenerate.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST 'https://api.yativo.com/api/v1/business/webhook/wh-01abc123/regenerate-secret' \
    -H 'X-Api-Key: YOUR_API_KEY' \
    -H 'X-Api-Secret: YOUR_API_SECRET' \
    -H 'Idempotency-Key: regen-secret-001'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    `https://api.yativo.com/api/v1/business/webhook/${webhookId}/regenerate-secret`,
    {
      method: 'POST',
      headers: {
        'X-Api-Key': process.env.YATIVO_API_KEY,
        'X-Api-Secret': process.env.YATIVO_API_SECRET,
        'Idempotency-Key': `regen-${Date.now()}`,
      },
    }
  );
  const data = await response.json();
  // Update your environment with data.data.secret immediately
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "status": "success",
    "status_code": 200,
    "message": "Webhook secret regenerated successfully",
    "data": {
      "webhook_id": "wh-01abc123",
      "secret": "whsec_newb2c3d4e5f6...",
      "updated_at": "2026-06-01T10:00:00.000000Z"
    }
  }
  ```
</ResponseExample>

<Warning>
  The new secret is shown only once — store it securely immediately. The old secret is invalidated as soon as the new one is issued.
</Warning>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.