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

# Reporting API

> Org-scoped, API-key-authenticated reporting and payment endpoints for Monterey Financial clients.

The Monterey Reporting API exposes historical portfolio, transactional, and lifecycle reports as HTTPS JSON endpoints, plus payment operations: stored payment methods, autopay schedules, and (soon) one-time payments. Each API key is bound to a fixed set of organizations; every request returns only data the key is authorized to see.

## What's available today

### Reports

| Code | Endpoint            | Status                                    |
| ---- | ------------------- | ----------------------------------------- |
| CRR  | `GET /reports/crr`  | Available                                 |
| NSFR | `GET /reports/nsfr` | Available                                 |
| CAR  | `GET /reports/car`  | Available                                 |
| NCAR | `GET /reports/ncar` | Available                                 |
| MPR  | `GET /reports/mpr`  | Available                                 |
| NSR  | `GET /reports/nsr`  | Available                                 |
| WOR  | `GET /reports/wor`  | Available                                 |
| PIF  | `GET /reports/pif`  | Available                                 |
| ABR  | `GET /reports/abr`  | Available                                 |
| DR   | `GET /reports/dr`   | Available                                 |
| SPR  | `GET /reports/spr`  | Deferred (candidate→party resolution gap) |

### Resource endpoints (all paginated where applicable)

| Endpoint                          | Description                                 |
| --------------------------------- | ------------------------------------------- |
| `GET /accounts`                   | List accounts the key can see               |
| `GET /accounts/{id}`              | Single account; 404 if out of scope         |
| `GET /accounts/{id}/transactions` | All transactions for an account             |
| `GET /organizations`              | List organizations from the key's allowlist |
| `GET /organizations/{id}`         | Single organization; 404 if out of scope    |
| `GET /persons`                    | Persons reachable through in-scope accounts |
| `GET /persons/{id}`               | Single person; 404 if not reachable         |
| `GET /transactions`               | All transactions across in-scope accounts   |

### Payment operations

Manage stored payment methods and recurring payment schedules for in-scope borrowers and accounts. Same Bearer auth and pagination as the read endpoints; see [Conventions](/api-reference/conventions) for write-request semantics.

| Endpoint                             | Description                                                                                   |
| ------------------------------------ | --------------------------------------------------------------------------------------------- |
| `GET /payment-methods`               | List stored payment methods; filter to one borrower with `party_id`                           |
| `GET /payment-methods/{id}`          | Single payment method; 404 if not reachable                                                   |
| `PATCH /payment-methods/{id}`        | Update display fields (`nickname`, `holder_name`) — instrument data is immutable              |
| `DELETE /payment-methods/{id}`       | Deactivate; 409 if an active or paused autopay schedule still uses it                         |
| `GET /accounts/{id}/payment-methods` | Active payment methods eligible for autopay or payments on an account                         |
| `POST /autopay`                      | Create a recurring payment schedule                                                           |
| `GET /autopay`                       | List autopay schedules; filter to one account with `account_id`                               |
| `GET /autopay/{id}`                  | Single autopay schedule; 404 if not reachable                                                 |
| `PATCH /autopay/{id}`                | Update payment method, amount, end date, or pause state                                       |
| `DELETE /autopay/{id}`               | Cancel a schedule; cancelled schedules cannot be reactivated                                  |
| `POST /payments`                     | One-time payment — **coming soon**; the contract is final but every request returns 501 today |

Removing a payment method and cancelling a schedule are soft operations: the records stay visible (`is_active: false`, `status: cancelled`) so payment history remains auditable.

## Before you call

<Steps>
  <Step title="Get an API key">
    Keys are minted in the client portal. Each key is bound to an explicit allowlist of organization IDs you own.
  </Step>

  <Step title="Add the Authorization header">
    Send your API key on every request, prefixed with `Bearer`:

    ```http theme={null}
    Authorization: Bearer mk_your_key_here
    ```
  </Step>

  <Step title="Pick a date range">
    Every report takes `from` and `to` query parameters (inclusive, `YYYY-MM-DD`). The column each report filters on differs — see the endpoint pages.
  </Step>
</Steps>

<Note>
  The plaintext key is shown once at creation. Store it like a password — we only keep its hash, and a revoked key cannot be recovered.
</Note>

## Where rows come from

Every row carries an `organization_id` so clients with multi-org keys can group their own reports. When the same logical customer is registered with Monterey as more than one organization, the portal can scope a single key to all of those organizations or to a subset — see [Domain concepts](/api-reference/domain-concepts) for how organizations, accounts, and persons relate.

## Known data gaps

Some historical rows have NULL values in fields that were added more recently. The most common is `amount_cents`, which is NULL for some pre-2017 payments — the migration that added per-fee-category amounts only filled new transactions. Treat NULL as "unknown" rather than "zero".

## Tools & integrations

The full OpenAPI 3.1 spec is downloadable and importable into any API tool that understands OpenAPI — Postman, Insomnia, Bruno, code generators, and more.

<Card title="Download OpenAPI spec" icon="download" href="/api-reference/external_api.openapi.json">
  The complete machine-readable spec for every endpoint and schema in this API. JSON, OpenAPI 3.1.
</Card>

### Use it in Postman, Insomnia, or Bruno

Right-click the **Download OpenAPI spec** link above and copy the URL. Then in your tool of choice:

* **Postman** — File → Import → Link, paste the URL. Postman generates a full collection with the Bearer auth scheme pre-wired.
* **Insomnia** — Create → Import From → URL, paste the URL.
* **Bruno** — Collection → Import → OpenAPI v3 Spec, paste the URL.

You'll be prompted to add your API key as a collection-level variable on first import. After that every endpoint is one click to try.

## Next

<Columns cols={2}>
  <Card title="Authentication" icon="key" href="/api-reference/authentication">
    Org-scoped keys, 401 vs 403 semantics, key rotation.
  </Card>

  <Card title="Conventions" icon="book" href="/api-reference/conventions">
    Date formats, error responses, the `organization_id` query parameter.
  </Card>
</Columns>
