---
title: "Replaces a webhook endpoint's signing secret and answers the new one once; the old one signs nothing more. Needs the read scopes of its events and of every event it still owes."
---

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

Path: Sherpo merchant API › organization

`POST /v1/stores/{store}/webhooks/{webhook}/secret/roll`

## Authentication

- `bearer`, http, header `Authorization`, scopes: `organization:write`

## Path parameters

- `store` (`rollWebhookSecret.path.store`; string, required) — The store's id.
- `webhook` (`rollWebhookSecret.path.webhook`; string, required)
  - minLength 1

## Request body

_Optional._

## Example request

```json
{}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.sherpo.io/merchant/v1/stores/<store>/webhooks/<webhook>/secret/roll' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{}'
```

### TypeScript

```typescript
const url = 'https://api.sherpo.io/merchant/v1/stores/<store>/webhooks/<webhook>/secret/roll';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.sherpo.io/merchant/v1/stores/<store>/webhooks/<webhook>/secret/roll"

payload = {}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Replaces a webhook endpoint's signing secret and answers the new one once; the old one signs nothing more. Needs the read scopes of its events and of every event it still owes.

#### Example

```json
{
  "webhook": {
    "id": "string",
    "url": "string",
    "description": "string",
    "events": [
      "string"
    ],
    "enabled": true,
    "connection_ended_at": "string",
    "created_at": "string",
    "updated_at": "string"
  },
  "secret": "string"
}
```

- `webhook` (`rollWebhookSecret.response.200.webhook`; object, required)
  - `id` (`rollWebhookSecret.response.200.webhook.id`; string, required)
  - `url` (`rollWebhookSecret.response.200.webhook.url`; string, required)
  - `description` (`rollWebhookSecret.response.200.webhook.description`; any of, required)
    - any of: `string`, `null`
  - `events` (`rollWebhookSecret.response.200.webhook.events`; array<string>, required)
  - `enabled` (`rollWebhookSecret.response.200.webhook.enabled`; boolean, required)
  - `connection_ended_at` (`rollWebhookSecret.response.200.webhook.connection_ended_at`; any of, required) — When it was turned off because the connection that set it up ended.
    - any of: `string`, `null`
  - `created_at` (`rollWebhookSecret.response.200.webhook.created_at`; string, required)
  - `updated_at` (`rollWebhookSecret.response.200.webhook.updated_at`; string, required)
- `secret` (`rollWebhookSecret.response.200.secret`; string, required)

### default

A problem; see https://api.sherpo.io/merchant/docs/errors.

#### Example

```json
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "context": {},
  "reached_core": true,
  "core_answer": "string"
}
```

- `type` (`rollWebhookSecret.response.default.type`; string, required)
  - format `uri`
- `title` (`rollWebhookSecret.response.default.title`; string, required)
- `status` (`rollWebhookSecret.response.default.status`; integer, required)
- `detail` (`rollWebhookSecret.response.default.detail`; string, required)
- `code` (`rollWebhookSecret.response.default.code`; string, optional)
- `context` (`rollWebhookSecret.response.default.context`; object, optional)
- `reached_core` (`rollWebhookSecret.response.default.reached_core`; boolean, optional)
- `core_answer` (`rollWebhookSecret.response.default.core_answer`; string, optional)


Source: https://docs.sherpo.io/merchant-api/reference/roll-webhook-secret/index.md
