API Reference
Create a webhook
API Reference
Create a webhook
Create a new webhook.
POST
/
v1
/
webhooks
import { AvaCloudSDK } from "@avalabs/avacloud-sdk";
const avaCloudSDK = new AvaCloudSDK({
serverURL: "https://api.example.com",
chainId: "43114",
network: "mainnet",
});
async function run() {
const result = await avaCloudSDK.webhooks.create({
eventType: "address_activity",
url: "https://inferior-chainstay.com",
chainId: "<id>",
metadata: {
addresses: [
"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
],
eventSignatures: [
"0x61cbb2a3dee0b6064c2e681aadd61677fb4ef319f0b547508d495626f5a62f64",
],
},
});
// Handle the result
console.log(result);
}
run();
{
"id": "<string>",
"eventType": "address_activity",
"url": "<string>",
"chainId": "<string>",
"status": "active",
"createdAt": 123,
"name": "<string>",
"description": "<string>",
"metadata": {
"addresses": {
"0": "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"
},
"eventSignatures": {
"0": "0x61cbb2a3dee0b6064c2e681aadd61677fb4ef319f0b547508d495626f5a62f64"
}
},
"includeInternalTxs": true,
"includeLogs": true
}
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
Response
201
application/json
Successful response
The response is of type object
.
The response is of type object
.
The response is of type object
.
Was this page helpful?
import { AvaCloudSDK } from "@avalabs/avacloud-sdk";
const avaCloudSDK = new AvaCloudSDK({
serverURL: "https://api.example.com",
chainId: "43114",
network: "mainnet",
});
async function run() {
const result = await avaCloudSDK.webhooks.create({
eventType: "address_activity",
url: "https://inferior-chainstay.com",
chainId: "<id>",
metadata: {
addresses: [
"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
],
eventSignatures: [
"0x61cbb2a3dee0b6064c2e681aadd61677fb4ef319f0b547508d495626f5a62f64",
],
},
});
// Handle the result
console.log(result);
}
run();
{
"id": "<string>",
"eventType": "address_activity",
"url": "<string>",
"chainId": "<string>",
"status": "active",
"createdAt": 123,
"name": "<string>",
"description": "<string>",
"metadata": {
"addresses": {
"0": "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"
},
"eventSignatures": {
"0": "0x61cbb2a3dee0b6064c2e681aadd61677fb4ef319f0b547508d495626f5a62f64"
}
},
"includeInternalTxs": true,
"includeLogs": true
}