curl --request POST \
--url https://api.example.com/api/v1/trigger \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contractId": 123,
"alerts": [
{
"name": "Suspicious interaction",
"message": "This is a critical alert message",
"destinations": [
{
"tenantDestinationId": 123
}
],
"actions": [
{
"actionId": 123,
"scriptFilter": "<string>",
"scriptParams": {}
}
]
}
],
"name": "<string>",
"config": {
"blacklist": [
"0xd6dfD811E06267b25472753c4e57C0B28652bFB8"
]
},
"actions": [
"PAUSE"
],
"txParams": {}
}
'import requests
url = "https://api.example.com/api/v1/trigger"
payload = {
"contractId": 123,
"alerts": [
{
"name": "Suspicious interaction",
"message": "This is a critical alert message",
"destinations": [{ "tenantDestinationId": 123 }],
"actions": [
{
"actionId": 123,
"scriptFilter": "<string>",
"scriptParams": {}
}
]
}
],
"name": "<string>",
"config": { "blacklist": ["0xd6dfD811E06267b25472753c4e57C0B28652bFB8"] },
"actions": ["PAUSE"],
"txParams": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contractId: 123,
alerts: [
{
name: 'Suspicious interaction',
message: 'This is a critical alert message',
destinations: [{tenantDestinationId: 123}],
actions: [{actionId: 123, scriptFilter: '<string>', scriptParams: {}}]
}
],
name: '<string>',
config: {blacklist: ['0xd6dfD811E06267b25472753c4e57C0B28652bFB8']},
actions: ['PAUSE'],
txParams: {}
})
};
fetch('https://api.example.com/api/v1/trigger', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/trigger",
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([
'contractId' => 123,
'alerts' => [
[
'name' => 'Suspicious interaction',
'message' => 'This is a critical alert message',
'destinations' => [
[
'tenantDestinationId' => 123
]
],
'actions' => [
[
'actionId' => 123,
'scriptFilter' => '<string>',
'scriptParams' => [
]
]
]
]
],
'name' => '<string>',
'config' => [
'blacklist' => [
'0xd6dfD811E06267b25472753c4e57C0B28652bFB8'
]
],
'actions' => [
'PAUSE'
],
'txParams' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.example.com/api/v1/trigger"
payload := strings.NewReader("{\n \"contractId\": 123,\n \"alerts\": [\n {\n \"name\": \"Suspicious interaction\",\n \"message\": \"This is a critical alert message\",\n \"destinations\": [\n {\n \"tenantDestinationId\": 123\n }\n ],\n \"actions\": [\n {\n \"actionId\": 123,\n \"scriptFilter\": \"<string>\",\n \"scriptParams\": {}\n }\n ]\n }\n ],\n \"name\": \"<string>\",\n \"config\": {\n \"blacklist\": [\n \"0xd6dfD811E06267b25472753c4e57C0B28652bFB8\"\n ]\n },\n \"actions\": [\n \"PAUSE\"\n ],\n \"txParams\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.example.com/api/v1/trigger")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contractId\": 123,\n \"alerts\": [\n {\n \"name\": \"Suspicious interaction\",\n \"message\": \"This is a critical alert message\",\n \"destinations\": [\n {\n \"tenantDestinationId\": 123\n }\n ],\n \"actions\": [\n {\n \"actionId\": 123,\n \"scriptFilter\": \"<string>\",\n \"scriptParams\": {}\n }\n ]\n }\n ],\n \"name\": \"<string>\",\n \"config\": {\n \"blacklist\": [\n \"0xd6dfD811E06267b25472753c4e57C0B28652bFB8\"\n ]\n },\n \"actions\": [\n \"PAUSE\"\n ],\n \"txParams\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/trigger")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contractId\": 123,\n \"alerts\": [\n {\n \"name\": \"Suspicious interaction\",\n \"message\": \"This is a critical alert message\",\n \"destinations\": [\n {\n \"tenantDestinationId\": 123\n }\n ],\n \"actions\": [\n {\n \"actionId\": 123,\n \"scriptFilter\": \"<string>\",\n \"scriptParams\": {}\n }\n ]\n }\n ],\n \"name\": \"<string>\",\n \"config\": {\n \"blacklist\": [\n \"0xd6dfD811E06267b25472753c4e57C0B28652bFB8\"\n ]\n },\n \"actions\": [\n \"PAUSE\"\n ],\n \"txParams\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"createdAt": 123,
"updatedAt": 123,
"status": "ACTIVE",
"contractId": 123,
"interceptorId": 123,
"type": "BLACKLISTED_CALLERS",
"name": "<string>",
"config": {
"blacklist": [
"0xd6dfD811E06267b25472753c4e57C0B28652bFB8"
]
},
"actions": [
"PAUSE"
],
"alerts": [
{
"id": 1,
"createdAt": 123,
"updatedAt": 123,
"status": "ACTIVE",
"severity": "INFO",
"name": "Suspicious interaction",
"message": "This is a critical alert message",
"destinations": [
{
"id": 1,
"createdAt": 123,
"updatedAt": 123,
"status": "ACTIVE",
"tenantDestination": {
"id": 1,
"createdAt": 123,
"updatedAt": 123,
"tenantId": 123,
"type": "EMAIL",
"uid": "Telegram: /start {uid}",
"tags": [
"DEFAULT"
],
"value": "<string>",
"telegramBotUsername": "<string>",
"telegramUserId": "<string>",
"telegramUsername": "<string>",
"telegramChatId": "<string>",
"telegramChatTitle": "<string>",
"telegramChatType": "<string>",
"slackUri": "<string>",
"slackChannelId": "<string>",
"slackChannelName": "<string>",
"uri": "<string>",
"method": "<string>",
"headers": {}
}
}
],
"actions": [
{
"id": 1,
"createdAt": 123,
"updatedAt": 123,
"status": "ACTIVE",
"scriptFilter": "e.severity>=0.5",
"scriptParams": {
"_to": "e.getTxHash()",
"_value": "a.getTimestamp()"
},
"actionId": 123
}
]
}
]
}create entity
curl --request POST \
--url https://api.example.com/api/v1/trigger \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contractId": 123,
"alerts": [
{
"name": "Suspicious interaction",
"message": "This is a critical alert message",
"destinations": [
{
"tenantDestinationId": 123
}
],
"actions": [
{
"actionId": 123,
"scriptFilter": "<string>",
"scriptParams": {}
}
]
}
],
"name": "<string>",
"config": {
"blacklist": [
"0xd6dfD811E06267b25472753c4e57C0B28652bFB8"
]
},
"actions": [
"PAUSE"
],
"txParams": {}
}
'import requests
url = "https://api.example.com/api/v1/trigger"
payload = {
"contractId": 123,
"alerts": [
{
"name": "Suspicious interaction",
"message": "This is a critical alert message",
"destinations": [{ "tenantDestinationId": 123 }],
"actions": [
{
"actionId": 123,
"scriptFilter": "<string>",
"scriptParams": {}
}
]
}
],
"name": "<string>",
"config": { "blacklist": ["0xd6dfD811E06267b25472753c4e57C0B28652bFB8"] },
"actions": ["PAUSE"],
"txParams": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contractId: 123,
alerts: [
{
name: 'Suspicious interaction',
message: 'This is a critical alert message',
destinations: [{tenantDestinationId: 123}],
actions: [{actionId: 123, scriptFilter: '<string>', scriptParams: {}}]
}
],
name: '<string>',
config: {blacklist: ['0xd6dfD811E06267b25472753c4e57C0B28652bFB8']},
actions: ['PAUSE'],
txParams: {}
})
};
fetch('https://api.example.com/api/v1/trigger', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/trigger",
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([
'contractId' => 123,
'alerts' => [
[
'name' => 'Suspicious interaction',
'message' => 'This is a critical alert message',
'destinations' => [
[
'tenantDestinationId' => 123
]
],
'actions' => [
[
'actionId' => 123,
'scriptFilter' => '<string>',
'scriptParams' => [
]
]
]
]
],
'name' => '<string>',
'config' => [
'blacklist' => [
'0xd6dfD811E06267b25472753c4e57C0B28652bFB8'
]
],
'actions' => [
'PAUSE'
],
'txParams' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.example.com/api/v1/trigger"
payload := strings.NewReader("{\n \"contractId\": 123,\n \"alerts\": [\n {\n \"name\": \"Suspicious interaction\",\n \"message\": \"This is a critical alert message\",\n \"destinations\": [\n {\n \"tenantDestinationId\": 123\n }\n ],\n \"actions\": [\n {\n \"actionId\": 123,\n \"scriptFilter\": \"<string>\",\n \"scriptParams\": {}\n }\n ]\n }\n ],\n \"name\": \"<string>\",\n \"config\": {\n \"blacklist\": [\n \"0xd6dfD811E06267b25472753c4e57C0B28652bFB8\"\n ]\n },\n \"actions\": [\n \"PAUSE\"\n ],\n \"txParams\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.example.com/api/v1/trigger")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contractId\": 123,\n \"alerts\": [\n {\n \"name\": \"Suspicious interaction\",\n \"message\": \"This is a critical alert message\",\n \"destinations\": [\n {\n \"tenantDestinationId\": 123\n }\n ],\n \"actions\": [\n {\n \"actionId\": 123,\n \"scriptFilter\": \"<string>\",\n \"scriptParams\": {}\n }\n ]\n }\n ],\n \"name\": \"<string>\",\n \"config\": {\n \"blacklist\": [\n \"0xd6dfD811E06267b25472753c4e57C0B28652bFB8\"\n ]\n },\n \"actions\": [\n \"PAUSE\"\n ],\n \"txParams\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/trigger")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contractId\": 123,\n \"alerts\": [\n {\n \"name\": \"Suspicious interaction\",\n \"message\": \"This is a critical alert message\",\n \"destinations\": [\n {\n \"tenantDestinationId\": 123\n }\n ],\n \"actions\": [\n {\n \"actionId\": 123,\n \"scriptFilter\": \"<string>\",\n \"scriptParams\": {}\n }\n ]\n }\n ],\n \"name\": \"<string>\",\n \"config\": {\n \"blacklist\": [\n \"0xd6dfD811E06267b25472753c4e57C0B28652bFB8\"\n ]\n },\n \"actions\": [\n \"PAUSE\"\n ],\n \"txParams\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"createdAt": 123,
"updatedAt": 123,
"status": "ACTIVE",
"contractId": 123,
"interceptorId": 123,
"type": "BLACKLISTED_CALLERS",
"name": "<string>",
"config": {
"blacklist": [
"0xd6dfD811E06267b25472753c4e57C0B28652bFB8"
]
},
"actions": [
"PAUSE"
],
"alerts": [
{
"id": 1,
"createdAt": 123,
"updatedAt": 123,
"status": "ACTIVE",
"severity": "INFO",
"name": "Suspicious interaction",
"message": "This is a critical alert message",
"destinations": [
{
"id": 1,
"createdAt": 123,
"updatedAt": 123,
"status": "ACTIVE",
"tenantDestination": {
"id": 1,
"createdAt": 123,
"updatedAt": 123,
"tenantId": 123,
"type": "EMAIL",
"uid": "Telegram: /start {uid}",
"tags": [
"DEFAULT"
],
"value": "<string>",
"telegramBotUsername": "<string>",
"telegramUserId": "<string>",
"telegramUsername": "<string>",
"telegramChatId": "<string>",
"telegramChatTitle": "<string>",
"telegramChatType": "<string>",
"slackUri": "<string>",
"slackChannelId": "<string>",
"slackChannelName": "<string>",
"uri": "<string>",
"method": "<string>",
"headers": {}
}
}
],
"actions": [
{
"id": 1,
"createdAt": 123,
"updatedAt": 123,
"status": "ACTIVE",
"scriptFilter": "e.severity>=0.5",
"scriptParams": {
"_to": "e.getTxHash()",
"_value": "a.getTimestamp()"
},
"actionId": 123
}
]
}
]
}Authorizations
Authentication
Body
Unique identifier of the contract
Type of the trigger
BLACKLISTED_CALLERS, WHITELIST_CALLERS, FAILED_TRANSACTIONS, FUNCTION_CALL, EVENT_EMITTED, EVENT_EMITTED_ADVANCED, ERC20_TRANSFER, TRANSACTION_PARAMS, VALUE_TRANSFER, EVENT_PARAMS, OPERATION_PARAMS Status of the entity. Default: 'ACTIVE'
ACTIVE, DISABLED, DELETED List of alerts associated with the entry
Show child attributes
Show child attributes
Name of the trigger
Configuration details for the trigger. Examples by type:
ERC20_TRANSFER: {"token":"0xdac17f958d2ee523a2206206994597c13d831ec7","funcName":"Transfer","params":[{"name":"from","operator":"==","value":"0xd6dfD811E06267b25472753c4e57C0B28652bFB8"},{"name":"to","operator":"==","value":"0x3018018c44338b9728d02be12d632c6691e020d1"},{"name":"value","operator":">","value":"249000000"}]}
BLACKLISTED_CALLERS: {"blacklist":["0xd6dfD811E06267b25472753c4e57C0B28652bFB8","0x3018018c44338b9728d02be12d632c6691e020d1","0xd06678bc9550333b7832b7900cb7bca5cecbf787"]}
WHITELIST_CALLERS: {"whitelist":["0xd6dfD811E06267b25472753c4e57C0B28652bFB8","0x3018018c44338b9728d02be12d632c6691e020d1","0xd06678bc9550333b7832b7900cb7bca5cecbf787"]}
FAILED_TRANSACTIONS: {} or null
FUNCTION_CALL: {"funcName":"approve","params":[{"name":"_spender","operator":"==","value":"0x3018018c44338b9728d02be12d632c6691e020d1"},{"name":"_value","operator":">","value":"10"},{"name":"_value","operator":">","value":"1000"},{"name":"_value","operator":">","value":"1000000"}],"txParams":{"param":{"name":"value","operator":">","value":"100"}}}
EVENT_EMITTED: {"funcName":"Approval","params":[{"name":"owner","operator":"==","value":"0xd06678bc9550333b7832b7900cb7bca5cecbf787"},{"name":"spender","operator":"==","value":"0x3018018c44338b9728d02be12d632c6691e020d1"},{"name":"value","operator":">","value":"10"},{"name":"value","operator":">","value":"1000"},{"name":"value","operator":">","value":"1000000"}]}
TRANSACTION_PARAMS: {"operator":"AND","params":[{"operator":"OR","params":[{"param":{"name":"from_address","operator":"==","value":"or1"}},{"param":{"name":"receipt_status","operator":">","value":"1"}}]},{"param":{"name":"value","operator":"<=","value":"1000"}},{"param":{"name":"block.miner","operator":"!=","value":"qweqwe"}}]}
Show child attributes
Show child attributes
{
"blacklist": [
"0xd6dfD811E06267b25472753c4e57C0B28652bFB8"
]
}
Action that should be executed by the user for this trigger
["PAUSE"]
Optional. Transaction-level filter config. Will be merged into config.txParams and persisted.
Show child attributes
Show child attributes
Response
OK
Unique identifier of the entity
1
Time when entity was created
Time when entity was updated
Status of the entity. Default: 'ACTIVE'
ACTIVE, DISABLED, DELETED Unique identifier of the contract
Unique identifier of the interceptor from haas-interceptor service
Type of the trigger
BLACKLISTED_CALLERS, WHITELIST_CALLERS, FAILED_TRANSACTIONS, FUNCTION_CALL, EVENT_EMITTED, EVENT_EMITTED_ADVANCED, ERC20_TRANSFER, TRANSACTION_PARAMS, VALUE_TRANSFER, EVENT_PARAMS, OPERATION_PARAMS Name of the trigger
Configuration details for the trigger. Examples by type:
ERC20_TRANSFER: {"token":"0xdac17f958d2ee523a2206206994597c13d831ec7","funcName":"Transfer","params":[{"name":"from","operator":"==","value":"0xd6dfD811E06267b25472753c4e57C0B28652bFB8"},{"name":"to","operator":"==","value":"0x3018018c44338b9728d02be12d632c6691e020d1"},{"name":"value","operator":">","value":"249000000"}]}
BLACKLISTED_CALLERS: {"blacklist":["0xd6dfD811E06267b25472753c4e57C0B28652bFB8","0x3018018c44338b9728d02be12d632c6691e020d1","0xd06678bc9550333b7832b7900cb7bca5cecbf787"]}
WHITELIST_CALLERS: {"whitelist":["0xd6dfD811E06267b25472753c4e57C0B28652bFB8","0x3018018c44338b9728d02be12d632c6691e020d1","0xd06678bc9550333b7832b7900cb7bca5cecbf787"]}
FAILED_TRANSACTIONS: {} or null
FUNCTION_CALL: {"funcName":"approve","params":[{"name":"_spender","operator":"==","value":"0x3018018c44338b9728d02be12d632c6691e020d1"},{"name":"_value","operator":">","value":"10"},{"name":"_value","operator":">","value":"1000"},{"name":"_value","operator":">","value":"1000000"}],"txParams":{"param":{"name":"value","operator":">","value":"100"}}}
EVENT_EMITTED: {"funcName":"Approval","params":[{"name":"owner","operator":"==","value":"0xd06678bc9550333b7832b7900cb7bca5cecbf787"},{"name":"spender","operator":"==","value":"0x3018018c44338b9728d02be12d632c6691e020d1"},{"name":"value","operator":">","value":"10"},{"name":"value","operator":">","value":"1000"},{"name":"value","operator":">","value":"1000000"}]}
TRANSACTION_PARAMS: {"operator":"AND","params":[{"operator":"OR","params":[{"param":{"name":"from_address","operator":"==","value":"or1"}},{"param":{"name":"receipt_status","operator":">","value":"1"}}]},{"param":{"name":"value","operator":"<=","value":"1000"}},{"param":{"name":"block.miner","operator":"!=","value":"qweqwe"}}]}
Show child attributes
Show child attributes
{
"blacklist": [
"0xd6dfD811E06267b25472753c4e57C0B28652bFB8"
]
}
Action that should be executed by the user for this trigger
["PAUSE"]
List of alerts associated with the entry
Show child attributes
Show child attributes