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

# Change a webhook

`PATCH /webhooks/{id}`

## Request

- Base URL: `https://sochain.com/api/v3`
- URL: `https://sochain.com/api/v3/webhooks/{id}`
- Auth: API key in header `API-KEY`

Its url, label, notify_at or threshold, or pause and resume it (status). A new url is checked at once. Any other field is refused with a 400 that says where that change is made.

## Path parameters

- `id` string, required

## Request body

- WebhookUpdate: Any of these; what isn't sent stays as it is. Any other field is refused with a 400.
  - `url` string, uri: A new endpoint: it's checked at once, and the webhook is unverified until it echoes the challenge.
  - `status` 'active' | 'paused': Pause it, or resume it (a webhook resumes once verified).
  - `label` string: Yours, as the dashboard shows it.
  - `notify_at` integer[]: address.transaction and transaction.confirmation: as on create.
  - `threshold` number: fees.below and fees.above: the fee rate to cross; the alert starts over.

## Response `200`

Success.

- object
  - `status` 'success', required
  - `data` Webhook, required
    - `id` string, required
    - `type` 'address.transaction' | 'transaction.confirmation' | 'block.new' | 'fees.below' | 'fees.above', required: block.reorged, transaction.replaced and transaction.dropped are delivered alongside these; they aren't created on their own.
    - `network` 'BTC' | 'LTC' | 'DOGE' | 'ZEC' | 'BTCTEST' | 'LTCTEST' | 'DOGETEST' | 'ZECTEST', required
    - `url` string, uri, required
    - `bucket` string, nullable
    - `notify_at` integer[]
    - `threshold` number, nullable
    - `label` string, nullable: Yours, as the dashboard shows it.
    - `status` 'unverified' | 'active' | 'paused'
    - `num_addresses` integer: Addresses it watches itself (address.transaction without a bucket).
    - `num_transactions` integer: Transactions it tracks (transaction.confirmation).
    - `created` integer: When it was made (Unix time).
    - `last_event_at` integer, nullable: When it last sent an event (Unix time); null before its first.
    - `failing_since` integer, nullable: When its deliveries started failing (Unix time); null while they succeed.
    - `verified` boolean
    - `verify_error` string, nullable: Why the last endpoint check failed, if it did.
    - `secret` string: Only in the answer to POST /webhooks: the signing secret, shown once.

## Other responses

- `400`: A bad parameter or body; the message says which.
- `401`: An invalid key, no key where one is needed (buckets, webhooks, /account_info), a locked account or expired plan, or both the month's requests and the keyless rate used up. Kept as 401, with this message, for v3 compatibility.
- `403`: A read-only key, or a change past your plan's limits: data.error_message says which.
- `404`: Not found.
- `413`: A body over the limit: 256 KB where a call carries addresses or transaction IDs, 64 KB otherwise.
- `415`: A body that isn't JSON: send it with Content-Type: application/json.
- `429`: A new url within 10 seconds of the endpoint's last check: wait the Retry-After seconds.
- `503`: Briefly unavailable; retry with backoff. May carry Retry-After.

---

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