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

# Update a webhook (url, events, status)

` PATCH /projects/{projectId}/webhooks/{webhookId} `

Update a webhook (url, events, status)

## Servers

- ` https://api.rogeriq.com/api/v1 `

## Authentication

The operation accepts these alternatives. Schemes within one alternative are required together.

### Alternative 1

- ` apiKey `: ` apiKey `

  - Credential: ` X-API-Key ` in ` header `

  - API key with `riq_` prefix

## Parameters

### ` projectId ` (path, required)

- ` value `: type ` string `

### ` webhookId ` (path, required)

- ` value `: type ` string `

## Request body (optional)

Content type: ` application/json `

- ` value `: type ` object `

  - ` url `: type ` string `; format ` uri `

  - ` events `: type ` array `

    - ` array item `: type ` string ` — Webhook event types. Wildcards supported: '*' (all), 'conversation.*'.

      - enum: ` ["conversation.created","conversation.updated","conversation.resolved","message.created","contact.created","contact.updated","agent.escalated","agent.action_executed","form.submitted","webhook.test"] `

  - ` status `: type ` string `

    - enum: ` ["active","disabled"] `

## Responses

### ` 200 ` — Updated webhook

Content type: ` application/json `

- ` value `: type ` object `

  - ` data `: type ` object `

    - ` id `: type ` string `

    - ` url `: type ` string `; format ` uri `

    - ` events `: type ` array `

      - ` array item `: type ` string `

    - ` secret `: type ` string ` — Only returned on creation

    - ` status `: type ` string `

      - enum: ` ["active","disabled"] `

    - ` failure_count `: type ` integer `

    - ` last_triggered_at `: type ` string `; nullable; format ` date-time `

    - ` created_at `: type ` string `; format ` date-time `

## Request examples

### cURL

```curl
curl -X PATCH 'https://api.rogeriq.com/api/v1/projects/string/webhooks/string' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "url": "https://example.com",
  "events": [
    "conversation.created"
  ],
  "status": "active"
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.rogeriq.com/api/v1/projects/string/webhooks/string', {
  method: 'PATCH',
  headers: {
      "Authorization": "Bearer YOUR_API_TOKEN",
      "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "url": "https://example.com",
    "events": [
      "conversation.created"
    ],
    "status": "active"
  })
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

headers = {
    'Authorization': 'Bearer YOUR_API_TOKEN'
}

response = requests.patch('https://api.rogeriq.com/api/v1/projects/string/webhooks/string', headers=headers, json={
  "url": "https://example.com",
  "events": [
    "conversation.created"
  ],
  "status": "active"
})
print(response.json())
```