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

# Reconcile with the BI

> The period's attributed lines against your BI file, line by line, with the deviation on the lines both sides know.



## OpenAPI

````yaml openapi/en/cell.json POST /v1/measure/reconcile
openapi: 3.1.0
info:
  title: Niadra data API
  version: '1'
  description: >-
    Writing, context, history, objects, identity, privacy and governance of one
    space. Every space has a stable address, with the space and the region in
    its name.
servers:
  - url: https://{space}.{region}.api.niadra.com
    variables:
      space:
        default: acme-prod
        description: The space, which comes in the source key.
      region:
        default: us-east-2
        description: The region of the space, which also comes in the key.
security: []
paths:
  /v1/measure/reconcile:
    post:
      tags:
        - signals
      summary: Reconcile with the BI
      description: >-
        The period's attributed lines against the company's BI file, line by
        line, with the deviation kept.


        **Authentication.** Console person token with the `analysis` role (or
        admin), or a source key with the `admin` scope. It answers only in a
        space with the `measurement` feature on (the `features` document); in a
        space without it, 404.
      operationId: reconcile_v1_measure_reconcile_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReconcileRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReconcileResult'
          description: Successful Response
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The request does not match the contract.
      security:
        - sourceKey: []
        - personToken: []
components:
  schemas:
    ReconcileRequest:
      additionalProperties: false
      properties:
        file:
          $ref: '#/components/schemas/BiFile'
        since:
          format: date
          title: Since
          type: string
        until:
          format: date
          title: Until
          type: string
      required:
        - since
        - until
        - file
      title: ReconcileRequest
      type: object
    ReconcileResult:
      additionalProperties: false
      description: >-
        Our value of each line against the BI's, on the lines both know; lines
        only one side knows are

        counted apart and never enter the deviation.
      properties:
        bi_minor:
          title: Bi Minor
          type: integer
        currency:
          anyOf:
            - type: string
            - type: 'null'
          title: Currency
        deviation:
          anyOf:
            - type: number
            - type: 'null'
          description: '|ours - BI| / BI on the lines both know.'
          title: Deviation
        matched:
          title: Matched
          type: integer
        only_bi:
          title: Only Bi
          type: integer
        only_ours:
          title: Only Ours
          type: integer
        ours_minor:
          title: Ours Minor
          type: integer
        report_id:
          maxLength: 512
          minLength: 1
          title: Report Id
          type: string
        tolerance:
          title: Tolerance
          type: number
        within_tolerance:
          title: Within Tolerance
          type: boolean
        worst:
          description: The lines that differ most.
          items:
            $ref: '#/components/schemas/ReconciledLine'
          title: Worst
          type: array
      required:
        - report_id
        - deviation
        - tolerance
        - within_tolerance
        - matched
        - only_ours
        - only_bi
        - ours_minor
        - bi_minor
      title: ReconcileResult
      type: object
    Problem:
      additionalProperties: false
      description: RFC 9457 problem details; `code` comes from the versioned error catalog.
      properties:
        code:
          title: Code
          type: string
        detail:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Detail
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Request Id
        status:
          title: Status
          type: integer
        title:
          title: Title
          type: string
        type:
          default: about:blank
          title: Type
          type: string
      required:
        - title
        - status
        - code
      title: Problem
      type: object
    BiFile:
      additionalProperties: false
      description: >-
        The company's BI export for the period, uploaded first (`POST
        /v1/measure/reconcile/uploads`), as CSV

        with a header: `order` (the id the company knows the object by), `line`
        (optional), `value` (in major

        units, as the signed definition nets it) and `currency`. It is read once
        and deleted.
      properties:
        format:
          const: csv
          default: csv
          title: Format
          type: string
        upload_id:
          format: uuid
          title: Upload Id
          type: string
      required:
        - upload_id
      title: BiFile
      type: object
    ReconciledLine:
      additionalProperties: false
      properties:
        bi_minor:
          title: Bi Minor
          type: integer
        line:
          title: Line
          type: string
        order:
          maxLength: 512
          minLength: 1
          title: Order
          type: string
        ours_minor:
          title: Ours Minor
          type: integer
      required:
        - order
        - line
        - ours_minor
        - bi_minor
      title: ReconciledLine
      type: object
  securitySchemes:
    sourceKey:
      type: http
      scheme: bearer
      description: nia_sk_...
    personToken:
      type: http
      scheme: bearer
      bearerFormat: JWT

````