Create a new fraud rule
curl --request POST \
--url https://tracer.sandbox.lerian.net/v1/rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '"<string>"'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://tracer.sandbox.lerian.net/v1/rules"
payload := strings.NewReader("\"<string>\"")
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))
}const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify('<string>')
};
fetch('https://tracer.sandbox.lerian.net/v1/rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://tracer.sandbox.lerian.net/v1/rules"
payload = "<string>"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"action": "DENY",
"createdAt": "2021-01-01T00:00:00Z",
"expression": "transaction.amount > 1000 && account.type == 'checking'",
"name": "Block high-value checking transactions",
"ruleId": "00000000-0000-0000-0000-000000000000",
"scopes": [
{
"accountId": "00000000-0000-0000-0000-000000000000",
"merchantId": "00000000-0000-0000-0000-000000000000",
"portfolioId": "00000000-0000-0000-0000-000000000000",
"segmentId": "00000000-0000-0000-0000-000000000000",
"subType": "purchase",
"transactionType": "CARD"
}
],
"status": "ACTIVE",
"updatedAt": "2021-01-01T00:00:00Z",
"activatedAt": "2021-01-01T00:00:00Z",
"deactivatedAt": "2021-01-01T00:00:00Z",
"deletedAt": "2021-01-01T00:00:00Z",
"description": "Denies transactions over $1000 from checking accounts"
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}Create a new fraud rule
Use this endpoint to create a fraud rule with a CEL expression and scopes array. Rules are always created in DRAFT status. Use the activate endpoint to start evaluation.
POST
/
v1
/
rules
Create a new fraud rule
curl --request POST \
--url https://tracer.sandbox.lerian.net/v1/rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '"<string>"'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://tracer.sandbox.lerian.net/v1/rules"
payload := strings.NewReader("\"<string>\"")
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))
}const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify('<string>')
};
fetch('https://tracer.sandbox.lerian.net/v1/rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://tracer.sandbox.lerian.net/v1/rules"
payload = "<string>"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"action": "DENY",
"createdAt": "2021-01-01T00:00:00Z",
"expression": "transaction.amount > 1000 && account.type == 'checking'",
"name": "Block high-value checking transactions",
"ruleId": "00000000-0000-0000-0000-000000000000",
"scopes": [
{
"accountId": "00000000-0000-0000-0000-000000000000",
"merchantId": "00000000-0000-0000-0000-000000000000",
"portfolioId": "00000000-0000-0000-0000-000000000000",
"segmentId": "00000000-0000-0000-0000-000000000000",
"subType": "purchase",
"transactionType": "CARD"
}
],
"status": "ACTIVE",
"updatedAt": "2021-01-01T00:00:00Z",
"activatedAt": "2021-01-01T00:00:00Z",
"deactivatedAt": "2021-01-01T00:00:00Z",
"deletedAt": "2021-01-01T00:00:00Z",
"description": "Denies transactions over $1000 from checking accounts"
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}Authorizations
BearerAuthApiKeyAuth
JWT bearer token issued by the identity provider.
Body
application/json
The body is of type file.
Response
Created
Example:
"DENY"
Example:
"2021-01-01T00:00:00Z"
Example:
"transaction.amount > 1000 && account.type == 'checking'"
Maximum string length:
255Example:
"Block high-value checking transactions"
Example:
"00000000-0000-0000-0000-000000000000"
Show child attributes
Show child attributes
Example:
"ACTIVE"
Example:
"2021-01-01T00:00:00Z"
Example:
"2021-01-01T00:00:00Z"
Example:
"2021-01-01T00:00:00Z"
Example:
"2021-01-01T00:00:00Z"
Example:
"Denies transactions over $1000 from checking accounts"
Was this page helpful?

