Skip to main content

/api/alerts/*

Push notifications for chain events.

POST /api/alerts/subscribe

Subscribe to events. Returns a subscription id + secret token.

curl -X POST https://api.ombra-net.com/api/alerts/subscribe \
-H "Content-Type: application/json" \
-d '{
"trigger": "address_tx",
"params": { "address": "7a8b7038..." },
"channel": "webhook",
"target": "https://yourapp.com/hooks/ombra"
}'

Trigger types:

  • address_tx — any tx involving an address
  • miner_block — proposer produced a block
  • rewardTASK_REWARD distributed
  • agent_finishedAGENT_FINISH for an address

Channels:

  • webhook — POST JSON to target URL
  • email — sends to target email

Response: { "id": "...", "token": "...", "trigger": "...", "createdAt": ... }

Save the token — needed to unsubscribe.


DELETE /api/alerts/:id

curl -X DELETE https://api.ombra-net.com/api/alerts/abc123 \
-H "X-Alert-Token: YOUR_TOKEN"

GET /api/alerts/

List your alerts (requires X-Alert-Token).

curl https://api.ombra-net.com/api/alerts/ \
-H "X-Alert-Token: YOUR_TOKEN"

Webhook payload format

When a trigger fires, your webhook receives:

POST /your-hook
Content-Type: application/json
X-Ombra-Trigger: address_tx
X-Ombra-Subscription: abc123

{
"trigger": "address_tx",
"tx": { "type": "TRANSFER", "from": "...", "to": "...", "amount": "1000000" },
"blockIndex": 62500,
"timestamp": 1735389942000
}

Webhook must respond 2xx within 5s — else retried 3× with exponential backoff (2s, 4s, 8s), then dropped.