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

# Write exception findings from your own engine

> Send a note, category, suggested match and evidence for each overdue line from your own matching engine, then read the review back.

The findings API lets your own matching engine write the note on each overdue line in an End Close exception. Your engine knows your billing rules, so its explanations are the ones your reviewers want to read, and its suggestions become the **Approve** action on the [Exceptions page](https://endclose.com/docs/guides/review-exceptions.md).

When records in a reconciliation stay unmatched past their `overdue_at`, End Close opens an exception for the data stream and writes a note for each open line itself. Findings you send take the place of those notes. Lines already matched, by your rules or by your engine through `POST /reconciliation_matches`, are done and need no finding. Write findings for the lines that are left.

## Prerequisites

* An [API key](https://endclose.com/docs/api-reference/authentication.md) for the environment.
* The reconciliation's id and the id of the data stream whose lines you are reviewing (`GET /reconciliations`).

## Write findings

**1. Build one finding per open record**

Identify the record by `record_id`, or by the `external_id` you gave it when you created it. Every finding needs a `note`. Add a `suggestion` when there is something to apply, and `evidence` when a document backs the note.

**2. Send the findings**

`PUT` them to the data stream's findings endpoint. It opens the exception for the data stream if End Close hasn't yet, and reuses the open one otherwise.

```bash cURL theme={"dark"}
curl -X PUT https://api.endclose.com/v1/reconciliations/$RECONCILIATION_ID/data_streams/$DATA_STREAM_ID/findings \
  -H "X-API-Key: $ENDCLOSE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "findings": [
      {
        "external_id": "1DP200406",
        "note": "Northwind Credit Union was billed for Falcon monitoring on invoice line NW-2026-10-14, as a back-bill for June and July.",
        "category": "back-billing",
        "suggestion": {
          "kind": "match",
          "record_ids": ["NW-2026-10-14"],
          "text": "Match with invoice line NW-2026-10-14."
        },
        "evidence": [
          { "quote": "Falcon monitoring Jun–Jul 2,746.66", "source": "Draft invoice, October" }
        ]
      },
      {
        "external_id": "1DP200494",
        "looks_right": true,
        "note": "A $0.00 line for Harbor State Bank. It was $0.00 last month too and nothing is owed.",
        "category": "zero line",
        "precedent": "September: same client, line 200494, left at $0.00.",
        "suggestion": { "kind": "none" }
      }
    ]
  }'
```

```json Response theme={"dark"}
{
  "exception_id": "01a1138b-9d2e-7f4a-8c01-5e8b2a9c7d10",
  "upserted": 2,
  "errors": []
}
```

**3. Check the errors**

Each finding is checked on its own. A bad record id, an empty note or an unknown record in `suggestion.record_ids` rejects that finding only. The rest are written, and the response lists the rejected ones by position:

```json Partial success theme={"dark"}
{
  "upserted": 1,
  "errors": [
    { "index": 1, "external_id": "1DP200494", "message": "external_id is not a record in this exception's data stream" }
  ]
}
```

Findings are keyed on the record, so sending a record again replaces its finding. Send up to 1,000 findings per request.

When you already have the exception's id, `PUT /reconciliation_exceptions/{id}/findings` takes the same body and returns `upserted` and `errors`.

## Finding fields

| Field | Description |
| - | - |
| `record_id` or `external_id` | The record the finding is about. An `external_id` is looked up in the exception's data stream and rejected if it matches more than one record |
| `note` | Required. One or two plain sentences: what happened to the line and what was checked |
| `category` | A short label in your own words, such as `back-billing`. Reviewers filter by it |
| `looks_right` | `true` when the line is correct as it stands. These lines appear under **Looks right** and can be confirmed in bulk |
| `suggestion.kind` | `match` pairs the line with `record_ids`, `adjust` pairs them and books the gap as an adjustment, `none` means nothing to apply |
| `suggestion.record_ids` | Every other record in the proposed match, on either side, as record ids or external ids |
| `suggestion.reason` | For `adjust`: why a gap remains. It becomes the adjustment's description |
| `suggestion.text` | The sentence shown next to **Approve** |
| `evidence` | Quotes that back the note, each with an optional `source` and `url` |
| `precedent` | How the same line was handled before, in one sentence |
| `labels` | Free-form markers. The review reads `colour`, `colour_cell` and `carried_forward`, and stores anything else as sent |

> [!NOTE]
>
> `suggestion.record_ids` lists every other record of the proposed match, on either side of the reconciliation. A rollup names its sibling lines along with the invoice line. End Close recomputes the difference from the records' amounts, and a `match` that doesn't balance is refused when the reviewer approves it, so use `adjust` with a `reason` when you expect a gap.

## Link evidence to documents

An `evidence` quote can carry a `url` to the document it came from, such as a contract uploaded to **Files**, using the file's `url`. End the URL with `#page=N` and the review opens the PDF at that page, beside the note, from the quote's **Open in PDF** link.

When the `url` is a PDF in **Files**, End Close checks the quote against it after the finding is written. Each quote comes back with a `check` saying whether the document contains it word for word, and on which page. Quote the document exactly. Case, line breaks, curly quotes and dash forms don't matter, and `…` can stand for text you leave out. You can't send a `check` yourself.

## Read the review back

```bash cURL theme={"dark"}
curl "https://api.endclose.com/v1/reconciliation_exceptions/$EXCEPTION_ID/review?status=all" \
  -H "X-API-Key: $ENDCLOSE_API_KEY"
```

Each row carries the record, its finding, a derived `status` and `difference_cents`, the gap between the line and what the finding found on the other side. `status` is `done` once the record is matched, `looks_right` when the finding says so, and `to_look_at` otherwise.

Lines that carry a count (`metadata.quantity`, `qty`, `count`, `event_qty` or `units` on the record) also get `quantity`, `other_quantity` (the suggested records' counts, summed into `finding.other_side.count`) and `quantity_difference`. A billing review can then see 27,468 against 27,467 without reading the note.

The response also includes:

| Field | Description |
| - | - |
| `counts` | Totals per status |
| `categories` | The finding categories, with how many lines carry each |
| `pending_notes` | Overdue lines that have no finding yet |
| `notes_state` | Why lines lack a note: `writing` (End Close's review is running), `failed` (the last review errored), `off` (End Close's own notes aren't enabled, so only your findings appear) or `idle` |

`status` defaults to `to_look_at`. `category` (repeatable) and `q` narrow the page, and `sort` with `dir` orders it by any column. `GET /reconciliation_exceptions/{id}` adds `reasons`, the adjustment reasons already used on the reconciliation.

The full request and response shapes are under **Reconciliation Exceptions** in the API reference.

## FAQ

> [accordion] Do I need to wait for End Close to open the exception?
>
> No. The data stream endpoint opens the exception if none is open and returns its `exception_id`.

> [accordion] What happens if End Close already wrote a note for a line?
>
> Findings are keyed on the record, so the finding you send replaces the note for that line.

> [accordion] Should I send findings for lines my engine already matched?
>
> No. Matched lines are done. Create the match with `POST /reconciliation_matches` and send findings only for the lines left open.

> [accordion] Can I retry a request safely?
>
> Yes. Re-sending a finding replaces it, and both findings endpoints accept an `Idempotency-Key` header. See [Idempotency](https://endclose.com/docs/api-reference/idempotency.md).

## Related

> [card] [Review exceptions](https://endclose.com/docs/guides/review-exceptions.md)
>
> What your reviewers see and do with each finding.

> [card] [Exceptions](https://endclose.com/docs/concepts/exceptions.md)
>
> When exceptions open, escalate and resolve.

> [card] [Authentication](https://endclose.com/docs/api-reference/authentication.md)
>
> Create and use API keys.

> [card] [Idempotency](https://endclose.com/docs/api-reference/idempotency.md)
>
> Retry writes without creating duplicates.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.