---
title: "Updates a webhook endpoint: its URL, events, description or whether it is sent anything. A new URL or added events need the read scopes the events' payloads carry."
---

> 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

`PATCH /v1/stores/{store}/webhooks/{webhook}`

## Authentication

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

## Path parameters

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

## Header parameters

- `Idempotency-Key` (`updateWebhook.header.Idempotency-Key`; string, optional) — Repeats within 24 hours answer the first result; the same key with other arguments is a conflict.
  - minLength 1; maxLength 255; pattern `^[\x21-\x7E]+$`

## Request body

_Optional._

- `url` (`updateWebhook.url`; string, optional) — An `https` URL on a public host; redirects are never followed.
  - minLength 1; maxLength 2048
- `events` (`updateWebhook.events`; array<string>, optional) — The events it is sent.
  - one of `"products.unlocked"`, `"request.received"`, `"request.waitlisted"`, `"request.approved"`, `"request.declined"`, `"request.expired"`, `"request.payment_due"`, `"discounts.unlocked"`, `"refund.processed"`, `"affiliate.earned"`, `"subscription.created"`, `"subscription.renewed"`, `"subscription.reminder"`, `"subscription.plan_changed"`, `"subscription.payment_failed"`, `"subscription.past_due"`, `"subscription.unpaid"`, `"subscription.canceled"`, `"subscription.reactivated"`, `"event.registered"`, `"event.updated"`, `"event.canceled"`, `"event.purchase_canceled"`, `"event.refund_failed"`, `"access.revoked"`, `"order.created"`, `"order.refunded"`, `"review.created"`, `"grant.revoked"`, `"certificate.issued"`, `"license.issued"`, `"license.disabled"`, `"license.enabled"`, `"license.replaced"`, `"license.activated"`, `"license.deactivated"`, `"license.limit_reached"`, `"customer.created"`
- `description` (`updateWebhook.description`; any of, optional)
  - any of: `string`, `null`
- `enabled` (`updateWebhook.enabled`; boolean, optional)

## Example request

```json
{
  "url": "string",
  "events": [
    "products.unlocked"
  ],
  "description": "string",
  "enabled": true
}
```

## Code samples

### cURL

```bash
curl --request PATCH \
  --url 'https://api.sherpo.io/merchant/v1/stores/<store>/webhooks/<webhook>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "string",
  "events": [
    "products.unlocked"
  ],
  "description": "string",
  "enabled": true
}
'
```

### TypeScript

```typescript
const url = 'https://api.sherpo.io/merchant/v1/stores/<store>/webhooks/<webhook>';
const options = {
  method: 'PATCH',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    url: 'string',
    events: ['products.unlocked'],
    description: 'string',
    enabled: true
  })
};

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>"

payload = {
    "url": "string",
    "events": ["products.unlocked"],
    "description": "string",
    "enabled": True
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

Updates a webhook endpoint: its URL, events, description or whether it is sent anything. A new URL or added events need the read scopes the events' payloads carry.

#### Example

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

- `id` (`updateWebhook.response.200.id`; string, required)
- `url` (`updateWebhook.response.200.url`; string, required)
- `description` (`updateWebhook.response.200.description`; any of, required)
  - any of: `string`, `null`
- `events` (`updateWebhook.response.200.events`; array<string>, required)
- `enabled` (`updateWebhook.response.200.enabled`; boolean, required)
- `connection_ended_at` (`updateWebhook.response.200.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` (`updateWebhook.response.200.created_at`; string, required)
- `updated_at` (`updateWebhook.response.200.updated_at`; 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` (`updateWebhook.response.default.type`; string, required)
  - format `uri`
- `title` (`updateWebhook.response.default.title`; string, required)
- `status` (`updateWebhook.response.default.status`; integer, required)
- `detail` (`updateWebhook.response.default.detail`; string, required)
- `code` (`updateWebhook.response.default.code`; string, optional)
- `context` (`updateWebhook.response.default.context`; object, optional)
- `reached_core` (`updateWebhook.response.default.reached_core`; boolean, optional)
- `core_answer` (`updateWebhook.response.default.core_answer`; string, optional)


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