---
title: "Update a webhook"
method: PATCH
path: "/webhooks/{id}"
tags: ["Webhooks"]
---

# Update a webhook

`PATCH /webhooks/{id}`

## Request

- Base URL: `https://www.sociahive.com/api/v1`
- URL: `https://www.sociahive.com/api/v1/webhooks/{id}`
- Auth: one of:
  - API key in header `X-API-Key`
  - OAuth 2 (authorization code, authorization URL `/api/oauth/authorize`, token URL `/api/oauth/token`, scopes: `webhooks:write`)

## Path parameters

- `id` string, required: MongoDB ObjectId (24-character hex string)

## Request body

- UpdateWebhookRequest
  - `target_url` string, uri
  - `events` WebhookEvent[]
  - `account_ids` string[]: An empty list removes the limit.
  - `active` boolean: Turning a webhook back on resets its failure count.

## Response `200`

Updated

- object
  - `data` Webhook, required: An outbound webhook subscription. Deliveries are signed with the signing secret.
    - `id` string, required: MongoDB ObjectId (24-character hex string)
    - `target_url` string, uri, required
    - `events` WebhookEvent[], required
    - `integration_type` 'webhook' | 'custom' | 'n8n' | 'make' | 'zapier', required
    - `active` boolean, required
    - `account_ids` string[], required: Connected accounts this webhook is limited to. Empty: every account.
    - `consecutive_failures` integer, required
    - `disabled_at` string, nullable, required
    - `disabled_reason` string, nullable, required
    - `last_delivery_at` string, nullable, required
    - `last_status` integer, nullable, required
    - `last_error` string, nullable, required
    - `created_at` string, required
    - `updated_at` string, required

## Other responses

- `400`: Bad request — invalid parameters
- `401`: Authentication required — provide X-API-Key or Bearer token
- `403`: Insufficient scope for this operation
- `404`: Webhook not found
- `409`: A webhook with this URL already exists
- `429`: Rate limit exceeded
- `500`: Internal server error

---

[API](https://skmtc.dev/sociahive/apis/sociahive-api.md) · [All operations](https://skmtc.dev/sociahive/apis/sociahive-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sociahive/apis/sociahive-api/revisions/791b8548d288?raw)
