---
title: "Check the credit ledger invariant across all tenants (admin only)"
method: GET
path: "/v1/admin/reconciliation"
---

# Check the credit ledger invariant across all tenants (admin only)

`GET /v1/admin/reconciliation`

## Request

- Base URL: `https://api.clichefactory.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.clichefactory.com/v1/admin/reconciliation`
- Auth: none declared

``sum(grants) - sum(burns) == balance_credits``, per tenant.

Intended to run nightly. It catches every class of bug in this subsystem:
a burn that never landed, a grant written without a balance update, a
double-credited webhook. A non-empty ``drifted`` list is an alert, not a
report — investigate before the next billing close.

## Query parameters

- `include_ok` boolean: Include tenants with no drift.

## Headers

- `X-API-KEY` string, nullable

## Response `200`

Successful Response

- ReconciliationResponse: Result of the §3 invariant sweep. ``sum(grants) - sum(burns) == balance_credits``. It catches every class of bug in this subsystem: a burn that never landed, a grant written without a balance update, a double-credited webhook.
  - `checked_at` string, date-time, required
  - `drifted` ReconciliationItem[], required
    - `tenant_id` string, required
    - `granted_credits` integer, required
    - `burned_credits` integer, required
    - `expected_balance` integer, required
    - `actual_balance` integer, required
    - `drift` integer, required
    - `ok` boolean, required
  - `drifted_count` integer
  - `ok` boolean

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/clichefactory/apis/aio-server.md) · [All operations](https://skmtc.dev/clichefactory/apis/aio-server/llms.txt) · [OpenAPI document](https://skmtc.dev/clichefactory/apis/aio-server/revisions/9bd59f9bbb31?raw)
