Create webhook - Webhooks

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

The secret is shown only once. Store it now: no other endpoint returns it. You need it to verify every delivery. If you lose it, rotate it.

Parameters

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

ParameterTypeRequiredDescription
chainstringYeseth.
networkstringNomainnet, the default.
trigger_typestringYesaddress_activity, log_event, or tx_confirmation. See Triggers.
phasesarray of stringsYes["unconfirmed"], ["confirmed"], or both. Ignored by tx_confirmation, but still required: send ["confirmed"].
target_urlstringYesAn https URL on a public domain, without credentials or a fragment. See Target URL rules.
filtersobjectOne of filters, addresses, list_refsThe filter tree. See Filters.
addressesarray of stringsOne of filters, addresses, list_refsAddresses to watch in both directions, as 0x-prefixed 20-byte hex. Stored in the webhook's own list.
list_refsarray of stringsOne of filters, addresses, list_refsIds of your address lists (al_…) to watch in both directions.
confirm_depthinteger or nullNoBlocks before the confirmed delivery: 2 to 96. Leave it out or send null for the default, 96.
namestringNoDisplay name, at most 128 bytes. Surrounding spaces are trimmed.
batchingobjectNoAccepted 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

bashcurl -X POST https://public-api.getblock.io/api/v1/webhooks \
  -H "Authorization: Bearer $GETBLOCK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "usdt-transfers",
    "chain": "eth",
    "network": "mainnet",
    "trigger_type": "log_event",
    "phases": ["unconfirmed", "confirmed"],
    "target_url": "https://hooks.example.io/getblock",
    "filters": {
      "all": [
        { "type": "contract", "in": ["0xdac17f958d2ee523a2206206994597c13d831ec7"] },
        { "type": "topic", "position": 0, "in": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"] }
      ]
    }
  }'
javascriptconst response = await fetch('https://public-api.getblock.io/api/v1/webhooks', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.GETBLOCK_API_KEY}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    name: 'usdt-transfers',
    chain: 'eth',
    network: 'mainnet',
    trigger_type: 'log_event',
    phases: ['unconfirmed', 'confirmed'],
    target_url: 'https://hooks.example.io/getblock',
    filters: {
      all: [
        { type: 'contract', in: ['0xdac17f958d2ee523a2206206994597c13d831ec7'] },
        { type: 'topic', position: 0, in: ['0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'] }
      ]
    }
  })
});

const webhook = await response.json();
console.log(webhook.id, webhook.secret); // store the secret now
pythonimport os
import requests

response = requests.post(
    "https://public-api.getblock.io/api/v1/webhooks",
    headers={"Authorization": f"Bearer {os.environ['GETBLOCK_API_KEY']}"},
    json={
        "name": "usdt-transfers",
        "chain": "eth",
        "network": "mainnet",
        "trigger_type": "log_event",
        "phases": ["unconfirmed", "confirmed"],
        "target_url": "https://hooks.example.io/getblock",
        "filters": {
            "all": [
                {"type": "contract", "in": ["0xdac17f958d2ee523a2206206994597c13d831ec7"]},
                {"type": "topic", "position": 0, "in": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]},
            ]
        },
    },
)

webhook = response.json()
print(webhook["id"], webhook["secret"])  # store the secret now

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

Response Example

201 Created:

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

Response Parameters

The answer is the webhook object plus secret:

FieldTypeDescription
idstringThe new webhook's id (wh_…). Use it in every other /webhooks/{id} call.
statusstringactive.
filtersobjectThe stored filter tree, including the leaf built from addresses and list_refs. Addresses are in lower case.
confirm_depthinteger or nullnull when you left it out: the chain default, 96, applies.
target_urlstringYour URL in canonical form. Compare against this value, not the one you sent.
versioninteger1.
secretstringThe 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

HTTPCodeCause
400empty_body, malformed_bodyNo body, invalid JSON, an unknown field, or a wrong type.
400invalid_trigger_type, trigger_type_not_supportedUnknown trigger_type, or dropped_replaced, which is not available.
400invalid_phasesphases is empty or holds an unknown value.
400confirm_depth_out_of_rangeconfirm_depth is outside 2 to 96.
400unsupported_chain, unsupported_networkAnything but eth / mainnet.
400target_url_*target_url breaks one of the target URL rules.
400filter_*, unknown_filter_leaf, abi_filter_not_supportedThe filter tree is invalid or does not suit the trigger. See Error codes.
400invalid_webhook_name, invalid_batchingname is empty after trimming, too long, or has control characters; batching has negative values.
403plan_requiredA team account without a plan.
404list_not_foundA list_refs entry is not one of your address lists.
409cap_active_webhooks_exceeded, cap_addresses_exceeded, cap_inline_addresses_exceeded, cap_list_refs_exceeded, cap_account_addresses_exceededThe webhook does not fit your plan. Check GET /webhooks/limits.
413—The body is larger than about 5 MiB. Move addresses into address lists.