Skip to main content
POST
/
v0
/
platform
/
categorization
/
rules
Create a Platform rule
curl --request POST \
  --url https://api.sandbox.teal.dev/v0/platform/categorization/rules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "expression": "<string>",
  "ledger_name": "<string>",
  "name": "<string>",
  "priority": 123
}
'
{
  "id": "<string>",
  "expression": "<string>",
  "ledger_name": "<string>",
  "name": "<string>",
  "priority": 123
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

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

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"