POST
/
v0
/
platform
/
categorization
/
rules
curl --request POST \
  --url https://api.sandbox.teal.dev/v0/platform/categorization/rules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "expression": "t.description == '\''SHELL GAS'\''",
  "ledger_name": "Fuel Expenses",
  "name": "Shell to Fuel Expenses",
  "priority": "100"
}'
{
  "id": "N6ntpvTtiA4L31vVyVat5n",
  "expression": "t.description == 'SHELL GAS'",
  "ledger_name": "Fuel Expenses",
  "name": "Shell to Fuel Expenses",
  "priority": "100"
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

application/json
expression
string
required

A comparative expression to match on Transactions. Use t to access the Transaction object. Must evaluate to a boolean. Accepts regex evaluations.

Read more: Categorization guide

ledger_name
string
required

The name of the destination ledger.

name
string
required

An arbitrary string to name the rule.

priority
integer
required

The priority of the rule.

Response

201
application/json
Successful Response
id
string
required

The unique ID of the object.

expression
string
required

A comparative expression to match on Transactions. Use t to access the Transaction object. Must evaluate to a boolean. Accepts regex evaluations.

Read more: Categorization guide

ledger_name
string
required

The name of the destination ledger.

name
string
required

An arbitrary string to name the rule.

priority
integer
required

The priority of the rule.