For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create webhook - Webhooks

Create a webhook that sends matching Ethereum events to your endpoint. Complete guide on how to use POST /webhooks in GetBlock Webhooks documentation.

POST /webhooks creates a webhook that sends every on-chain event matching its trigger and filter to your target_url, and returns the webhook together with its signing secret. The webhook is active as soon as it is created.

POST https://public-api.getblock.io/api/v1/webhooks

Parameters

The body is a JSON object. Unknown fields are refused with 400 malformed_body.

Parameter
Type
Required
Description

chain

string

Yes

eth.

network

string

No

mainnet, the default.

trigger_type

string

Yes

address_activity, log_event, or tx_confirmation. See Triggers.

phases

array of strings

Yes

["unconfirmed"], ["confirmed"], or both. Ignored by tx_confirmation, but still required: send ["confirmed"].

target_url

string

Yes

An https URL on a public domain, without credentials or a fragment. See Target URL rules.

filters

object

One of filters, addresses, list_refs

The filter tree. See Filters.

addresses

array of strings

One of filters, addresses, list_refs

Addresses to watch in both directions, as 0x-prefixed 20-byte hex. Stored in the webhook's own list.

list_refs

array of strings

One of filters, addresses, list_refs

Ids of your address lists (al_…) to watch in both directions.

confirm_depth

integer or null

No

Blocks before the confirmed delivery: 2 to 96. Leave it out or send null for the default, 96.

name

string

No

Display name, at most 128 bytes. Surrounding spaces are trimmed.

batching

object

No

Accepted and stored, but has no effect in this version.

You can combine the three condition fields. addresses and list_refs become one address leaf with "dir": "any" and "src": "sugar"; with filters as well, the stored tree is {"all": [<your tree>, <that leaf>]}. See Shortcuts for addresses and lists.

Request Example

More request bodies, for wallet activity and transaction confirmations, are in Triggers and Filters → Examples.

Response Example

201 Created:

Response Parameters

The answer is the webhook object plus secret:

Field
Type
Description

id

string

The new webhook's id (wh_…). Use it in every other /webhooks/{id} call.

status

string

active.

filters

object

The stored filter tree, including the leaf built from addresses and list_refs. Addresses are in lower case.

confirm_depth

integer or null

null when you left it out: the chain default, 96, applies.

target_url

string

Your URL in canonical form. Compare against this value, not the one you sent.

version

integer

1.

secret

string

The signing secret (whsec_…). Shown only in this answer.

Use Cases

  • Notify a payment service of incoming and outgoing transfers of its deposit wallets

  • Track every Transfer of one ERC-20 token

  • Release goods or credit a balance once a transaction is 12 blocks deep

  • Feed contract events into a monitoring or alerting tool without running a node

Error Handling

HTTP
Code
Cause

400

empty_body, malformed_body

No body, invalid JSON, an unknown field, or a wrong type.

400

invalid_trigger_type, trigger_type_not_supported

Unknown trigger_type, or dropped_replaced, which is not available.

400

invalid_phases

phases is empty or holds an unknown value.

400

confirm_depth_out_of_range

confirm_depth is outside 2 to 96.

400

unsupported_chain, unsupported_network

Anything but eth / mainnet.

400

target_url_*

target_url breaks one of the target URL rules.

400

filter_*, unknown_filter_leaf, abi_filter_not_supported

The filter tree is invalid or does not suit the trigger. See Error codes.

400

invalid_webhook_name, invalid_batching

name is empty after trimming, too long, or has control characters; batching has negative values.

403

plan_required

A team account without a plan.

404

list_not_found

A list_refs entry is not one of your address lists.

409

cap_active_webhooks_exceeded, cap_addresses_exceeded, cap_inline_addresses_exceeded, cap_list_refs_exceeded, cap_account_addresses_exceeded

The webhook does not fit your plan. Check GET /webhooks/limits.

413

—

The body is larger than about 5 MiB. Move addresses into address lists.

Last updated

Was this helpful?