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

# Context sources

> Add and edit data sources from the Sources tab of a context's setup page in the Matcher UI — pick a type and side, set file dialect and ingestion policies.

Use the **Sources** tab in a context's setup page to configure and manage data sources for reconciliation. Sources feed the two sides of the context: each source declares which side it belongs to and how the engine should treat its data.

## Accessing the Sources tab

***

<Steps>
  <Step>
    Navigate to **Configure → Contexts** in the left sidebar.
  </Step>

  <Step>
    Select a context from the list to open its setup page.
  </Step>

  <Step>
    Select the **Sources** tab.
  </Step>
</Steps>

<Note>
  The global **Active context** control in the sidebar lets you change the active reconciliation context at any time.
</Note>

## Sources list

***

This view shows up to 100 sources and has no paging controls. Sources are grouped by side (**LEFT side** / **RIGHT side**). Each active source row shows its name and type. Depending on your permissions, it can also offer actions to manage ingestion schedules, run a manual fetch, extract from a document, edit, or archive. A **Show archived** toggle includes archived sources; they carry an **Archived** badge and offer only restore.

At least one live `LEFT` source and one live `RIGHT` source are required for setup readiness; archived sources do not count.

## Creating a source

***

<Steps>
  <Step>
    In the **Sources** tab, click the **Add source** button.
  </Step>

  <Step>
    A dialog opens. Fill in the source details:

    | Field               | Description                                                                                                  |
    | ------------------- | ------------------------------------------------------------------------------------------------------------ |
    | **Name** (required) | A descriptive name for the source (up to 50 characters)                                                      |
    | **Type** (required) | The source type. New sources start with `BANK` selected: `LEDGER`, `BANK`, `GATEWAY`, `CUSTOM`, or `FETCHER` |
    | **Side** (required) | Which side of the reconciliation the source feeds. New sources start with `LEFT` selected: `LEFT` or `RIGHT` |
  </Step>

  <Step>
    Configure how the engine parses and ingests the source's files:

    | Section                      | Description                                                                                                                                                                                                                                                                                                                                                    |
    | ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | **File dialect**             | **Encoding** (`UTF-8`, `UTF-8 with BOM`, `Windows-1252`, `ISO-8859-1`), **Delimiter** (comma, semicolon, tab, pipe), **Decimal style** (dot `1234.56` or comma `1.234,56`), and **Date style** (ISO, ISO with offset, day first, month first). Leave on **Auto** to use the server defaults (UTF-8 / comma / dot / ISO); Auto does not detect a file's dialect |
    | **Duplicate handling**       | What to do when a file repeats an external ID already present for this source: **Keep first (default)** silently keeps the original and drops the repeat, **Reject as errors** records an import error, and **Flag as exception** opens a duplicate exception on the surviving transaction                                                                     |
    | **Blank reference handling** | What to do when a row has no mapped external ID: **Reject as errors (default)** records an import error; **Import for review** creates a pending-review transaction in the Unmatched workbench                                                                                                                                                                 |
    | **camt.053 options**         | For camt.053 uploads: **Date basis** (Booking date `BookgDt` or Value date `ValDt`) and which field to use as the **Entry reference** (`NtryRef`, `EndToEndId`, or `TxId`). Leave both controls on **Auto** for booking date and `NtryRef`                                                                                                                     |
    | **Advanced config (JSON)**   | Optional source configuration as a JSON object. Leave empty for defaults. To fail an ingestion job only when failed rows strictly exceed a threshold, set `fail_on_error_rate_percent` to an integer from 1 through 99; omit it to never auto-fail because of row-error rate                                                                                   |
  </Step>

  <Step>
    Click **Create source**.
  </Step>
</Steps>

<Note>
  Field mapping is not part of the source form — configure how source columns map to reconciliation fields in the separate **Field maps** tab. For CSV, JSON, and XML uploads, each live source needs a field map for setup readiness. **camt.053 exception:** selecting a non-**Auto** camt.053 option declares the source self-mapped for readiness. On every camt.053 upload, the parser uses its embedded ISO 20022 mapping and ignores a field map; if both camt.053 controls remain **Auto**, no `camt053` declaration is saved, so readiness still expects a field map.
</Note>

## Source types

***

| Type        | Description                       |
| ----------- | --------------------------------- |
| **LEDGER**  | Data from the internal ledger     |
| **BANK**    | Data from a bank statement feed   |
| **GATEWAY** | Data from a payment gateway       |
| **CUSTOM**  | Data from a bespoke feed          |
| **FETCHER** | Data from a discovery-engine pull |

## Editing a source

***

Click the edit button on a source to open the dialog. Update the fields as needed and click **Save changes**.

## Archiving and restoring a source

***

Sources are never hard-deleted — archiving is the only removal path.

<Steps>
  <Step>
    Click the archive button on a source. An **Archive source?** confirmation dialog appears; click **Archive**.
  </Step>

  <Step>
    The source moves out of the active list. Turn on **Show archived** to see it with its **Archived** badge.
  </Step>

  <Step>
    To bring it back, click the restore button on the archived source and confirm in the **Restore source?** dialog.
  </Step>
</Steps>
