Create new rule
curl --request POST \
--url https://api.dataspike.io/api/v3/transmon/rules \
--header 'Content-Type: application/json' \
--header 'ds-api-token: <api-key>' \
--data '
{
"name": "limit price for new users",
"status": "active",
"event_type": "payment_pre",
"rank": 20,
"expression": "event.user_ds_registration == 0 && event.checkout_price > 1000",
"causes": [
"TST",
"HI_PR"
],
"action": "reject"
}
'import requests
url = "https://api.dataspike.io/api/v3/transmon/rules"
payload = {
"name": "limit price for new users",
"status": "active",
"event_type": "payment_pre",
"rank": 20,
"expression": "event.user_ds_registration == 0 && event.checkout_price > 1000",
"causes": ["TST", "HI_PR"],
"action": "reject"
}
headers = {
"ds-api-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'ds-api-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'limit price for new users',
status: 'active',
event_type: 'payment_pre',
rank: 20,
expression: 'event.user_ds_registration == 0 && event.checkout_price > 1000',
causes: ['TST', 'HI_PR'],
action: 'reject'
})
};
fetch('https://api.dataspike.io/api/v3/transmon/rules', 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.dataspike.io/api/v3/transmon/rules",
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([
'name' => 'limit price for new users',
'status' => 'active',
'event_type' => 'payment_pre',
'rank' => 20,
'expression' => 'event.user_ds_registration == 0 && event.checkout_price > 1000',
'causes' => [
'TST',
'HI_PR'
],
'action' => 'reject'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"ds-api-token: <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://api.dataspike.io/api/v3/transmon/rules"
payload := strings.NewReader("{\n \"name\": \"limit price for new users\",\n \"status\": \"active\",\n \"event_type\": \"payment_pre\",\n \"rank\": 20,\n \"expression\": \"event.user_ds_registration == 0 && event.checkout_price > 1000\",\n \"causes\": [\n \"TST\",\n \"HI_PR\"\n ],\n \"action\": \"reject\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("ds-api-token", "<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.post("https://api.dataspike.io/api/v3/transmon/rules")
.header("ds-api-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"limit price for new users\",\n \"status\": \"active\",\n \"event_type\": \"payment_pre\",\n \"rank\": 20,\n \"expression\": \"event.user_ds_registration == 0 && event.checkout_price > 1000\",\n \"causes\": [\n \"TST\",\n \"HI_PR\"\n ],\n \"action\": \"reject\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dataspike.io/api/v3/transmon/rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["ds-api-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"limit price for new users\",\n \"status\": \"active\",\n \"event_type\": \"payment_pre\",\n \"rank\": 20,\n \"expression\": \"event.user_ds_registration == 0 && event.checkout_price > 1000\",\n \"causes\": [\n \"TST\",\n \"HI_PR\"\n ],\n \"action\": \"reject\"\n}"
response = http.request(request)
puts response.read_body"f81d4fae-7dec-11d0-a765-00a0c91e6bf6"<string>Transaction monitoring API
Create new rule
Create new rule
POST
/
api
/
v3
/
transmon
/
rules
Create new rule
curl --request POST \
--url https://api.dataspike.io/api/v3/transmon/rules \
--header 'Content-Type: application/json' \
--header 'ds-api-token: <api-key>' \
--data '
{
"name": "limit price for new users",
"status": "active",
"event_type": "payment_pre",
"rank": 20,
"expression": "event.user_ds_registration == 0 && event.checkout_price > 1000",
"causes": [
"TST",
"HI_PR"
],
"action": "reject"
}
'import requests
url = "https://api.dataspike.io/api/v3/transmon/rules"
payload = {
"name": "limit price for new users",
"status": "active",
"event_type": "payment_pre",
"rank": 20,
"expression": "event.user_ds_registration == 0 && event.checkout_price > 1000",
"causes": ["TST", "HI_PR"],
"action": "reject"
}
headers = {
"ds-api-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'ds-api-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'limit price for new users',
status: 'active',
event_type: 'payment_pre',
rank: 20,
expression: 'event.user_ds_registration == 0 && event.checkout_price > 1000',
causes: ['TST', 'HI_PR'],
action: 'reject'
})
};
fetch('https://api.dataspike.io/api/v3/transmon/rules', 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.dataspike.io/api/v3/transmon/rules",
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([
'name' => 'limit price for new users',
'status' => 'active',
'event_type' => 'payment_pre',
'rank' => 20,
'expression' => 'event.user_ds_registration == 0 && event.checkout_price > 1000',
'causes' => [
'TST',
'HI_PR'
],
'action' => 'reject'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"ds-api-token: <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://api.dataspike.io/api/v3/transmon/rules"
payload := strings.NewReader("{\n \"name\": \"limit price for new users\",\n \"status\": \"active\",\n \"event_type\": \"payment_pre\",\n \"rank\": 20,\n \"expression\": \"event.user_ds_registration == 0 && event.checkout_price > 1000\",\n \"causes\": [\n \"TST\",\n \"HI_PR\"\n ],\n \"action\": \"reject\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("ds-api-token", "<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.post("https://api.dataspike.io/api/v3/transmon/rules")
.header("ds-api-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"limit price for new users\",\n \"status\": \"active\",\n \"event_type\": \"payment_pre\",\n \"rank\": 20,\n \"expression\": \"event.user_ds_registration == 0 && event.checkout_price > 1000\",\n \"causes\": [\n \"TST\",\n \"HI_PR\"\n ],\n \"action\": \"reject\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dataspike.io/api/v3/transmon/rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["ds-api-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"limit price for new users\",\n \"status\": \"active\",\n \"event_type\": \"payment_pre\",\n \"rank\": 20,\n \"expression\": \"event.user_ds_registration == 0 && event.checkout_price > 1000\",\n \"causes\": [\n \"TST\",\n \"HI_PR\"\n ],\n \"action\": \"reject\"\n}"
response = http.request(request)
puts response.read_body"f81d4fae-7dec-11d0-a765-00a0c91e6bf6"<string>Body
application/json
New rule definition
The type of event should be processed with (transaction/payment) and when ("pre" - before AML/Anti-fraud checks, "post" - after). For example, "payment_pre" rule will be used for payments only and before AML/Anti-fraud checks
Available options:
transaction_pre, transaction_post, payment_pre, payment_post Example:
"payment_pre"
Response
Created rule ID
UUID of created rule
Example:
"f81d4fae-7dec-11d0-a765-00a0c91e6bf6"