---
title: "Historical Transaction Enrichment"
method: POST
path: "/cleanup"
tags: ["Enrichment"]
---

# Historical Transaction Enrichment

`POST /cleanup`

The historical transaction enrichment endpoint is designed for enriching a large number of transactions. It is optimized to handle substantial payloads and efficiently process large backlogs of data.

This endpoint is asynchronous. A webhook will be sent to the provided URL when a batch of transactions has been enriched.
    
To maximize throughput for this endpoint, follow these guidelines: 
  - Group transactions by `uid` and include all transactions for a single `uid` in the same payload.
  - Limit each request to approximately 1,000 transactions. The payload can include multiple uids.

## Request body

- CleanupPostRequest
  - `transactions` object[], required
    - `accountType` 'checking' | 'savings' | 'creditCard', required — The type of account associated with the transaction. For transactions from loan accounts, use 'savings'.
    - `amountnum` number, required — The transaction amount in USD. Negative amounts are automatically converted to positive amounts. Use the 'settlement' field to indicate whether the transaction was a 'debit' or 'credit'. The string representation of amount must be fewer than 11 characters.
    - `date` string, date, required — The date of the transaction. Must be in the format 'YYYY-MM-DD'.
    - `identifiers` object — A JSON representation of alternative user IDs. This field is designed exclusively for users with Banno, Salesforce, or other CRM integrations. Valid identifiers are currently limited to [`sfmc_contact_id`, `banno_end_user_id`].
      - `sfmc_contact_id` string
      - `banno_end_user_id` string
    - `original_description` string, required — The transaction's description. Must be between 3 and 198 characters. Descriptions longer than 198 characters are automatically truncated. For transactions from loan accounts, prepend `LOANTRANS-` to this field.
    - `transactionid` string, required — A unique identifier for the transaction. Do not use PII or other information-rich data in this field. We strongly recommend using UUID or a similar identification system.
    - `settlement` 'debit' | 'credit', required — Indicates whether the transaction was a 'debit' or 'credit' to the account.
    - `uid` string, required — The ID of the user associated with the transaction. User IDs must be unique. Do not use PII or other information-rich data in this field. We strongly recommend using UUID or a similar identification system.
    - `accountid` string — The account ID associated with the transaction. This field is optional and will not affect enrichment results. Do not use the actual account number. We strongly recommend using UUID or a similar identification system.

## Response `200`

Success

- CleanupPost200Response
  - `transactions_received` boolean — Denotes whether FinSight API has successfully received the transactions.
  - `transactions_validated` boolean — Denotes whether or not the transaction payload successfully passed FinSight API validation.
  - `processing` boolean — Denotes whether the asynchronous enrichment process has commenced.
  - `num_transactions_processing` integer — The number of transactions that have been received.
  - `batch_request_id` string — A unique ID associated with the request for debugging.

## Other responses

- `400` — Bad request. An array of errors in the data will be returned. Fields not allowed or incorrectly formatted will be noted.
- `401` — Unauthorized

---

[API](https://skmtc.dev/fingoal/apis/insights-api.md) · [All operations](https://skmtc.dev/fingoal/apis/insights-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/fingoal/insights-api/revisions/00cf4dbd5441/schema)
