POST
/
v0
/
categorization
/
rules
curl --request POST \
  --url https://api.sandbox.teal.dev/v0/categorization/rules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'teal-instance-id: <teal-instance-id>' \
  --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.

Headers

teal-instance-id
string
required

The Teal instance ID

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

Example:

"t.description == 'SHELL GAS'"

ledger_name
string
required

The name of the destination ledger.

Example:

"Fuel Expenses"

name
string
required

An arbitrary string to name the rule.

Example:

"Shell to Fuel Expenses"

priority
integer
required

The priority of the rule.

Example:

"100"

Response

201
application/json
Successful Response
id
string
required

The unique ID of the object.

Example:

"N6ntpvTtiA4L31vVyVat5n"

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

Example:

"t.description == 'SHELL GAS'"

ledger_name
string
required

The name of the destination ledger.

Example:

"Fuel Expenses"

name
string
required

An arbitrary string to name the rule.

Example:

"Shell to Fuel Expenses"

priority
integer
required

The priority of the rule.

Example:

"100"