> ## 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.

# Run a reconciliation

> Starts a batch run of the matching engine over the reconciliation's unmatched records and active rules, the same run as Run in the app. The run works in the background: poll `GET /reconciliations/{id}`, whose `current_run` is this run while it is pending or running and whose `last_run` is it once it has completed or failed. Only batch reconciliations can be run on demand; continuous reconciliations match each record as it arrives. A reconciliation has at most one run in progress.



## OpenAPI

````yaml /openapi.json post /reconciliations/{id}/run
openapi: 3.1.0
info:
  title: End Close API
  description: REST API is used to interact with the End Close platform.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.endclose.com/v1
security:
  - ApiKeyAuth: []
paths:
  /reconciliations/{id}/run:
    post:
      summary: Run a reconciliation
      description: >-
        Starts a batch run of the matching engine over the reconciliation's
        unmatched records and active rules, the same run as Run in the app. The
        run works in the background: poll `GET /reconciliations/{id}`, whose
        `current_run` is this run while it is pending or running and whose
        `last_run` is it once it has completed or failed. Only batch
        reconciliations can be run on demand; continuous reconciliations match
        each record as it arrives. A reconciliation has at most one run in
        progress.
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          description: The reconciliation ID
        - in: header
          name: Idempotency-Key
          schema:
            type: string
            maxLength: 255
          description: >-
            Optional. Send the same key when retrying a write you are not sure
            landed: the first response is returned again (with
            Idempotent-Replayed: true) instead of writing twice. A key used for
            a different request is refused with 422; one whose first request is
            still running gets 409. A refused or failed request does not use up
            its key. Keys are per environment and kept for 7 days.
      responses:
        '202':
          description: Run queued
          content:
            application/json:
              schema:
                type: object
                properties:
                  reconciliation_id:
                    type: string
                  run:
                    $ref: '#/components/schemas/ReconciliationRun'
        '404':
          description: Reconciliation not found
        '409':
          description: >-
            A run of this reconciliation is already pending or running. The
            body's `run` is that run, which you can poll instead.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  run:
                    $ref: '#/components/schemas/ReconciliationRun'
        '422':
          description: The reconciliation is continuous, so it has no on-demand run
components:
  schemas:
    ReconciliationRun:
      type: object
      description: >-
        A single execution of a reconciliation's batch or continuous matching
        pipeline.
      properties:
        id:
          type: string
          format: uuid
        kind:
          type: string
          enum:
            - batch
            - continuous
        status:
          type: string
          enum:
            - pending
            - running
            - completed
            - failed
            - cancelled
        trigger:
          type: string
          enum:
            - manual
            - rule_activated
            - agent
            - record_created
            - ingestion
          description: >-
            What initiated this run. `ingestion` runs are queued automatically
            once an import lands, so rollup (many_to_one) rules apply to the new
            records.
        total_records:
          type: integer
          description: Total records considered by the run
        processed_records:
          type: integer
          description: Records processed so far
        matched_records:
          type: integer
          description: Records that were matched during the run
        rule_summary:
          type: object
          nullable: true
          description: Per-rule match counts, populated as the run progresses
        progress:
          type: integer
          description: Processing progress as a percentage (0-100)
        started_at:
          type: string
          format: date-time
          nullable: true
        completed_at:
          type: string
          format: date-time
          nullable: true
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````

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