Hanzo
OpenapiBooks

Returns the org's auto-categorization rules, highest priority first.

Returns the org's auto-categorization rules, highest priority first.

GET /v1/books/rules

Addresshttps://api.hanzo.ai/v1/books/rules
MethodGET
Operationget_books_rules
AuthAuthorization: Bearer $HANZO_API_KEY

Returns the org's auto-categorization rules, highest priority first. A rule is a standing instruction — "anything whose merchant contains X books to category Y" — and it overrides a vendor's default category, so this is the list that decides how a future bill classifies itself.

Request

1 field.

FieldInTypeRequiredDescription
sandboxquerystringSandbox reads the org's SANDBOX ledger when it is exactly "true"; anything else reads the live one.

Response

StatusBodyMeaning
200rulesOutok

200 body — 4 fields.

FieldInTypeAlwaysDescription
rulesbodyRule[]Rules is every rule the org has set, highest priority first — the order they are matched in.
rules[].categorybodystringCategory is the COA expense account a matching bill books to.
rules[].patternbodystringPattern is the merchant substring the rule matches on, case-insensitively.
rules[].prioritybodyintegerPriority breaks ties: when several patterns match, the highest wins.

Failure carries the platform error shape — see Errors.

Examples

hanzo books rules get

Books API · All Hanzo APIs · Interactive reference

How is this guide?

On this page