---
title: Update webhook
url: https://anyrow.ai/docs/api/webhooks/update
canonical_url: https://anyrow.ai/docs/api/webhooks/update
---

# Update webhook

`PATCH /v1/organizations/{organization_id}/webhooks/{id}`

Authentication: `Authorization: ApiKey {your_api_key}`.

## Path parameters

- `organization_id` (string, required)
- `id` (string, required)

## Request body

Content type: `application/json` (required).

- `active` (boolean, optional)
- `events` (array of strings, optional): At least 1 items.
- `name` (string, optional): Up to 64 characters.
- `url` (string, optional): Up to 2048 characters. Matches `^https:\/\/.*`.

## Returns

200 `application/json`.

- `created_at` (integer, required): At least 0.
- `updated_at` (integer, required): At least 0.
- `id` (string, required): 1 to 48 characters.
- `name` (string, required, nullable): Up to 64 characters.
- `organization_id` (string, required): 1 to 48 characters.
- `url` (string, required): Up to 2048 characters.
- `secret_rotated_at` (integer, required, nullable): At least 0.
- `active` (boolean, required)
- `failure_count` (integer, required): At least 0.
- `last_triggered_at` (integer, required, nullable): At least 0.
- `events` (array of strings, required): At least 1 items.

## Errors

- 404: `not_found`, `webhook_not_found`

Errors every endpoint can return: [Errors](https://anyrow.ai/docs/api/errors.md).

## Request

```ts title="Node.js"
import { AnyrowSDK } from "@anyrow/sdk"

const anyrow = new AnyrowSDK({
  baseURL: "https://api.anyrow.ai",
  headers: { Authorization: `ApiKey ${process.env.ANYROW_API_KEY}` },
})

const { data, error } = await anyrow.webhook.update({
  params: {
    organization_id: "{organization_id}",
    id: "{id}"
  },
  json: {
    active: true,
    events: [
      "batch.complete"
    ],
    name: "string",
    url: "https://example.com"
  },
})
```

```bash title="cURL"
curl -X PATCH 'https://api.anyrow.ai/v1/organizations/{organization_id}/webhooks/{id}' \
  -H 'Authorization: ApiKey {your_api_key}' \
  -H 'Content-Type: application/json' \
  -d '{
  "active": true,
  "events": [
    "batch.complete"
  ],
  "name": "string",
  "url": "https://example.com"
}'
```

```js title="JavaScript"
const response = await fetch("https://api.anyrow.ai/v1/organizations/{organization_id}/webhooks/{id}", {
  method: "PATCH",
  headers: {
    Authorization: "ApiKey {your_api_key}",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "active": true,
    "events": [
      "batch.complete"
    ],
    "name": "string",
    "url": "https://example.com"
  }),
})
const data = await response.json()
```

```python title="Python"
import requests

response = requests.patch(
    "https://api.anyrow.ai/v1/organizations/{organization_id}/webhooks/{id}",
    headers={
        "Authorization": "ApiKey {your_api_key}",
    },
    json={
        "active": True,
        "events": [
            "batch.complete",
        ],
        "name": "string",
        "url": "https://example.com",
    },
)
print(response.json())
```

## Response

```json title="200"
{
  "created_at": 1711468800000,
  "updated_at": 1711468800000,
  "id": "whook_01h5a3g8k9m2n4p6q8r0t2v4x6",
  "name": "string",
  "organization_id": "string",
  "url": "https://example.com",
  "secret_rotated_at": 1711468800000,
  "active": true,
  "failure_count": 42,
  "last_triggered_at": 1711468800000,
  "events": [
    "batch.complete"
  ]
}
```
