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

# Update Subscription

> Update a webhook subscription — only the fields you send are changed.

Partial update: send only the fields to change. Use `active: false` to pause deliveries without deleting the subscription.

### Path Parameters

<ParamField path="subscription_id" type="string" required>
  The subscription to update.
</ParamField>

### Request Body

<ParamField body="target_url" type="string">
  New delivery endpoint (HTTPS; internal/private addresses rejected).
</ParamField>

<ParamField body="events" type="string[]">
  Replace the subscribed event types.
</ParamField>

<ParamField body="active" type="boolean">
  Enable or pause deliveries.
</ParamField>

<ParamField body="ip_allowlist" type="string[]">
  Replace the source-IP allowlist.
</ParamField>

<ParamField body="payload_version" type="string">
  Change the payload schema version.
</ParamField>

### Response

The updated subscription, same shape as [list subscriptions](/api-reference/webhooks/list-subscriptions).

<ResponseExample>
  ```json 200 theme={null}
  {
      "id": "7c1d2e3f-...",
      "application_id": "2e35e07e-...",
      "target_url": "https://example.com/webhooks/hostpay",
      "events": ["deposit.completed", "payout.failed"],
      "active": true,
      "ip_allowlist": null,
      "payload_version": "2025-01",
      "secret_preview": "...k3Qz",
      "created_at": "2026-07-04T10:30:00Z",
      "updated_at": "2026-07-04T10:30:00Z"
    }
  ```

  ```json 404 theme={null}
  {
    "detail": "Subscription not found"
  }
  ```
</ResponseExample>

<RequestExample>
  ```bash cURL theme={null}
  curl --request PATCH \
    --url https://hpay-api.host-sl.com/api/v1/webhooks/subscriptions/7c1d2e3f-... \
    --header 'api-key: YOUR_API_KEY' \
    --header 'secret-key: YOUR_SECRET_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "active": false
    }'
  ```

  ```python Python theme={null}
  from hostpay import HostPay

  client = HostPay(api_key="YOUR_API_KEY", secret_key="YOUR_SECRET_KEY")

  client.webhooks.subscriptions.update("7c1d2e3f-...", active=False)
  ```

  ```typescript TypeScript theme={null}
  import { HostPay } from "@hostpay/sdk";

  const client = new HostPay({ apiKey: "YOUR_API_KEY", secretKey: "YOUR_SECRET_KEY" });

  await client.webhooks.subscriptions.update("7c1d2e3f-...", { active: false });
  ```
</RequestExample>
