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

# Update Webhook

> Update a webhook's URL, events, name, or active status. REST endpoint in the Tuco AI iMessage API — bearer-token auth, JSON request/response, full schema and.

Update any combination of fields on an existing webhook. Only include the fields you want to change.

## Authentication

```bash theme={null}
Authorization: Bearer tuco_sk_xxxxxxxxxxxxx
```

***

## Path parameters

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

***

## Request body

All fields are optional. Include only what you want to change.

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

<ParamField body="events" type="string[]">
  New event subscriptions. **Replaces** the existing list (not a merge).
  Valid values: `message.sent`, `message.failed`, `message.fallback`, `message.reply`, `message.reaction`, `message.opened`, `message.ai_draft`, `message.ai_draft_approved`, `message.ai_draft_rejected`.
</ParamField>

<ParamField body="name" type="string">
  New name.
</ParamField>

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

<ParamField body="isActive" type="boolean">
  Set `false` to pause delivery without deleting the webhook. Set `true` to resume.
</ParamField>

***

## Examples

<CodeGroup>
  ```bash Disable webhook theme={null}
  curl -X PATCH "https://app.tuco.ai/api/webhooks/680a1b2c3d4e5f6789012345" \
    -H "Authorization: Bearer tuco_sk_xxxxxxxxxxxxx" \
    -H "Content-Type: application/json" \
    -d '{ "isActive": false }'
  ```

  ```bash Change URL theme={null}
  curl -X PATCH "https://app.tuco.ai/api/webhooks/680a1b2c3d4e5f6789012345" \
    -H "Authorization: Bearer tuco_sk_xxxxxxxxxxxxx" \
    -H "Content-Type: application/json" \
    -d '{ "url": "https://new-endpoint.example.com/webhooks" }'
  ```

  ```bash Change events theme={null}
  curl -X PATCH "https://app.tuco.ai/api/webhooks/680a1b2c3d4e5f6789012345" \
    -H "Authorization: Bearer tuco_sk_xxxxxxxxxxxxx" \
    -H "Content-Type: application/json" \
    -d '{ "events": ["message.reply", "message.opened"] }'
  ```
</CodeGroup>

```json 200 Response theme={null}
{ "success": true }
```

***

## Errors

| Status | When                                                             |
| ------ | ---------------------------------------------------------------- |
| `400`  | Invalid URL, empty events array, invalid event types, empty name |
| `401`  | Invalid or missing API key                                       |
| `402`  | Subscription past due                                            |
| `404`  | Webhook not found in your workspace                              |
