Get webhook addresses - Webhooks

GET /webhooks/{id}/addresses returns the addresses the webhook was created or updated with in addresses, one page at a time, together with the id of the list that holds them.

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

That list belongs to the webhook. It does not appear under GET /address-lists and changes only through PATCH /webhooks/{id} with addresses. Addresses from named lists in list_refs are not included: read them with Get address list entries.

Parameters

Path parameter:

ParameterTypeRequiredDescription
idstringYesThe webhook's id (wh_…).

Query parameters:

ParameterTypeRequiredDescription
limitintegerNoPage size. Default 50, at most 200.
cursorstringNoThe next_cursor of the previous page.

Request Example

bashcurl "https://public-api.getblock.io/api/v1/webhooks/wh_4Qk7Xz9pLm2R/addresses?limit=200" \
  -H "Authorization: Bearer $GETBLOCK_API_KEY"
javascriptconst id = 'wh_4Qk7Xz9pLm2R';
const addresses = [];
let cursor;

do {
  const url = new URL(`https://public-api.getblock.io/api/v1/webhooks/${id}/addresses`);
  url.searchParams.set('limit', '200');
  if (cursor) url.searchParams.set('cursor', cursor);

  const response = await fetch(url, {
    headers: { Authorization: `Bearer ${process.env.GETBLOCK_API_KEY}` }
  });
  const page = await response.json();

  addresses.push(...page.addresses);
  cursor = page.next_cursor;
} while (cursor);

console.log(addresses.length);
pythonimport os
import requests

webhook_id = "wh_4Qk7Xz9pLm2R"
headers = {"Authorization": f"Bearer {os.environ['GETBLOCK_API_KEY']}"}
params = {"limit": 200}
addresses = []

while True:
    page = requests.get(
        f"https://public-api.getblock.io/api/v1/webhooks/{webhook_id}/addresses",
        headers=headers,
        params=params,
    ).json()
    addresses.extend(page["addresses"])
    if "next_cursor" not in page:
        break
    params["cursor"] = page["next_cursor"]

print(len(addresses))

Response Example

json{
  "list_id": "al_2bQ4rTz9KmNp",
  "addresses": ["0x742d35cc6634c0532925a3b844bc454e4438f44e"]
}

A webhook without addresses answers {"list_id": null, "addresses": []}.

Response Parameters

FieldTypeDescription
list_idstring or nullThe id of the webhook's own list. The webhook's filter references it in list_refs. null when the webhook has no addresses.
addressesarray of stringsLower-case 0x-prefixed addresses, in address order. Never null.
next_cursorstringPass it as cursor for the next page. Absent on the last page.

Use Cases

  • Show which wallets a webhook watches in your own interface
  • Compare a webhook's addresses with your database before replacing them with PATCH

Error Handling

HTTPCodeCause
400invalid_limit, invalid_cursorlimit is not an integer, or cursor was not issued by this endpoint.
404not_foundNo such webhook among yours.