JavaScript
import { Avalanche } from "@avalanche-sdk/chainkit";
const avalanche = new Avalanche();
async function run() {
const result = await avalanche.webhooks.update({
id: "f33de69c-d13b-4691-908f-870d6e2e6b04",
updateWebhookRequest: {},
});
console.log(result);
}
run();curl --request PATCH \
--url https://glacier-api.avax.network/v1/webhooks/{id} \
--header 'Content-Type: application/json' \
--header 'x-glacier-api-key: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"url": "<string>",
"includeInternalTxs": true,
"includeLogs": true
}
'import requests
url = "https://glacier-api.avax.network/v1/webhooks/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"url": "<string>",
"includeInternalTxs": True,
"includeLogs": True
}
headers = {
"x-glacier-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'url' => '<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/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"url\": \"<string>\",\n \"includeInternalTxs\": true,\n \"includeLogs\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://glacier-api.avax.network/v1/webhooks/{id}")
.header("x-glacier-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"url\": \"<string>\",\n \"includeInternalTxs\": true,\n \"includeLogs\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://glacier-api.avax.network/v1/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-glacier-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"url\": \"<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
Update a webhook
Updates an existing webhook.
PATCH
/
v1
/
webhooks
/
{id}
JavaScript
import { Avalanche } from "@avalanche-sdk/chainkit";
const avalanche = new Avalanche();
async function run() {
const result = await avalanche.webhooks.update({
id: "f33de69c-d13b-4691-908f-870d6e2e6b04",
updateWebhookRequest: {},
});
console.log(result);
}
run();curl --request PATCH \
--url https://glacier-api.avax.network/v1/webhooks/{id} \
--header 'Content-Type: application/json' \
--header 'x-glacier-api-key: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"url": "<string>",
"includeInternalTxs": true,
"includeLogs": true
}
'import requests
url = "https://glacier-api.avax.network/v1/webhooks/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"url": "<string>",
"includeInternalTxs": True,
"includeLogs": True
}
headers = {
"x-glacier-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'url' => '<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/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"url\": \"<string>\",\n \"includeInternalTxs\": true,\n \"includeLogs\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://glacier-api.avax.network/v1/webhooks/{id}")
.header("x-glacier-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"url\": \"<string>\",\n \"includeInternalTxs\": true,\n \"includeLogs\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://glacier-api.avax.network/v1/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-glacier-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"url\": \"<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/.
Path Parameters
The webhook identifier.
Body
application/json
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