Looking for the previous documentation?Go to v1.docs.pluggy.ai
POST/categories/rules

Create Category Rule

Create a single category rule

Creating Category Rules just requires sending the categoryId that you can recover from the list of Categories.

Example of creating a rule:

json
{
    "description": "Mc Donalds",
    "categoryId": "11010000"
}

Request Body

required
object

Create client category rule

descriptionrequiredstring

Description of the transaction rule.

categoryIdrequiredstring

Identifier of the category

transactionTypestring

Transaction type (DEBIT/CREDIT)

accountTypestring

Account type (CHECKING_ACCOUNT/CREDIT_CARD)

matchTypestring

Type of match used to identify the rule (exact/contains/startsWith/endsWith), if not provided, defaults to 'exact'

Example

json
{
  "description": "uber payment",
  "categoryId": "05000000",
  "transactionType": "DEBIT",
  "accountType": "CHECKING_ACCOUNT"
}

Responses

200Creates a Category Rule and recover the result
object

Category rule by client id

idrequiredstring (uuid)

Identifier of the rule. Use it to delete the rule with DELETE /categories/rules/{id}.

descriptionrequiredstring

Description of the transaction rule.

categoryIdstring

Identifier of the category

categoryrequiredstring

Description of the category

clientIdstring

Identifier of the client

transactionTypestring

Transaction type (DEBIT/CREDIT)

accountTypestring

Account type (CHECKING_ACCOUNT/CREDIT_CARD)

matchTypestring

How the rule description is matched against the transaction description. Defaults to 'exact'.

exactcontainsstartsWithendsWith

Example response

json
{
  "id": "d5c3f6a2-7b1e-4f0c-9a8d-2e6b1c4f7a90",
  "description": "uber payment",
  "category": "Salary/pro-labore",
  "categoryId": "05000000",
  "clientId": "03cc0eff-4ec5-495c-adb3-1ef9611624fc",
  "transactionType": "DEBIT",
  "accountType": "CHECKING_ACCOUNT",
  "matchType": "exact"
}
curl -X POST \
'https://api.pluggy.ai/categories/rules' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: YOUR_API_KEY' \
-d '{ "description": "uber payment", "categoryId": "05000000", "transactionType": "DEBIT", "accountType": "CHECKING_ACCOUNT" }'
Sample response
{
"id": "d5c3f6a2-7b1e-4f0c-9a8d-2e6b1c4f7a90",
"description": "uber payment",
"category": "Salary/pro-labore",
"categoryId": "05000000",
"clientId": "03cc0eff-4ec5-495c-adb3-1ef9611624fc",
"transactionType": "DEBIT",
"accountType": "CHECKING_ACCOUNT",
"matchType": "exact"
}