webhooks.create
Create a webhook that POSTs matching transactions to your URL.
Details
- Endpoint
- POST /v0/webhooks
- Credits
- 10
- Rate class
- Light. Counts against your light requests per second.
Creates a webhook for account addresses and transaction types, with coinTypes, eventTypes, packages, objectIds and balanceAddresses filters. Filters of different kinds combine with AND, entries inside one list with OR; transactions that match an objectIds, packages or balanceAddresses filter carry a matched field saying what matched. The response carries a signing secret that is shown once: verify the tide-signature header (t=<unix>,v1=<hex HMAC-SHA256(secret, t + '.' + body)>). Each POST holds up to 100 transactions of one checkpoint; tide-delivery-id is stable across retries so you can dedupe. Retries run for 24 hours. Costs 10 credits to create, 1 per delivered transaction.
Parameters
| Name | Type | Description |
|---|---|---|
| webhookURLrequired | string | Public https URL that receives POSTs. Private and loopback addresses are refused. |
| webhookType | string | enhanced = parsed transactions (default), raw = balance changes, events and object changes, discord = one sentence and a tide.ad link per transaction.One of "enhanced", "raw", "discord". |
| accountAddresses | array of string | Match transactions that touch any of these addresses. Up to your plan's limit. |
| transactionTypes | array of string | Only these transaction types (SWAP, TRANSFER, ...). Omit or use ANY for all. |
| txnStatus | string | Default all.One of "all", "success", "failed". |
| authHeader | string | Sent back to you as the Authorization header on every POST. |
| coinTypes | array of string | Coin types with a balance change. |
| eventTypes | array of string | Move event types: a full type with or without type parameters, a module prefix (0xpackage::module) or a package prefix (0xpackage). Up to 100 entries on Free, 1,000 on paid plans. |
| packages | array of string | Match transactions whose PTB called these packages: 0xpackage, 0xpackage::module or 0xpackage::module::function. Any version of the package matches, so pass the original id and upgrades are covered. Up to 100 entries on Free, 1,000 on paid plans. |
| objectIds | array of string | Match any change to these object ids: created, mutated, deleted, wrapped or unwrapped. Each delivered transaction carries matched.objects with the new version and kind. Up to 100 entries on Free, 1,000 on paid plans. |
| balanceAddresses | array of string | Match a balance change of these addresses, narrowed by coinTypes when given. Each delivered transaction carries matched.balances with the signed delta in the coin's smallest unit. Up to 100 entries on Free, 1,000 on paid plans. |
Request
Send your key in the x-api-key header, or leave it out to use the keyless tier.
curl -X POST "https://api.tide.ad/v0/webhooks" \
-H "x-api-key: YOUR_API_KEY" \
-H "content-type: application/json" \
-d '{
"webhookURL": "https://example.com/tide-webhook",
"webhookType": "raw",
"coinTypes": [
"0x2::sui::SUI"
]
}'const res = await fetch("https://api.tide.ad/v0/webhooks", {
method: "POST",
headers: {
"x-api-key": process.env.TIDE_API_KEY!,
"content-type": "application/json",
},
body: JSON.stringify({
"webhookURL": "https://example.com/tide-webhook",
"webhookType": "raw",
"coinTypes": [
"0x2::sui::SUI"
]
}),
});
const data = await res.json();Response
No example response is available for this method yet.