---
title: "Backfill Transaction Types"
method: POST
path: "/api/admin/backfill-transaction-types"
tags: ["Admin"]
---

# Backfill Transaction Types

`POST /api/admin/backfill-transaction-types`

## Request

- Base URL: `https://api.earmarkiq.app` (the document declares no server; this is the origin it was published from)
- URL: `https://api.earmarkiq.app/api/admin/backfill-transaction-types`
- Auth: HTTP bearer

Backfill transaction_type and recurring_category on existing transactions.

Idempotent: skips transactions that already have transaction_type set.

Uses MerchantIntelligence for bill/subscription classification, plus
category-based fallback for the rest. Optionally runs DistilBERT for
recurring transactions not matched by MI.

Set dry_run=false to actually commit changes.

## Request body

- BackfillRequest
  - `user_id` string, nullable
  - `dry_run` boolean
  - `batch_size` integer
  - `use_ml` boolean
  - `force_reclassify` boolean

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/earmarkiq/apis/earmark-api.md) · [All operations](https://skmtc.dev/earmarkiq/apis/earmark-api/llms.txt) · [OpenAPI document](https://skmtc.dev/earmarkiq/apis/earmark-api/revisions/4a2c41907105?raw)
