⚡ Test Our Private Nodes of 40+ Blockchains just for $50!

coins coins coins coins
/

Endpoints

PUT

Update

Update a webhook

  • https://api.getblock.io/external/webhook/{id}

Request

Headers

  • x-api-key string - GetBlock API key to access GetBlock Tracker API.

Query params

  • id string - webhook id.

Body

Object

  • name string - webhook name.

  • expression string - boolean expression to trigger the webhook.

  • url string - your target URL to receive webhook notifications.

  • protocol string - protocol of the node (BNB Smart chain).

  • network string - network of the node (mainnet).

  • draft bool - true, if the webhook is draft, false – if not.

  • enabled bool - true, if the webhook is enabled, false – if not.

Response

Response is successful [200]

Objects

  • id string - webhook id.

  • name string - webhook name.

  • expression string - boolean expression to trigger the webhook.

  • url string - your target URL to receive webhook notifications.

  • protocol string - protocol of the node (BNB Smart chain).

  • network string - network of the node (mainnet).

  • draft bool - true, if the webhook is draft, false – if not.

  • enabled bool - true, if the webhook is enabled, false – if not.

  • failed bool - true, if URL of the webhook doesn't work (status code not 200 or smt).

Response is not successful [400, 500]

Object

  • description string - description of what went wrong.

  • status_code int - status code of response.

Examples

Request

curl --location --request PUT 'https://api.getblock.io/external/webhook/374173824' \
--header 'x-api-key: YOUR-API-KEY' \
--header 'Content-Type: application/json' \
--data-raw '
{
    "name": "new some name",
    "expression": "block_number == 1 or block_number == 2",
    "url": "https://webhook.site/",
    "protocol": "bsc",
    "network": "mainnet"
    "draft": false,
    "enabled": true,
    "failed": false
}'

Response

{
    "id": "374173824",
    "name": "new some name",
    "expression": "block_number == 1 or block_number == 2",
    "url": "https://webhook.site/",
    "protocol": "bsc",
    "network": "mainnet"
    "draft": false,
    "enabled": true,
    "failed": false
}