AI account cleanup suggestions

POST /api/v1/ledgers/suggest-cleanup

Get AI-powered suggestions for chart of accounts cleanup. Read-only; rate limited per user and gated on monthly AI quota.

Operation ID: suggest_cleanup_api_v1_ledgers_suggest_cleanup_post · View as markdown · OpenAPI slice

Authentication

Bearer token authentication. Pass your DayZero API token in the Authorization header and the target business UUID in x-business-id.

Responses

200 Successful Response

suggestions array · AccountCleanupSuggestionItem AccountCleanupSuggestionItem
6 fields
type string required

Kind of suggestion: merge, cleanup, reclassify, or unused.

One of: merge, cleanup, reclassify, unused

title string required

Short headline (<=80 chars).

description string required

Explanation of the suggestion (<=240 chars).

affected_accounts array · string

Display names of the accounts affected.

affected_ledger_ids array · string

Resolved ledger UUIDs for the affected accounts. Use these when taking action (e.g. calling /ledgers/merge).

suggested_target_ledger_id string

For 'merge' suggestions, the recommended target ledger UUID to merge the others into. Null for non-merge suggestions.

cached boolean

True if the response was served from short-TTL cache.

401 Unauthorized - Authentication required

403 Forbidden - Insufficient permissions

422 Validation Error

detail array · ValidationError ValidationError
5 fields
loc array · string | integer required
msg string required
type string required
input object
ctx object

429 Too Many Requests - Rate limit exceeded