> ## Documentation Index
> Fetch the complete documentation index at: https://docs.command.cleargrid.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Changelog

> Versioned changes to the data exports API

This page tracks changes to the data exports API. Additive changes (new datasets, new fields, new optional query parameters) stay on the same schema version. Breaking changes — renames, removals, semantic shifts — land at a new endpoint version (e.g. `/exports/v2/...`) so existing pipelines continue to work unchanged.

<Note>
  This changelog is included in the docs site's `llms.txt`, so AI tooling consuming the API can detect changes automatically.
</Note>

## v1.2 — 2026-06-11

### Added

* Activated 9 datasets that previously appeared in the catalog as `available: false`:
  * **S1 Customers & Accounts:** [`D01` Borrowers](/api-reference/exports/datasets/d01-borrowers), [`D02` Borrower Accounts](/api-reference/exports/datasets/d02-borrower-accounts), [`D03` Borrower Sub Accounts](/api-reference/exports/datasets/d03-borrower-sub-accounts), [`D05` Borrower Account Events](/api-reference/exports/datasets/d05-borrower-account-events).
  * **S3 Collections Cases:** [`D16` Borrower Deals](/api-reference/exports/datasets/d16-borrower-deals), [`D17` Borrower Deal Activity Logs](/api-reference/exports/datasets/d17-borrower-deal-activity-logs), [`D18` Borrower Deal Logs](/api-reference/exports/datasets/d18-borrower-deal-logs), [`D19` Deal Activity Logs](/api-reference/exports/datasets/d19-deal-activity-logs), [`D20` Deal Views](/api-reference/exports/datasets/d20-deal-views).
* `public_id` field exposed on the newly activated datasets that lacked one (`D03`, `D17`, `D18`, `D19`, `D20`) — string-cast Mongo `_id`, the same convention as the v1.1 additions to `D15`/`D21`/`D22`/`D23`. `D05` exposes its native `public_id`.

### Changed

* **`D01` Borrowers and `D02` Borrower Accounts** — the per-row identifier is now exposed as `public_id` sourced from the string-cast Mongo `_id`. (Earlier internal drafts surfaced a business identifier; the shipped field is the `_id`-derived value.)
* **`D16` Borrower Deals** — the per-row identifier is now exposed as `public_id` (previously `case_public_id`, while `D16` was unavailable). The underlying value is unchanged — it's still `user_lender_detail_public_id` from the source — only the response field name is now consistent with the rest of the API. Note this is the case/link id and may not be unique per deal row; see the [dataset page](/api-reference/exports/datasets/d16-borrower-deals). If you wrote a client against an internal preview that used `case_public_id`, rename the column in your warehouse mapping.
* **`D01` Borrowers** — `phones` array elements now contain `key_masked` (the phone-middle-masked number) and `dnc`. The source array on the underlying collection is `phone` (singular); the response surfaces it as `phones`. `preferred_language` is sourced from `pref_lang` in the model — only the rendered name changes.
* **`D16` Borrower Deals** — dropped two fields from the allowlist (`first_due_date_timestamp`, `everReachedAttempted`); they aren't present in the underlying Mongoose model or any sampled doc.
* Pagination doc updated — TIER 2 (variable page size) datasets now include `D03`, `D17`, `D18`, `D19` in addition to `D21`, `D22`, `D23`.

*No breaking changes.* `meta.schemaVersion` stays at `"v1"`.

## v1.1 — 2026-06-08

### Added

* `public_id` field on the following datasets: [`D15` Borrower Settlements](/api-reference/exports/datasets/d15-borrower-settlements), [`D21` Communication Logs](/api-reference/exports/datasets/d21-communication-logs), [`D22` Conversations](/api-reference/exports/datasets/d22-conversations), and [`D23` Manual Communication Logs](/api-reference/exports/datasets/d23-manual-communication-logs). Use it as the stable per-row identifier for warehouse upserts. On `D21`/`D22`/`D23` it is derived from the underlying Mongo `_id`; on `D15` it is the record's native `public_id`.
* `body.schemaVersion: "v1"` on the [catalog endpoint](/api-reference/exports/endpoints/catalog) response.
* `meta.schemaVersion: "v1"` on every [fetch-dataset](/api-reference/exports/endpoints/fetch-dataset) response.
* `meta.tenantPathKind` on fetch-dataset responses — `"direct"` or `"via"`. Tells the client whether to expect constant or variable page sizes (see [Pagination → Variable page size](/api-reference/exports/pagination)).
* `meta.readFrom` on fetch-dataset responses — `"primary"` or `"secondary"`. Indicates which replica served the request.
* Optional query parameter `?includeTotal=true` on fetch-dataset. Returns `pagination.total` (filter-wide row count) when set, with guarded semantics for `via` (TIER 2) datasets and large/slow counts. See [Fetch Dataset → Query parameters](/api-reference/exports/endpoints/fetch-dataset) and [Pagination → Filter-wide totals](/api-reference/exports/pagination).
* `pagination.total` / `pagination.totalExact` / optional `pagination.totalNote` keys, populated only when `includeTotal=true`.

### Fixed

* `via` (TIER 2) datasets (`D21`, `D22`, `D23`) no longer truncate exports silently on a full final page. Previously, a page where `limit <= candidateCount < overfetchLimit` could return `nextCursor: null` even when more matching rows existed beyond the page. The cursor-advance logic now correctly fires the "page is full → advance to last returned row" branch regardless of whether the candidate window was completely filled.

  <Warning>
    If you already ingested data under the v1.0 behavior, consider running a full backfill on `D21`, `D22`, and `D23` to pick up any rows that may have been truncated.
  </Warning>

## v1.0 — initial Phase 1 release

### Added

* Two new endpoints under the API Reference tab: `GET /exports/catalog` and `GET /exports/{sectionCode}/{datasetCode}`.
* Cursor-based pagination via opaque `nextCursor` tokens, with support for initial load (omit `since`) and incremental load (pass the last batch's max cursor-field value as `since`).
* 10 datasets available for fetch: `D07` Borrower Payments, `D08` Borrower Payment Plans, `D09` Borrower Payment Plan Installments, `D12` Scheduled Payments, `D14` Payment Proofs, `D15` Borrower Settlements, `D21` Communication Logs, `D22` Conversations, `D23` Manual Communication Logs, and `D26` User Lender Details.
* 15 additional dataset codes reserved in the catalog (`available: false`). Phase 2 will activate codes for S1 Customers & Accounts and S3 Collections Cases.
* Per-dataset field allowlists with masking applied at the database layer (`id_number` and `passport_number` masked to last 4, `dob` reduced to year, `ip_address` reduced to /16).
* Two-layer tenant isolation: tenant DB resolution via JWT, plus `lender_id` filtering inside the tenant DB.
* Strict `requireLenderMatch` middleware on export endpoints, enforcing that the URL `lenderPublicId` equals the JWT's `lenderId`.

***

<Snippet file="snippets/support-info.mdx" />
