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

# Update a subscription

> Updates an existing webhook subscription.

Updates the URL or events of an existing webhook subscription. You cannot change the resource — delete the subscription and create a new one instead.

## Path parameters

<ParamField path="id" type="integer" required>
  The webhook subscription ID.
</ParamField>

## Request body

<ParamField body="url" type="string">
  The new URL to receive webhook deliveries. Must be a valid URL (max 2048 characters).
</ParamField>

<ParamField body="events" type="array">
  Updated array of trigger events. Must be a subset of the resource's supported triggers.
</ParamField>

## Request

```bash theme={null}
curl -X PUT \
     -H "Authorization: Bearer YOUR_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{"events": ["on_create", "on_update", "on_delete"]}' \
     https://your-app.com/exo-api/webhooks/1
```

## Response

Returns the updated subscription.

**Example response:**

```json theme={null}
{
  "id": 1,
  "user_id": 1,
  "url": "https://example.com/webhook-receiver",
  "resource": "order",
  "events": ["on_create", "on_update", "on_delete"],
  "is_active": true,
  "masked_secret": "sec_****a1b2",
  "created_at": "2026-03-28T14:30:00.000000Z",
  "updated_at": "2026-03-28T15:00:00.000000Z"
}
```

## Errors

| Status | Description                                                         |
| ------ | ------------------------------------------------------------------- |
| `404`  | Subscription not found or does not belong to the authenticated user |
| `422`  | Validation failed — invalid URL or unsupported events               |
