POST
/
v0
/
tags
/
rules
curl --request POST \
  --url https://api.sandbox.teal.dev/v0/tags/rules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'teal-instance-id: <teal-instance-id>' \
  --data '{
  "name": "Tag gas expense",
  "tag_id": "NCB2xo5S1yQbNgyWskXpwG",
  "expression": "t.description == '\''SHELL GAS'\''",
  "priority": 10
}'
{
  "id": "yB2xokXpQb5S1NgyWsNCwG",
  "name": "Tag gas expense",
  "tag_id": "NCB2xo5S1yQbNgyWskXpwG",
  "expression": "t.description == 'SHELL GAS'",
  "priority": 10
}

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
name
string
required

An arbitrary string, useful for identifying the tag rule.

Example:

"Tag gas expense"

tag_id
string
required

If the rule finds a match, the ID of the tag that will be assigned.

Example:

"NCB2xo5S1yQbNgyWskXpwG"

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'"

priority
integer
required

The priority of the rule.

Example:

10

Response

201
application/json
Successful Response
id
string
required

The unique ID of the object.

Example:

"yB2xokXpQb5S1NgyWsNCwG"

name
string
required

An arbitrary string, useful for identifying the tag rule.

Example:

"Tag gas expense"

tag_id
string
required

If the rule finds a match, the ID of the tag that will be assigned.

Example:

"NCB2xo5S1yQbNgyWskXpwG"

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'"

priority
integer
required

The priority of the rule.

Example:

10