Update Events Configuration
Update event configurations with advanced settings including webhooks, rules, and parameters. This endpoint allows you to configure detailed monitoring rules for your events.
Key Components
- eventName: Unique identifier for the event
- eventRules: Collection of monitoring rules
- parameterCollection: Array of parameters to monitor and trigger rules
- webhooks: Array of webhook endpoints called when rules are triggered
- email_notification: Boolean flag for email alerts
- polling_interval: How frequently to check for events (1000, 5000, 10000, 30000 ms)
Request
POST https://api.arkhia.io/events/hedera/settings/update/:item/:config/:x-api-key
HEADERS
x-api-secret | string | The Api Secret retrieved from an Arkhia project
PARAMETERS
item | string | `contract` or `ethtopic`
config | string | `events`
x-api-key | string | The Api Key retrieved from an Arkhia project
BODY PAYLOAD
item_id | string | `contract` or `account` -> hedera_item_id , `ethtopic` as an eth topic
network_id | number | `295` (mainnet) or `296` (testnet)
config_type | string | `events`
config_object | EventConfig | Full Event Configuration to uploaded
PAYLOAD REFERENCE
HEADERS
x-api-secret | string | The Api Secret retrieved from an Arkhia project
PARAMETERS
item | string | `contract` or `ethtopic`
config | string | `events`
x-api-key | string | The Api Key retrieved from an Arkhia project
BODY PAYLOAD
item_id | string | `contract` or `account` -> hedera_item_id , `ethtopic` as an eth topic
network_id | number | `295` (mainnet) or `296` (testnet)
config_type | string | `events`
config_object | EventConfig | Full Event Configuration to uploaded
PAYLOAD REFERENCE
export type ConfigType = 'events'; export type PollingInterval = 1000 | 5000 | 10000 | 30000; export type WebhookCallType = 'get' | 'post'; export interface ParameterInstance { enabled: boolean; parameterId: string; parameterType: string; parameterName: string; parameterRule: number; parameterRuleValue: string; }; export interface WebhookInstance { tag: string; key: string; value: string; // `https://www.mywebhook.com/callsomething/request` type: WebhookCallType; active: boolean; }; export interface EventRule { ruleId: string; ruleName: string; enabled: boolean; email_notification: boolean; polling_interval: PollingInterval; parameterCollection: Array<Parameter>; webhooks: Array<WebhookInstance>; } export interface EventInstance { eventId: string, eventName: string, eventRules: Array<EventRules>; } // Payload to submit export interface EventConfig { item_id: string; network_id: string; config_type: ConfigType; config_object: Array<EventInstance>; }
Payload example
{
item_id: '0.0.1203',
network_id: 295,
config_type: 'events',
config_object:
[
{
eventId: '0.0.1203_event',
eventName: '0.0.1203_eventx',
eventRules:
[
{
ruleId: '0.0.1203_eventx_rule0',
ruleName: '0.0.1203_eventx_rule0',
enabled: true,
email_notification: false,
polling_interval: 1000,
parameterCollection:
[
{
enabled: true,
parameterId: "FairTradeEvent_rule0_from",
parameterType: "string",
parameterName: "ParameterName",
parameterRule: 1,
parameterRuleValue: "dummyvalue1",
},
{
enabled: true,
parameterId: "FairTradeEvent_rule0_from",
parameterType: "string",
parameterName: "ParameterName",
parameterRule: 1,
parameterRuleValue: "dummyvalue1",
},
],
webhooks:
[
{
tag: "api-micro",
key: "api-micro",
value: "https://www.mywebhook.com/callsomething/request",
type: "get",
active: true
},
{
tag: "api-micro",
key: "api-micro",
value: "https://www.mywebhook.com/callsomething/request",
type: "post",
active: true
}
]
}
]
},
],
};
Response
- Operational [200]
EventConfig { item_id: '0.0.3931201', network_id: 295, config_type: 'events', config_object: [ { eventId: '0.0.3931201_Event_1', eventName: '0.0.3931201_event_1', eventRules: [ { ruleId: "FairTradeEvent_rule0", ruleName: "FairTradeEvent Rule0", enabled: true, email_notification: false, polling_interval: 1000, parameterCollection: [ { enabled: true, parameterId: "FairTradeEvent_rule0_from", parameterType: "string", parameterName: "ParameterName", parameterRule: 1, parameterRuleValue: "dummyvalue1", }, { enabled: true, parameterId: "FairTradeEvent_rule0_from", parameterType: "string", parameterName: "ParameterName", parameterRule: 1, parameterRuleValue: "dummyvalue1", }, ], webhooks: [ { tag: "api-micro", key: "api-micro", value: "https://www.mywebhook.com/callsomething/request", type: "get", active: true }, { tag: "api-micro", key: "api-micro", value: "https://www.mywebhook.com/callsomething/request", type: "post", active: true } ] } ] }, ], };
Code Examples
cURL Examples
- cURL
- Node Js
Update Contract ABI Configuration
curl -X POST "https://api.arkhia.io/events/hedera/settings/update/contract/abi/YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "x-api-secret: YOUR_API_SECRET" \
-d '{
"scoutSettings": {
"item_id": "0.0.123456",
"network_id": 295,
"config_type": "abi",
"config_object": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
}
]
}
}'
Update Contract Events (Basic)
curl -X POST "https://api.arkhia.io/events/hedera/settings/update/contract/events/YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "x-api-secret: YOUR_API_SECRET" \
-d '{
"scoutSettings": {
"item_id": "0.0.123456",
"network_id": 295,
"config_type": "events",
"config_object": [
{
"eventId": "0.0.123456_295_TransferEvent",
"eventName": "TransferEvent"
}
]
}
}'
Update Contract Events with Webhooks and Rules
curl -X POST "https://api.arkhia.io/events/hedera/settings/update/contract/events/YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "x-api-secret: YOUR_API_SECRET" \
-d '{
"scoutSettings": {
"item_id": "0.0.123456",
"network_id": 295,
"config_type": "events",
"config_object": [
{
"eventId": "0.0.123456_295_TransferEvent",
"eventName": "TransferEvent",
"eventRules": [
{
"ruleId": "TransferEvent_rule0",
"ruleName": "Transfer Rule",
"enabled": true,
"email_notification": false,
"polling_interval": 1000,
"webhooks": [
{
"tag": "api-webhook",
"key": "webhook-key-1",
"value": "https://your-webhook-url.com/callback",
"type": "post",
"active": true
}
],
"parameterCollection": [
{
"enabled": true,
"parameterId": "TransferEvent_rule0_from",
"parameterType": "address",
"parameterName": "from",
"parameterRule": 1,
"parameterRuleValue": "0x1234567890abcdef"
}
]
}
]
}
]
}
}'
Update Account Events with Balance Monitoring
curl -X POST "https://api.arkhia.io/events/hedera/settings/update/account/balance/YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "x-api-secret: YOUR_API_SECRET" \
-d '{
"scoutSettings": {
"item_id": "0.0.801",
"network_id": 295,
"config_object": {
"cached_value": 12498289467,
"enabled": true,
"email_notification": true,
"warning_line": 0.1,
"webhooks": [
{
"tag": "balance-alert",
"key": "balance-webhook",
"value": "https://your-webhook-url.com/balance",
"type": "post",
"active": true
}
],
"rules": [
{
"enabled": true,
"parameterId": "balance-below",
"parameterName": "balance-below",
"parameterType": "integer",
"parameterRule": 4,
"parameterRuleValue": "50000"
}
]
}
}
}'
Update EthTopic Events with Complete Configuration
curl -X POST "https://api.arkhia.io/events/hedera/settings/update/ethtopic/events/YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "x-api-secret: YOUR_API_SECRET" \
-d '{
"scoutSettings": {
"item_id": "0x95890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a15",
"network_id": 295,
"config_type": "events",
"config_object": [
{
"eventId": "0x95890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a15_295_customEvent",
"eventName": "customEvent",
"eventRules": [
{
"ruleId": "customEvent_rule0",
"ruleName": "Custom Event Rule",
"enabled": true,
"email_notification": false,
"polling_interval": 1000,
"webhooks": [
{
"tag": "ethtopic-webhook",
"key": "ethtopic-key",
"value": "https://your-webhook-url.com/ethtopic",
"type": "post",
"active": true
}
],
"parameterCollection": [
{
"enabled": true,
"parameterId": "customEvent_rule0_param1",
"parameterType": "string",
"parameterName": "parameterName",
"parameterRule": 1,
"parameterRuleValue": "expected-value"
}
]
}
]
}
]
}
}'
const axios = require('axios');// Update Contract Events with Webhooksconst updateContractEvents = async () => { const restApiUrl = `https://api.arkhia.io/events/hedera/settings/update/contract/events/YOUR_API_KEY`; const apiSecret = `YOUR_API_SECRET`; const headers = { headers: { "x-api-secret": apiSecret } }; const bodyPayload = { scoutSettings: { item_id: '0.0.123456', network_id: 295, config_type: 'events', config_object: [ { eventId: '0.0.123456_295_TransferEvent', eventName: 'TransferEvent', eventRules: [ { ruleId: 'TransferEvent_rule0', ruleName: 'Transfer Rule', enabled: true, email_notification: false, polling_interval: 1000, webhooks: [ { tag: 'api-webhook', key: 'webhook-key-1', value: 'https://your-webhook-url.com/callback', type: 'post', active: true } ], parameterCollection: [ { enabled: true, parameterId: 'TransferEvent_rule0_from', parameterType: 'address', parameterName: 'from', parameterRule: 1, parameterRuleValue: '0x1234567890abcdef' } ] } ] } ] } }; try { const response = await axios.post(restApiUrl, bodyPayload, headers); return response; } catch(e) { console.error(e); }}// Update Account Balance Eventsconst updateAccountBalance = async () => { const restApiUrl = `https://api.arkhia.io/events/hedera/settings/update/account/balance/YOUR_API_KEY`; const apiSecret = `YOUR_API_SECRET`; const headers = { headers: { "x-api-secret": apiSecret } }; const bodyPayload = { scoutSettings: { item_id: '0.0.801', network_id: 295, config_object: { cached_value: 12498289467, enabled: true, email_notification: true, warning_line: 0.1, webhooks: [ { tag: 'balance-alert', key: 'balance-webhook', value: 'https://your-webhook-url.com/balance', type: 'post', active: true } ], rules: [ { enabled: true, parameterId: 'balance-below', parameterName: 'balance-below', parameterType: 'integer', parameterRule: 4, parameterRuleValue: '50000' } ] } } }; try { const response = await axios.post(restApiUrl, bodyPayload, headers); return response; } catch(e) { console.error(e); }}// Update Contract ABIconst updateContractABI = async () => { const restApiUrl = `https://api.arkhia.io/events/hedera/settings/update/contract/abi/YOUR_API_KEY`; const apiSecret = `YOUR_API_SECRET`; const headers = { headers: { "x-api-secret": apiSecret } }; const bodyPayload = { scoutSettings: { item_id: '0.0.123456', network_id: 295, config_type: 'abi', config_object: [ { anonymous: false, inputs: [ { indexed: true, internalType: 'address', name: 'from', type: 'address' }, { indexed: true, internalType: 'address', name: 'to', type: 'address' }, { indexed: false, internalType: 'uint256', name: 'value', type: 'uint256' } ], name: 'Transfer', type: 'event' } ] } }; try { const response = await axios.post(restApiUrl, bodyPayload, headers); return response; } catch(e) { console.error(e); }}