curl --request POST \
--url https://api.zerion.io/v1/tx-subscriptions/ \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"callback_url": "https://webhook.site/fcd606d2-f5bd-4832-9874-ff07c980b5a3",
"addresses": [
"0x42b9df65b219b3dd36ff330a4dd8f327a6ada990"
]
}
'import requests
url = "https://api.zerion.io/v1/tx-subscriptions/"
payload = {
"callback_url": "https://webhook.site/fcd606d2-f5bd-4832-9874-ff07c980b5a3",
"addresses": ["0x42b9df65b219b3dd36ff330a4dd8f327a6ada990"]
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
callback_url: 'https://webhook.site/fcd606d2-f5bd-4832-9874-ff07c980b5a3',
addresses: ['0x42b9df65b219b3dd36ff330a4dd8f327a6ada990']
})
};
fetch('https://api.zerion.io/v1/tx-subscriptions/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zerion.io/v1/tx-subscriptions/"
payload := strings.NewReader("{\n \"callback_url\": \"https://webhook.site/fcd606d2-f5bd-4832-9874-ff07c980b5a3\",\n \"addresses\": [\n \"0x42b9df65b219b3dd36ff330a4dd8f327a6ada990\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": {
"type": "transactions_subscription",
"id": "52d994a173d755e99845e861d534a419",
"attributes": {
"callback_url": "https://webhook.site/fcd606d2-f5bd-4832-9874-ff07c980b5a3",
"created_at": "2022-08-15T11:26:31+00:00",
"updated_at": "2022-08-15T11:26:31+00:00",
"filters": {
"exclude": {
"types": [
"send"
],
"is_spam": true,
"protocol_ids": [
"uniswap-v3"
],
"addresses": [
"0x0000000000000000000000000000000000000001"
]
}
}
},
"relationships": {
"chains": [
{
"links": {
"related": "https://api.zerion.io/v1/chains/polygon"
},
"data": {
"type": "chains",
"id": "polygon"
}
}
]
}
}
}{
"errors": [
{
"title": "Parameter is malformed",
"detail": "Some validation errors will be described here"
}
]
}{
"errors": [
{
"title": "Unauthorized Error",
"detail": "The API key is invalid, please, make sure that you are using a valid key"
}
]
}{
"errors": [
{
"title": "Too many requests",
"detail": "Your request had been throttled"
}
]
}Create subscription
Create a webhook subscription that pushes transaction notifications for a set of wallets to your callback URL.
curl --request POST \
--url https://api.zerion.io/v1/tx-subscriptions/ \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"callback_url": "https://webhook.site/fcd606d2-f5bd-4832-9874-ff07c980b5a3",
"addresses": [
"0x42b9df65b219b3dd36ff330a4dd8f327a6ada990"
]
}
'import requests
url = "https://api.zerion.io/v1/tx-subscriptions/"
payload = {
"callback_url": "https://webhook.site/fcd606d2-f5bd-4832-9874-ff07c980b5a3",
"addresses": ["0x42b9df65b219b3dd36ff330a4dd8f327a6ada990"]
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
callback_url: 'https://webhook.site/fcd606d2-f5bd-4832-9874-ff07c980b5a3',
addresses: ['0x42b9df65b219b3dd36ff330a4dd8f327a6ada990']
})
};
fetch('https://api.zerion.io/v1/tx-subscriptions/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zerion.io/v1/tx-subscriptions/"
payload := strings.NewReader("{\n \"callback_url\": \"https://webhook.site/fcd606d2-f5bd-4832-9874-ff07c980b5a3\",\n \"addresses\": [\n \"0x42b9df65b219b3dd36ff330a4dd8f327a6ada990\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": {
"type": "transactions_subscription",
"id": "52d994a173d755e99845e861d534a419",
"attributes": {
"callback_url": "https://webhook.site/fcd606d2-f5bd-4832-9874-ff07c980b5a3",
"created_at": "2022-08-15T11:26:31+00:00",
"updated_at": "2022-08-15T11:26:31+00:00",
"filters": {
"exclude": {
"types": [
"send"
],
"is_spam": true,
"protocol_ids": [
"uniswap-v3"
],
"addresses": [
"0x0000000000000000000000000000000000000001"
]
}
}
},
"relationships": {
"chains": [
{
"links": {
"related": "https://api.zerion.io/v1/chains/polygon"
},
"data": {
"type": "chains",
"id": "polygon"
}
}
]
}
}
}{
"errors": [
{
"title": "Parameter is malformed",
"detail": "Some validation errors will be described here"
}
]
}{
"errors": [
{
"title": "Unauthorized Error",
"detail": "The API key is invalid, please, make sure that you are using a valid key"
}
]
}{
"errors": [
{
"title": "Too many requests",
"detail": "Your request had been throttled"
}
]
}Authorizations
Body
Callback URL where updates will be delivered to
"https://webhook.site/fcd606d2-f5bd-4832-9874-ff07c980b5a3"
Addresses of the wallets to create subscription for. Maximum 100 addresses on the first create subscription call. You can then add more wallets in batches of 100 by patching the wallets within the subscription. Note: Free tier accounts are limited to 5 addresses per subscription.
Address of the wallet.
Subscribe for transactions from specified chains. Only chains reporting both supports_transactions and supports_positions in the flags of GET /v1/chains/ are accepted here.
Naming a chain that fails that gate returns 400 rather than an empty result, with detail reading chain <id> does not support transactions. That detail names the endpoint's capability rather than the flag that failed, so bob is refused with chain bob does not support transactions even though it reports supports_transactions — what it lacks is supports_positions.
Leave the list empty to subscribe to every chain that passes the gate; chains that fail it are left out silently, with no error and no meta signal.
Exclusion filters for the subscription. Conditions are combined with OR: an
event matching any one of them is dropped and no webhook is delivered for it.
Filters are absent from the response when none are set. What omitting the
field or sending null means is specific to the request that carries it —
see that operation's own description.
Field paths below refer to the delivered webhook transaction payload, not to
this subscription resource. A condition does not match an event lacking the
value it compares, so an event with no dapp is not excluded by
protocol_ids.
Show child attributes
Show child attributes
Callbacks
Response
Response for requested wallet's transactions subscription
Show child attributes
Show child attributes
Was this page helpful?