curl --request POST \
--url https://api.example.com/api/v1/detector \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"schemaId": 123,
"contractId": 123,
"name": "<string>",
"tags": [
"<string>"
],
"config": {},
"destinations": [
{
"tenantDestinationId": 123
}
],
"actions": [
{
"actionId": 123,
"scriptFilter": "<string>",
"scriptParams": {}
}
]
}
'import requests
url = "https://api.example.com/api/v1/detector"
payload = {
"schemaId": 123,
"contractId": 123,
"name": "<string>",
"tags": ["<string>"],
"config": {},
"destinations": [{ "tenantDestinationId": 123 }],
"actions": [
{
"actionId": 123,
"scriptFilter": "<string>",
"scriptParams": {}
}
]
}
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({
schemaId: 123,
contractId: 123,
name: '<string>',
tags: ['<string>'],
config: {},
destinations: [{tenantDestinationId: 123}],
actions: [{actionId: 123, scriptFilter: '<string>', scriptParams: {}}]
})
};
fetch('https://api.example.com/api/v1/detector', 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/detector",
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([
'schemaId' => 123,
'contractId' => 123,
'name' => '<string>',
'tags' => [
'<string>'
],
'config' => [
],
'destinations' => [
[
'tenantDestinationId' => 123
]
],
'actions' => [
[
'actionId' => 123,
'scriptFilter' => '<string>',
'scriptParams' => [
]
]
]
]),
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/detector"
payload := strings.NewReader("{\n \"schemaId\": 123,\n \"contractId\": 123,\n \"name\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"config\": {},\n \"destinations\": [\n {\n \"tenantDestinationId\": 123\n }\n ],\n \"actions\": [\n {\n \"actionId\": 123,\n \"scriptFilter\": \"<string>\",\n \"scriptParams\": {}\n }\n ]\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/detector")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"schemaId\": 123,\n \"contractId\": 123,\n \"name\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"config\": {},\n \"destinations\": [\n {\n \"tenantDestinationId\": 123\n }\n ],\n \"actions\": [\n {\n \"actionId\": 123,\n \"scriptFilter\": \"<string>\",\n \"scriptParams\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/detector")
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 \"schemaId\": 123,\n \"contractId\": 123,\n \"name\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"config\": {},\n \"destinations\": [\n {\n \"tenantDestinationId\": 123\n }\n ],\n \"actions\": [\n {\n \"actionId\": 123,\n \"scriptFilter\": \"<string>\",\n \"scriptParams\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"createdAt": 123,
"updatedAt": 123,
"schema": {
"id": 1,
"createdAt": 123,
"updatedAt": 123,
"title": "<string>",
"name": "<string>",
"version": "0.0.1",
"description": "Detector schema description example",
"author": "<string>",
"icon": "<string>",
"tags": [
"<string>"
],
"networkTags": [
"<string>"
]
},
"contractId": 123,
"name": "<string>",
"tags": [
"<string>"
],
"config": {},
"destinations": [
{
"id": 1,
"createdAt": 123,
"updatedAt": 123,
"tenantDestination": {
"id": 1,
"createdAt": 123,
"updatedAt": 123,
"tenantId": 123,
"uid": "Telegram: /start {uid}",
"tags": [],
"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,
"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/detector \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"schemaId": 123,
"contractId": 123,
"name": "<string>",
"tags": [
"<string>"
],
"config": {},
"destinations": [
{
"tenantDestinationId": 123
}
],
"actions": [
{
"actionId": 123,
"scriptFilter": "<string>",
"scriptParams": {}
}
]
}
'import requests
url = "https://api.example.com/api/v1/detector"
payload = {
"schemaId": 123,
"contractId": 123,
"name": "<string>",
"tags": ["<string>"],
"config": {},
"destinations": [{ "tenantDestinationId": 123 }],
"actions": [
{
"actionId": 123,
"scriptFilter": "<string>",
"scriptParams": {}
}
]
}
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({
schemaId: 123,
contractId: 123,
name: '<string>',
tags: ['<string>'],
config: {},
destinations: [{tenantDestinationId: 123}],
actions: [{actionId: 123, scriptFilter: '<string>', scriptParams: {}}]
})
};
fetch('https://api.example.com/api/v1/detector', 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/detector",
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([
'schemaId' => 123,
'contractId' => 123,
'name' => '<string>',
'tags' => [
'<string>'
],
'config' => [
],
'destinations' => [
[
'tenantDestinationId' => 123
]
],
'actions' => [
[
'actionId' => 123,
'scriptFilter' => '<string>',
'scriptParams' => [
]
]
]
]),
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/detector"
payload := strings.NewReader("{\n \"schemaId\": 123,\n \"contractId\": 123,\n \"name\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"config\": {},\n \"destinations\": [\n {\n \"tenantDestinationId\": 123\n }\n ],\n \"actions\": [\n {\n \"actionId\": 123,\n \"scriptFilter\": \"<string>\",\n \"scriptParams\": {}\n }\n ]\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/detector")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"schemaId\": 123,\n \"contractId\": 123,\n \"name\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"config\": {},\n \"destinations\": [\n {\n \"tenantDestinationId\": 123\n }\n ],\n \"actions\": [\n {\n \"actionId\": 123,\n \"scriptFilter\": \"<string>\",\n \"scriptParams\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/detector")
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 \"schemaId\": 123,\n \"contractId\": 123,\n \"name\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"config\": {},\n \"destinations\": [\n {\n \"tenantDestinationId\": 123\n }\n ],\n \"actions\": [\n {\n \"actionId\": 123,\n \"scriptFilter\": \"<string>\",\n \"scriptParams\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"createdAt": 123,
"updatedAt": 123,
"schema": {
"id": 1,
"createdAt": 123,
"updatedAt": 123,
"title": "<string>",
"name": "<string>",
"version": "0.0.1",
"description": "Detector schema description example",
"author": "<string>",
"icon": "<string>",
"tags": [
"<string>"
],
"networkTags": [
"<string>"
]
},
"contractId": 123,
"name": "<string>",
"tags": [
"<string>"
],
"config": {},
"destinations": [
{
"id": 1,
"createdAt": 123,
"updatedAt": 123,
"tenantDestination": {
"id": 1,
"createdAt": 123,
"updatedAt": 123,
"tenantId": 123,
"uid": "Telegram: /start {uid}",
"tags": [],
"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,
"scriptFilter": "e.severity>=0.5",
"scriptParams": {
"_to": "e.getTxHash()",
"_value": "a.getTimestamp()"
},
"actionId": 123
}
]
}Authorizations
Authentication
Body
Unique identifier of the detector config schema. Default: 'Basic' detector schema
Unique identifier of the contract associated with the extractor action
Name of the detector
Source of the detector events (Kafka topic)
ATTACK_DETECTOR, FORTA, SENTINEL Status of the entity. Default: 'ACTIVE'
ACTIVE, DISABLED, DELETED Tags of the detector
Configuration of the detector. Should match with Json schema from detector type
Show child attributes
Show child attributes
List of destinations associated with the entry
Show child attributes
Show child attributes
List of actions associated with the entry
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 detector config schema. Default: 'Basic' detector schema
Show child attributes
Show child attributes
Unique identifier of the contract associated with the extractor action
Name of the detector
Source of the detector events (Kafka topic)
ATTACK_DETECTOR, FORTA, SENTINEL Tags of the detector
Configuration of the detector. Should match with Json schema from detector type
Show child attributes
Show child attributes
List of destinations associated with the entry
Show child attributes
Show child attributes
List of actions associated with the entry
Show child attributes
Show child attributes