Create rule from import categorisation
POST
https://app.speybooks.com/api/v1/categorisation-rules/categorise-rowCreates a categorisation rule from an import preview categorisation. The backend normalises the description, extracts a keyword, and creates (or upserts) a rule with operator contains.
Optionally pass batchDescriptions with all rows in the current import batch. The endpoint returns similarRowIds — the IDs of rows whose extracted keyword matches, enabling bulk categorisation in the UI.
Emits a categorisation signal for the global aggregation pipeline.
Body parameters
description string requiredRaw transaction description from the import row. A keyword will be extracted and normalised for the rule.
targetAccountId string requiredTarget account ID (e.g. acc_4000) for this categorisation.
batchDescriptions array<object> optionalOptional: other descriptions in the current import batch. Used to find similar rows that would match the same extracted keyword.
Show child parameters
description string requiredRaw description for similarity matching.
rowId integer requiredRow index in the import batch.
Response
200 Created/upserted rule with extracted keyword, resolved account, and list of similar row IDs in the batch.
Show response fields
account objectShow child attributes
code stringid stringname stringkeyword stringnormalisedValue stringrule objectShow child attributes
action stringid integername stringsimilarRowIds array<integer>Error codes
400 Invalid input: missing description or target account ID.
404 Target account not found.