Skip to main content
POST
/
v0
/
categorization
/
rules
Create an Instance rule
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": "<string>",
  "ledger_name": "<string>",
  "name": "<string>",
  "priority": 123
}
'
{
  "id": "<string>",
  "expression": "<string>",
  "ledger_name": "<string>",
  "name": "<string>",
  "priority": 123
}

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

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

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.