JavaScript
import { Avalanche } from "@avalanche-sdk/chainkit";
const avalanche = new Avalanche();
async function run() {
const result = await avalanche.webhooks.create({
eventType: "address_activity",
url: "https://sophisticated-exterior.org/",
chainId: "<id>",
metadata: {
eventSignatures: [
"0x61cbb2a3dee0b6064c2e681aadd61677fb4ef319f0b547508d495626f5a62f64",
],
addresses: [
"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
],
},
});
console.log(result);
}
run();curl --request POST \
--url https://glacier-api.avax.network/v1/webhooks \
--header 'Content-Type: application/json' \
--header 'x-glacier-api-key: <api-key>' \
--data '
{
"eventType": "address_activity",
"url": "<string>",
"chainId": "<string>",
"metadata": {
"addresses": [
"<string>"
],
"eventSignatures": [
"<string>"
]
},
"name": "<string>",
"description": "<string>",
"includeInternalTxs": true,
"includeLogs": true
}
'import requests
url = "https://glacier-api.avax.network/v1/webhooks"
payload = {
"eventType": "address_activity",
"url": "<string>",
"chainId": "<string>",
"metadata": {
"addresses": ["<string>"],
"eventSignatures": ["<string>"]
},
"name": "<string>",
"description": "<string>",
"includeInternalTxs": True,
"includeLogs": True
}
headers = {
"x-glacier-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://glacier-api.avax.network/v1/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'eventType' => 'address_activity',
'url' => '<string>',
'chainId' => '<string>',
'metadata' => [
'addresses' => [
'<string>'
],
'eventSignatures' => [
'<string>'
]
],
'name' => '<string>',
'description' => '<string>',
'includeInternalTxs' => true,
'includeLogs' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-glacier-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://glacier-api.avax.network/v1/webhooks"
payload := strings.NewReader("{\n \"eventType\": \"address_activity\",\n \"url\": \"<string>\",\n \"chainId\": \"<string>\",\n \"metadata\": {\n \"addresses\": [\n \"<string>\"\n ],\n \"eventSignatures\": [\n \"<string>\"\n ]\n },\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"includeInternalTxs\": true,\n \"includeLogs\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-glacier-api-key", "<api-key>")
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))
}HttpResponse<String> response = Unirest.post("https://glacier-api.avax.network/v1/webhooks")
.header("x-glacier-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"eventType\": \"address_activity\",\n \"url\": \"<string>\",\n \"chainId\": \"<string>\",\n \"metadata\": {\n \"addresses\": [\n \"<string>\"\n ],\n \"eventSignatures\": [\n \"<string>\"\n ]\n },\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"includeInternalTxs\": true,\n \"includeLogs\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://glacier-api.avax.network/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-glacier-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"eventType\": \"address_activity\",\n \"url\": \"<string>\",\n \"chainId\": \"<string>\",\n \"metadata\": {\n \"addresses\": [\n \"<string>\"\n ],\n \"eventSignatures\": [\n \"<string>\"\n ]\n },\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"includeInternalTxs\": true,\n \"includeLogs\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"url": "<string>",
"chainId": "<string>",
"createdAt": 123,
"name": "<string>",
"description": "<string>",
"eventType": "address_activity",
"metadata": {
"addresses": [
"<string>"
],
"eventSignatures": [
"<string>"
]
},
"includeInternalTxs": true,
"includeLogs": true
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}API Reference
Create a webhook
Create a new webhook.
POST
/
v1
/
webhooks
JavaScript
import { Avalanche } from "@avalanche-sdk/chainkit";
const avalanche = new Avalanche();
async function run() {
const result = await avalanche.webhooks.create({
eventType: "address_activity",
url: "https://sophisticated-exterior.org/",
chainId: "<id>",
metadata: {
eventSignatures: [
"0x61cbb2a3dee0b6064c2e681aadd61677fb4ef319f0b547508d495626f5a62f64",
],
addresses: [
"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
],
},
});
console.log(result);
}
run();curl --request POST \
--url https://glacier-api.avax.network/v1/webhooks \
--header 'Content-Type: application/json' \
--header 'x-glacier-api-key: <api-key>' \
--data '
{
"eventType": "address_activity",
"url": "<string>",
"chainId": "<string>",
"metadata": {
"addresses": [
"<string>"
],
"eventSignatures": [
"<string>"
]
},
"name": "<string>",
"description": "<string>",
"includeInternalTxs": true,
"includeLogs": true
}
'import requests
url = "https://glacier-api.avax.network/v1/webhooks"
payload = {
"eventType": "address_activity",
"url": "<string>",
"chainId": "<string>",
"metadata": {
"addresses": ["<string>"],
"eventSignatures": ["<string>"]
},
"name": "<string>",
"description": "<string>",
"includeInternalTxs": True,
"includeLogs": True
}
headers = {
"x-glacier-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://glacier-api.avax.network/v1/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'eventType' => 'address_activity',
'url' => '<string>',
'chainId' => '<string>',
'metadata' => [
'addresses' => [
'<string>'
],
'eventSignatures' => [
'<string>'
]
],
'name' => '<string>',
'description' => '<string>',
'includeInternalTxs' => true,
'includeLogs' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-glacier-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://glacier-api.avax.network/v1/webhooks"
payload := strings.NewReader("{\n \"eventType\": \"address_activity\",\n \"url\": \"<string>\",\n \"chainId\": \"<string>\",\n \"metadata\": {\n \"addresses\": [\n \"<string>\"\n ],\n \"eventSignatures\": [\n \"<string>\"\n ]\n },\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"includeInternalTxs\": true,\n \"includeLogs\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-glacier-api-key", "<api-key>")
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))
}HttpResponse<String> response = Unirest.post("https://glacier-api.avax.network/v1/webhooks")
.header("x-glacier-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"eventType\": \"address_activity\",\n \"url\": \"<string>\",\n \"chainId\": \"<string>\",\n \"metadata\": {\n \"addresses\": [\n \"<string>\"\n ],\n \"eventSignatures\": [\n \"<string>\"\n ]\n },\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"includeInternalTxs\": true,\n \"includeLogs\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://glacier-api.avax.network/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-glacier-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"eventType\": \"address_activity\",\n \"url\": \"<string>\",\n \"chainId\": \"<string>\",\n \"metadata\": {\n \"addresses\": [\n \"<string>\"\n ],\n \"eventSignatures\": [\n \"<string>\"\n ]\n },\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"includeInternalTxs\": true,\n \"includeLogs\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"url": "<string>",
"chainId": "<string>",
"createdAt": 123,
"name": "<string>",
"description": "<string>",
"eventType": "address_activity",
"metadata": {
"addresses": [
"<string>"
],
"eventSignatures": [
"<string>"
]
},
"includeInternalTxs": true,
"includeLogs": true
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}Authorizations
Api keys provide higher access to rate limits. To obtain an api key, sign up for an account at https://avacloud.io/.
Body
application/json
- Option 1
- Option 2
- Option 3
Available options:
address_activity Show child attributes
Show child attributes
Whether to include traces in the webhook payload. Traces are only available for C-Chain on chainId 43113 and 43114.
Whether to include logs in the webhook payload.
Response
Successful response
- Option 1
- Option 2
- Option 3
Available options:
active, inactive Available options:
address_activity Show child attributes
Show child attributes
Whether to include traces in the webhook payload.
Whether to include logs in the webhook payload.
Was this page helpful?
⌘I