Skip to main content
POST
/
api
/
custom-rules
Create custom rule
curl --request POST \
  --url https://api.ai2fin.com/api/custom-rules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>",
  "description": "<string>",
  "entityType": "transaction",
  "conditions": [
    {
      "field": "<string>",
      "operator": "equals",
      "value": "<string>",
      "caseSensitive": true
    }
  ],
  "actions": [
    {
      "type": "set_category",
      "value": "<string>"
    }
  ],
  "priority": 0,
  "autoExecute": false
}'

Authorizations

Authorization
string
header
required

JWT token obtained from /api/auth/login endpoint

Body

application/json
name
string
required
entityType
enum<string>
required
Available options:
transaction,
bill,
expense,
billPattern,
billOccurrence
conditions
object[]
required
actions
object[]
required
description
string
priority
integer
default:0
autoExecute
boolean
default:false

Response

201

Rule created successfully