curl --request PATCH \
--url https://api.zerion.io/v1/tx-subscriptions/{subscription_id}/chain_ids \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"chain_ids": [
"ethereum"
]
}
'import requests
url = "https://api.zerion.io/v1/tx-subscriptions/{subscription_id}/chain_ids"
payload = { "chain_ids": ["ethereum"] }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({chain_ids: ['ethereum']})
};
fetch('https://api.zerion.io/v1/tx-subscriptions/{subscription_id}/chain_ids', 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/{subscription_id}/chain_ids"
payload := strings.NewReader("{\n \"chain_ids\": [\n \"ethereum\"\n ]\n}")
req, _ := http.NewRequest("PATCH", 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))
}{
"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"
}
]
}Update chain IDs within subscription
Change which chains a webhook subscription monitors, replacing the current chain list.
curl --request PATCH \
--url https://api.zerion.io/v1/tx-subscriptions/{subscription_id}/chain_ids \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"chain_ids": [
"ethereum"
]
}
'import requests
url = "https://api.zerion.io/v1/tx-subscriptions/{subscription_id}/chain_ids"
payload = { "chain_ids": ["ethereum"] }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({chain_ids: ['ethereum']})
};
fetch('https://api.zerion.io/v1/tx-subscriptions/{subscription_id}/chain_ids', 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/{subscription_id}/chain_ids"
payload := strings.NewReader("{\n \"chain_ids\": [\n \"ethereum\"\n ]\n}")
req, _ := http.NewRequest("PATCH", 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))
}{
"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
Path Parameters
ID of the subscription
"77e77447-1586-40e8-a75b-467ef939a0b1"
Body
The list of new chain IDs to replace the current associated chain IDs in the subscription. 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 cover every chain that passes the gate; chains that fail it are left out silently, with no error and no meta signal.
A chain ID.
Response
Successfully updated chain IDs
Was this page helpful?