Skip to main content
POST
/
reconciliation_rules
Create a reconciliation rule
curl --request POST \
  --url https://api.endclose.com/v1/reconciliation_rules \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "reconciliation_id": "<string>",
  "filters": "<unknown>",
  "priority": 0,
  "group_by": "<unknown>",
  "cardinality": "<unknown>",
  "rollup": "<unknown>",
  "description": "<string>"
}
'
{
  "filters": {
    "rules": [
      {
        "key": "<string>",
        "value": "<string>",
        "tolerance_amount": 123,
        "transforms": {
          "key": "<unknown>",
          "value": "<unknown>"
        }
      }
    ]
  },
  "reconciliation_id": 123,
  "id": 123,
  "priority": 123,
  "group_by": [
    "<string>"
  ],
  "cardinality": "one_to_one",
  "rollup": {
    "lookback_days": 2,
    "date_field": "<string>",
    "group_by_kind": "date"
  },
  "description": "<string>",
  "sample_match_rate": "<string>",
  "created_at": "2023-11-07T05:31:56Z"
}

Authorizations

X-API-KEY
string
header
required

Body

application/json
reconciliation_id
string
required
filters
any
required
priority
integer
default:0
group_by
any
cardinality
any
rollup
any
description
string

Optional human-readable description of what this rule matches

Response

Rule created

filters
object
required

A rule tree with group nodes (AND/OR) and condition leaf nodes. Conditions compare a field on one side to a field on the other side.

reconciliation_id
integer
required
id
integer
priority
integer

Lower values run first

group_by
string[]

Side A field keys to group records by before matching. The first key is the primary axis: in rollup.group_by_kind 'date' mode it must be a date field; in 'identifier' mode it can be any field (e.g. a batch id in metadata). Additional keys further segment Side A — in date mode each segment matches only Side B records with the same value for those fields; in identifier mode they form a composite cohort key.

cardinality
enum<string>
default:one_to_one

Match cardinality. 'one_to_one' matches single records on each side. 'many_to_one' rolls up multiple records on one side to match a single record on the other side — requires the rollup field to be set.

Available options:
one_to_one,
many_to_one
rollup
object

Required when cardinality is 'many_to_one'. Configures how records on the many side are aggregated before matching.

description
string

Optional human-readable description of what this rule matches

source
enum<string>

Origin of the rule. 'user' = created manually via the API or UI. 'ai' = created by the AI rules engine. 'default' = seeded built-in rule.

Available options:
user,
ai,
default
status
enum<string>

Active rules are used by the reconciliation engine. Proposed rules are awaiting review from a cold start.

Available options:
active,
proposed
confidence
enum<string>

AI confidence rating. Only present on AI-generated rules from cold start.

Available options:
high,
medium,
low
sample_match_rate
string

How many sample records this rule matched during dry-run evaluation (e.g. '42/50'). Only present on AI-generated rules from cold start.

created_at
string<date-time>