Skip to main content
POST
/
v1
/
rules
Create a Rule
curl --request POST \
  --url https://tracer.lerian.io/v1/rules \
  --header 'Content-Type: <content-type>' \
  --header 'X-API-Key: <x-api-key>' \
  --data '
{
  "name": "Block high-value transactions",
  "description": "Deny transactions above BRL 10,000 for card payments",
  "expression": "transaction.amount > 1000000",
  "action": "DENY",
  "scopes": [
    {
      "transactionType": "CARD"
    }
  ]
}
'
{
"ruleId": "cc1e8400-e29b-41d4-a716-446655440020",
"name": "Block high-value transactions",
"description": "Deny transactions above BRL 10,000 for card payments",
"expression": "transaction.amount > 1000000",
"action": "DENY",
"scopes": [
{
"transactionType": "CARD"
}
],
"status": "DRAFT",
"createdAt": "2026-01-30T10:00:00Z",
"updatedAt": "2026-01-30T10:00:00Z"
}

Headers

Content-Type
string
required

The type of media of the resource. Must be application/json.

X-API-Key
string
required

The API Key for authentication. This header is required for all endpoints except health checks.

X-Request-Id
string<uuid>

A unique identifier used to trace and track each request.

Body

application/json

Input for creating a new rule.

name
string
required

Human-readable rule name (must be globally unique).

Required string length: 1 - 255
expression
string
required

CEL expression that must evaluate to boolean.

Required string length: 1 - 5000
action
enum<string>
required

Action taken when rule expression evaluates to true.

Available options:
ALLOW,
DENY,
REVIEW
description
string

Rule purpose and logic explanation.

Maximum string length: 1000
scopes
object[]

Scopes that determine which transactions this rule applies to.

Maximum array length: 100

Response

Indicates that the rule was successfully created in DRAFT status.

Validation rule.

ruleId
string<uuid>

Unique identifier for the rule.

name
string

Human-readable rule name (globally unique).

Maximum string length: 255
description
string

Rule purpose and logic explanation.

Maximum string length: 1000
expression
string

CEL expression that must evaluate to boolean.

Maximum string length: 5000
action
enum<string>

Action taken when rule expression evaluates to true.

Available options:
ALLOW,
DENY,
REVIEW
scopes
object[]

Scopes that determine which transactions this rule applies to.

status
enum<string>

Rule lifecycle status.

Available options:
DRAFT,
ACTIVE,
INACTIVE,
DELETED
createdAt
string<date-time>

When the rule was created.

updatedAt
string<date-time>

When the rule was last modified.

activatedAt
string<date-time> | null

When rule was last activated (null if never activated).

deactivatedAt
string<date-time> | null

When rule was last deactivated (null if never deactivated).

deletedAt
string<date-time> | null

When rule was deleted (null if not deleted).