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

# Update Webhook

> Update webhook configuration

<ParamField path="id" type="string" required>
  Webhook ID to update.
</ParamField>

<ParamField body="url" type="string">
  New webhook URL.
</ParamField>

<ParamField body="events" type="array">
  New event subscription list.
</ParamField>

<ParamField body="enabled" type="boolean">
  Enable or disable the webhook.
</ParamField>

<ParamField body="description" type="string">
  Updated description.
</ParamField>

<Note>
  The webhook secret cannot be changed. To rotate the secret, delete and recreate the webhook.
</Note>

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH https://agentgate.mynewapi.com/v1/webhooks/wh_abc123 \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "events": ["run.completed", "run.failed", "run.cancelled"],
      "enabled": true
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "wh_abc123",
    "url": "https://your-app.com/webhooks/agentgate",
    "events": ["run.completed", "run.failed", "run.cancelled"],
    "enabled": true,
    "description": "Production webhook",
    "createdAt": "2024-01-15T10:30:00Z",
    "updatedAt": "2024-01-15T11:00:00Z"
  }
  ```
</ResponseExample>
