Update webhook - Webhooks

PATCH /webhooks/{id} changes only the fields you send and leaves the rest as they are. The same plan limits as on create apply to the result, and version grows by one.

PATCH https://public-api.getblock.io/api/v1/webhooks/{id}

chain, network, and trigger_type cannot be changed: sending them is refused with 400 malformed_body. Create a new webhook instead.

Parameters

Path parameter:

ParameterTypeRequiredDescription
idstringYesThe webhook's id (wh_…).

Body fields. Every field is optional, but the body must not be empty:

ParameterTypeDescription
namestring or nullA string renames the webhook; null removes the name.
target_urlstringA new endpoint. Checked against the target URL rules.
phasesarray of strings["unconfirmed"], ["confirmed"], or both.
confirm_depthinteger or null2 to 96 sets the depth; null resets it to the default, 96. Leaving it out keeps the current value.
filtersobjectReplaces the filter tree. Remove any leaf with "src": "sugar" first.
addressesarray of stringsReplaces the webhook's own addresses; [] clears them.
list_refsarray of stringsReplaces the referenced address lists; [] clears them.
batchingobjectStored, but has no effect in this version.

A change that would leave the webhook with no condition at all is refused with 400 filter_would_be_empty: send filters in the same request. See Changing a webhook.

Request Example

bashcurl -X PATCH https://public-api.getblock.io/api/v1/webhooks/wh_4Qk7Xz9pLm2R \
  -H "Authorization: Bearer $GETBLOCK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"target_url": "https://hooks.example.io/getblock-v2", "phases": ["confirmed"]}'
javascriptconst id = 'wh_4Qk7Xz9pLm2R';

const response = await fetch(`https://public-api.getblock.io/api/v1/webhooks/${id}`, {
  method: 'PATCH',
  headers: {
    Authorization: `Bearer ${process.env.GETBLOCK_API_KEY}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    target_url: 'https://hooks.example.io/getblock-v2',
    phases: ['confirmed']
  })
});

console.log(await response.json());
pythonimport os
import requests

webhook_id = "wh_4Qk7Xz9pLm2R"

response = requests.patch(
    f"https://public-api.getblock.io/api/v1/webhooks/{webhook_id}",
    headers={"Authorization": f"Bearer {os.environ['GETBLOCK_API_KEY']}"},
    json={"target_url": "https://hooks.example.io/getblock-v2", "phases": ["confirmed"]},
)

print(response.json())

Response Example

json{
  "id": "wh_4Qk7Xz9pLm2R",
  "name": "usdt-transfers",
  "status": "active",
  "chain": "eth",
  "network": "mainnet",
  "trigger_type": "log_event",
  "filters": { "all": [ { "type": "contract", "in": ["0xdac17f958d2ee523a2206206994597c13d831ec7"] }, { "…": "…" } ] },
  "confirm_depth": null,
  "phases": ["confirmed"],
  "target_url": "https://hooks.example.io/getblock-v2",
  "endpoint_hash": "…",
  "batching": { "max_events": 0, "max_wait_ms": 0, "gzip": false },
  "version": 2,
  "created_at": "2026-09-25T10:00:00Z",
  "updated_at": "2026-09-25T10:05:00Z"
}

Response Parameters

The answer is the updated webhook object. The fields to check after an update:

FieldTypeDescription
versionintegerOne higher than before the change.
target_urlstringThe new URL in canonical form.
endpoint_hashstringChanges when the host or path of target_url changes.
updated_atstringWhen the change was made.

The change applies to the next event at once. Retries that are already scheduled may use the previous settings for up to 60 seconds.

Use Cases

  • Move deliveries to a new endpoint URL
  • Switch from both phases to confirmed only to halve the CU per event
  • Replace the watched addresses after a wallet rotation
  • Raise or lower the confirmation depth

Error Handling

HTTPCodeCause
400empty_bodyThe body is empty.
400malformed_bodyInvalid JSON, an unknown field, a wrong type, or chain, network, or trigger_type in the body.
400invalid_webhook_name, invalid_phases, confirm_depth_out_of_range, invalid_batchingA field has an invalid value.
400filter_would_be_emptyThe change would leave the webhook with no condition.
400filter_reserved_fieldfilters still contains a leaf with "src": "sugar".
400target_url_*, other filter_* codesSee Error codes.
404not_foundNo such webhook among yours.
404list_not_foundA list_refs entry is not one of your address lists.
409cap_addresses_exceeded, cap_inline_addresses_exceeded, cap_list_refs_exceeded, cap_account_addresses_exceededThe result does not fit your plan.
413—The body is larger than about 5 MiB.