Webhooks API

The Webhooks API lets you subscribe to events on the TON blockchain, enabling you to build applications that respond to blockchain activity in real time.


Webhook Management API Methods

Set up a new webhook, define its endpoint, and return a webhook ID. The webhook ID is used to manage subscriptions for account transaction updates


Create Webhook and Subscribe to Account Transactions

Set up a new webhook, define its endpoint, and return a webhook UUID. The webhook UUID is used to manage subscriptions for account transaction updates. Note that request parameter uses raw form of the account address.

Request:

{
  "endpoint": "https://webhook/endpoint",
  "topic": "MinedTransactions",
  "params": ["-1:7ed4dc7031cd3538218438bd424d4d690dac4e195e1547e7305cc4c10f901e14"]
}

Response:

{
   Success: true,
   Message: 'UUID'
}

Server-Sent Event Example:

{
  "event": {
    "result": {
      "account": "-1:3333333333333333333333333333333333333333333333333333333333333333",
      "hash": "9e53eeb21472f29684227440fd63eb3dbe3f3d2ec59762ca93c23e79cec65c39",
      "lt": 51570942000002,
      "block": "(-1,8000000000000000,42663411)",
      "orig_status": "active",
      "end_status": "active"
    }
  },
  "topic": "MinedTransactions",
  "trigger_id": "d7ff0e69-c3b5-4d93-a68a-4f703ceb6e0b"
}

Verify Webhook

Validate a webhook with its UUID.

Request:

{
  "id": "UUID"
}

Response:

{
	Success: true,
	Message: "Endpoint verified successfully"
}

Authentication

Use your private TON API key for Webhook API methods. You can create a personal key at https://dashboard.tonxapi.com/.

Use HTTP header

'API_KEY: TONXAPIKey’