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

# List documents

> Lists documents, with optional typed details, statement lines and download URLs.

`search` and `search_term` are the same filter; send only one. Bill filters need `type=bill` or no `type`. `source_id` and the reconciliation `status` filter select statement documents.

Filtered scans can return an empty page with `has_more=true`. Continue until `next_cursor` is null.

## Expanded details

Set `expand=bill,receipt,vendor,statement` to add the related records. Each expanded item contains `document` and the requested records.

## Statement lines

Send one document ID with `expand=statement.lines`. Read the lines from `statement.lines.data`, and pass its `next_cursor` as `statement_cursor` for the next page. Keep `import_status`, `is_reconciled` and the document filter unchanged between pages.

## Download URLs

Add `download` to `expand` to get viewing and download URLs. This needs a user-scoped API key, and it records a document view, as opening the document in the dashboard does. The URLs expire after three days.


## OpenAPI

````yaml openapi-public-preview.json GET /v1/vault/documents
openapi: 3.1.0
info:
  title: Entendre API
  version: 1.0.0
  description: Programmatic access to crypto-native accounting and treasury operations.
servers:
  - url: https://api.entendre.finance
    description: Production API.
security:
  - ApiKey: []
tags:
  - name: Organization
    description: Read your organization profile and find members for agent assignments.
  - name: Transactions
    description: Find transactions, inspect their details and create manual records.
  - name: Sources
    description: >-
      Manage wallets, exchange accounts, bank accounts and other transaction
      sources.
  - name: Assets
    description: Inspect asset acquisitions, remaining quantities and cost basis.
  - name: Journals
    description: >-
      Create and post journal entries, correct eligible entries and sync posted
      journals to a connected general ledger.
  - name: Documents
    description: >-
      Upload documents, check processing status and link supporting evidence to
      transactions.
  - name: Legal Entities
    description: Manage the legal entities used in your accounting records.
  - name: Ledger Accounts
    description: Manage your chart of accounts and find accounts for journal entries.
  - name: Tags
    description: Create and manage tags to classify your records.
  - name: Accruals
    description: >-
      Create and post accruals, inspect their status and reverse eligible
      entries.
  - name: Cash Application
    description: Match deposits to invoices and manage the resulting cash applications.
  - name: Classification
    description: >-
      Classify transactions in a batch, post eligible entries and inspect the
      results.
  - name: Revaluation
    description: Run asset revaluations for an accounting period and check their results.
  - name: Accounting Periods
    description: Check whether a period is ready to close, then close or reopen it.
  - name: Income Statement
    description: View revenue, expenses and net income for a reporting period.
  - name: Balance Sheet
    description: View assets, liabilities and equity as of a reporting date.
  - name: Trial Balance
    description: Review ledger account balances and debit and credit totals.
  - name: Closing Positions
    description: View asset positions at the end of a reporting period.
  - name: Treasury Balances
    description: Review treasury balances by asset and source.
  - name: Realized Gains & Losses
    description: Review realized gains and losses from asset dispositions.
  - name: Asset Tax Lots
    description: Inspect asset tax lots, remaining quantities and cost basis.
  - name: Schedule of Dispositions
    description: >-
      Review asset dispositions and their proceeds, cost basis and gains or
      losses.
  - name: Financial Insights
    description: Review financial insights for your selected reporting context.
  - name: Agents
    description: Create agents, schedule their work and inspect their runs.
  - name: Memory
    description: Read, search and maintain the memory files your agents use.
  - name: Connections
    description: Connect providers, manage authorization and disconnect.
  - name: GL Mapping
    description: >-
      Map ledger accounts and legal entities to your ERP. Import legal entities,
      tags and chart of accounts.
  - name: Request
    description: Request information, documents or connections from a client.
  - name: Client
    description: Manage your firm’s client relationships.
  - name: Team
    description: Invite team members and manage their access to your firm.
  - name: Settings
    description: Read and update your firm settings.
paths:
  /v1/vault/documents:
    get:
      tags:
        - Documents
      summary: List documents
      description: >-
        Returns document metadata, extraction results, processing errors and
        permitted download URLs. Filter by document IDs or the available search
        fields.
      operationId: list_documents
      parameters:
        - name: document_ids
          in: query
          schema:
            type: array
            items:
              type: string
          style: form
          explode: true
          description: Comma-separated `doc_<uuid>` ids to filter by. Up to 100 IDs.
        - name: created_from
          in: query
          schema:
            type: string
          description: Earliest created date (YYYY-MM-DD).
        - name: created_to
          in: query
          schema:
            type: string
          description: Latest created date (YYYY-MM-DD).
        - name: search_term
          in: query
          schema:
            type: string
          description: >-
            Full-text match across extracted text, summary, filename, vendor
            name, and bill/receipt numbers.
        - name: limit
          in: query
          required: false
          description: Maximum number of records to return.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
        - name: cursor
          in: query
          required: false
          description: >-
            The `next_cursor` value from the previous page. Keep the other
            filters unchanged.
          schema:
            type: string
        - name: search
          in: query
          required: false
          description: Case-insensitive search in labels and descriptions.
          schema:
            type: string
        - name: type
          in: query
          required: false
          description: Filter by document type.
          schema:
            type: string
            enum:
              - bill
              - receipt
              - statement
              - other
        - name: source_id
          in: query
          required: false
          description: Source ID (`src_…`).
          schema:
            type: string
            example: src_507f1f77bcf86cd799439011
        - name: vendor_id
          in: query
          required: false
          description: Vendor ID (`vnd_…`).
          schema:
            type: string
            example: vnd_507f1f77bcf86cd799439011
        - name: expand
          in: query
          schema:
            type: string
          description: >-
            Comma-separated expansions: `bill`, `receipt`, `vendor`,
            `statement`, `statement.lines` or `download`. `statement.lines` and
            `download` require exactly one `document_ids` value. `download`
            requires a user-scoped API key.
        - name: statement_limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 100
          description: >-
            Rows per statement page. Requires expand=statement.lines and exactly
            one document_ids value. Does not change the document page size.
        - name: statement_cursor
          in: query
          required: false
          schema:
            type: string
          description: The `statement.lines.next_cursor` value from the previous page.
        - name: vendor_name
          in: query
          required: false
          schema:
            type: string
          description: Vendor name (substring match).
        - name: bill_number
          in: query
          required: false
          schema:
            type: string
          description: Bill number.
        - name: bill_date_from
          in: query
          required: false
          schema:
            type: string
          description: Earliest bill date (YYYY-MM-DD).
        - name: bill_date_to
          in: query
          required: false
          schema:
            type: string
          description: Latest bill date (YYYY-MM-DD).
        - name: billing_period_start_from
          in: query
          required: false
          schema:
            type: string
          description: Earliest billing-period start (YYYY-MM-DD).
        - name: billing_period_end_to
          in: query
          required: false
          schema:
            type: string
          description: Latest billing-period end (YYYY-MM-DD).
        - name: currency
          in: query
          required: false
          schema:
            type: string
          description: Currency code (such as USD).
        - name: total_amount_min
          in: query
          required: false
          schema:
            type: number
          description: Minimum total amount, inclusive.
        - name: total_amount_max
          in: query
          required: false
          schema:
            type: number
          description: Maximum total amount, inclusive.
        - name: tax_amount_min
          in: query
          required: false
          schema:
            type: number
          description: Minimum tax amount, inclusive.
        - name: tax_amount_max
          in: query
          required: false
          schema:
            type: number
          description: Maximum tax amount, inclusive.
        - name: tax_rate_min
          in: query
          required: false
          schema:
            type: number
          description: Minimum tax rate, inclusive.
        - name: tax_rate_max
          in: query
          required: false
          schema:
            type: number
          description: Maximum tax rate, inclusive.
        - name: import_status
          in: query
          required: false
          schema:
            type: string
            enum:
              - pending
              - imported
              - ignored
              - duplicate
              - invalid
          description: Nested statement-line filter. Requires expand=statement.lines.
        - name: vendor_ids
          in: query
          required: false
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
            maxItems: 100
          description: >-
            Bill filter. Comma-separated `vnd_` ids; a bill matches any of them.
            Combines with `vendor_id`. Requires `type=bill` or an omitted type.
        - name: reconciliation_status
          in: query
          required: false
          schema:
            type: string
            enum:
              - reconciled
              - not_reconciled
          description: >-
            Statement filter on `statement.reconciliation_status`. Requires
            `type=statement`.
        - name: is_reconciled
          in: query
          required: false
          schema:
            type: boolean
          description: >-
            Nested statement-line filter on `is_reconciled`. Requires
            `expand=statement.lines`.
      responses:
        '200':
          description: >-
            The request succeeded. With `expand`, each row is an envelope:
            `document` holds the document, next to the requested `bill`,
            `receipt`, `vendor` or `statement`.
          headers:
            X-Request-Id:
              description: Support correlation ID.
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      oneOf:
                        - $ref: '#/components/schemas/VaultDocument'
                        - $ref: '#/components/schemas/VaultDocumentEnvelope'
                    description: >-
                      The documents. Each item is a document, or an envelope
                      when you send `expand`.
                  has_more:
                    type: boolean
                    description: Whether another page is available.
                  next_cursor:
                    type:
                      - string
                      - 'null'
                    description: Cursor for the next page, or `null` on the last page.
                required:
                  - data
                  - has_more
                  - next_cursor
                additionalProperties: false
              examples:
                Documents:
                  value:
                    data:
                      - id: doc_6f31e8c4-41ce-47af-9db7-3ad295a0a601
                        organization_id: org_123
                        document_type: statement
                        document_source: upload
                        file_size: 1
                        filename: august-statement.pdf
                        original_filename: null
                        file_extension: pdf
                        summary: null
                        confidence_level: 1
                        language: null
                        created_at: null
                        deleted_at: null
                        download_url: https://files.example.com/documents/statement.pdf
                    has_more: false
                    next_cursor: null
                Statement rows:
                  value:
                    data:
                      - id: doc_6f31e8c4-41ce-47af-9db7-3ad295a0a601
                        organization_id: org_123
                        document_type: statement
                        document_source: upload
                        file_size: 1
                        filename: august-statement.pdf
                        original_filename: null
                        file_extension: pdf
                        summary: null
                        confidence_level: 1
                        language: null
                        created_at: null
                        deleted_at: null
                        download_url: https://files.example.com/documents/statement.pdf
                    has_more: false
                    next_cursor: null
        '400':
          description: >-
            The request is invalid. `error.fields` lists the fields to correct.
            Nothing was changed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: VALIDATION_ERROR
                  message: Invalid path, query or request body.
                  request_id: req_example
        '401':
          description: The API key is missing, invalid or expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: UNAUTHORIZED
                  message: Authentication is required.
                  request_id: req_example
        '403':
          description: >-
            The API key does not have the required scope or is not associated
            with a user, or the action needs a review in the dashboard.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: FORBIDDEN
                  message: Insufficient access to organization
                  request_id: req_example
        '404':
          description: The resource does not exist, or your organization cannot access it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: RESOURCE_NOT_FOUND
                  message: Resource not found
                  request_id: req_example
        '429':
          description: >-
            Too many requests. If the response has a `Retry-After` header, wait
            that many seconds before you retry. Otherwise, read `error.message`.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: RATE_LIMITED
                  message: Rate limit exceeded. Retry after 30s.
                  request_id: req_example
        '500':
          description: >-
            An unexpected error occurred. A write can still have taken effect;
            check the resource before you retry. Give the `request_id` to
            support.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: INTERNAL_ERROR
                  message: Internal server error
                  request_id: req_example
        '503':
          description: >-
            A service that this operation needs is unavailable. If the response
            has a `Retry-After` header, wait that many seconds. Check for
            earlier accepted work before you send the request again.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: SERVICE_UNAVAILABLE
                  message: Service unavailable.
                  request_id: req_example
components:
  schemas:
    VaultDocument:
      type: object
      description: A document. `id` is `doc_<uuid>`.
      properties:
        id:
          type: string
          example: doc_b1d4f6e0
          description: Document ID (`doc_…`).
        organization_id:
          type: string
          example: org_123
          description: Organization ID (`org_…`).
        document_type:
          type: string
          enum:
            - bill
            - receipt
            - statement
            - other
          description: >-
            Document type. Stored types other than bill, receipt and statement
            are returned as `other`.
        document_source:
          type: string
          description: How the document was added, such as upload or email.
        file_directory:
          type:
            - string
            - 'null'
          description: Folder of the document.
        file_size:
          type: integer
          description: File size in bytes.
        filename:
          type: string
          description: >-
            Display filename. Renaming changes the name only, not the stored
            file.
        original_filename:
          type:
            - string
            - 'null'
          description: File name at upload.
        file_extension:
          type: string
          description: File extension, such as `pdf`.
        summary:
          type:
            - string
            - 'null'
          description: Summary of the document content.
        hash_sum:
          type:
            - string
            - 'null'
          description: Hash of the file content.
        confidence_level:
          type:
            - number
            - 'null'
          description: Confidence of the document classification, from 0 to 1.
        language:
          type:
            - string
            - 'null'
          description: Document language.
        created_at:
          type:
            - string
            - 'null'
          description: Time the document was created (ISO 8601).
        deleted_at:
          type:
            - string
            - 'null'
          description: Time the document was deleted, or `null`.
        signed_url:
          type: string
          description: >-
            Short-lived URL to display the document inline, when permitted. Use
            download_url to save it.
        download_url:
          type: string
          description: >-
            Short-lived URL to download the document as an attachment, when
            permitted. signed_url_expires_at applies to both URLs.
        signed_url_expires_at:
          type: string
          description: Expiry time for signed_url and download_url.
          format: date-time
      required:
        - id
        - organization_id
        - document_type
        - filename
    VaultDocumentEnvelope:
      type: object
      description: >-
        Returned for each document when `expand` names a related record. Each
        related key is `null` when the document has no linked record.
      properties:
        document:
          $ref: '#/components/schemas/VaultDocument'
        bill:
          oneOf:
            - $ref: '#/components/schemas/VaultBill'
            - type: 'null'
          description: Present with `expand=bill`.
        receipt:
          oneOf:
            - $ref: '#/components/schemas/VaultReceipt'
            - type: 'null'
          description: Present with `expand=receipt`.
        vendor:
          oneOf:
            - $ref: '#/components/schemas/VaultVendor'
            - type: 'null'
          description: Present with `expand=vendor`.
        statement:
          oneOf:
            - $ref: '#/components/schemas/VaultBankStatement'
            - type: 'null'
          description: Present with `expand=statement` or `expand=statement.lines`.
      required:
        - document
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - request_id
          properties:
            code:
              type: string
              description: Machine-readable error code.
            message:
              type: string
              description: Technical description for developers.
            fields:
              type: object
              additionalProperties:
                type: string
              description: >-
                Present only on VALIDATION_ERROR. Maps failing field paths to
                reason strings.
            details:
              type: object
              additionalProperties: true
              description: >-
                Optional redacted diagnostic details. Request validation uses
                fields or field_errors.
            suggested_action:
              type: string
              description: A suggested next step.
            documentation_url:
              type: string
              format: uri
              description: Link to documentation about this error.
            request_id:
              type: string
              description: Unique request ID for support escalation.
          description: Error details.
    VaultBill:
      type: object
      description: A bill. `id` is `bil_<uuid>`; amounts are 2-place decimal strings.
      properties:
        id:
          type: string
          example: bil_abc123
          description: Bill ID (`bil_…`).
        organization_id:
          type:
            - string
            - 'null'
          description: Organization ID (`org_…`).
        document_id:
          type:
            - string
            - 'null'
          description: Document ID (`doc_…`).
        vendor_id:
          type:
            - string
            - 'null'
          description: Vendor ID (`vnd_…`).
        bill_number:
          type:
            - string
            - 'null'
          description: Bill number.
        bill_date:
          type:
            - string
            - 'null'
          description: Bill date.
        due_date:
          type:
            - string
            - 'null'
          description: Due date.
        billing_period_start:
          type:
            - string
            - 'null'
          description: Start of the billing period.
        billing_period_end:
          type:
            - string
            - 'null'
          description: End of the billing period.
        currency:
          type:
            - string
            - 'null'
          description: Bill currency.
        total_amount:
          type:
            - string
            - 'null'
          description: Bill total (decimal string).
        tax_amount:
          type:
            - string
            - 'null'
          description: Tax amount (decimal string).
        tax_rate:
          type:
            - string
            - 'null'
          description: Tax rate.
        tax_type:
          type:
            - string
            - 'null'
          description: Tax type, such as VAT.
        line_items:
          description: Line items as extracted from the document.
        payment_instructions:
          description: Payment instructions as extracted from the document.
        notes:
          type:
            - string
            - 'null'
          description: Notes.
        external_bill_id:
          type:
            - string
            - 'null'
          description: Bill ID in the external system.
        external_bill_source:
          type:
            - string
            - 'null'
          description: External system of the bill.
        is_accrued:
          type: boolean
          description: '`true` when the bill is accrued.'
        gl_reference:
          type:
            - string
            - 'null'
          description: Reference in the general ledger.
        gl_sync_status:
          type:
            - string
            - 'null'
          description: Sync status with the general ledger.
        created_at:
          type:
            - string
            - 'null'
          description: Time the bill was created (ISO 8601).
    VaultReceipt:
      type: object
      description: A receipt. `id` is `rct_<uuid>`.
      properties:
        id:
          type: string
          example: rct_abc123
          description: Receipt ID (`rct_…`).
        organization_id:
          type:
            - string
            - 'null'
          description: Organization ID (`org_…`).
        document_id:
          type:
            - string
            - 'null'
          description: Document ID (`doc_…`).
        vendor_id:
          type:
            - string
            - 'null'
          description: Vendor ID (`vnd_…`).
        receipt_number:
          type:
            - string
            - 'null'
          description: Receipt number.
        invoice_number:
          type:
            - string
            - 'null'
          description: Invoice number on the receipt.
        receipt_date:
          type:
            - string
            - 'null'
          description: Receipt date.
        currency:
          type:
            - string
            - 'null'
          description: Receipt currency.
        total_amount:
          type:
            - string
            - 'null'
          description: Receipt total (decimal string).
        subtotal_amount:
          type:
            - string
            - 'null'
          description: Total before tax (decimal string).
        tax_amount:
          type:
            - string
            - 'null'
          description: Tax amount (decimal string).
        tax_rate:
          type:
            - string
            - 'null'
          description: Tax rate.
        tax_type:
          type:
            - string
            - 'null'
          description: Tax type, such as VAT.
        line_items:
          description: Line items as extracted from the document.
        payment_method:
          type:
            - string
            - 'null'
          description: Payment method.
        notes:
          type:
            - string
            - 'null'
          description: Notes.
        created_at:
          type:
            - string
            - 'null'
          description: Time the receipt was created (ISO 8601).
    VaultVendor:
      type: object
      description: >-
        A vendor. `id` is `vnd_<uuid>`. List responses add `files_count` and
        `total_bills_amount`.
      properties:
        id:
          type: string
          example: vnd_abc123
          description: Vendor ID (`vnd_…`).
        organization_id:
          type:
            - string
            - 'null'
          description: Organization ID (`org_…`).
        name:
          type: string
          description: Vendor name.
        website_url:
          type:
            - string
            - 'null'
          description: Vendor website.
        is_ramp_managed:
          type: boolean
          description: '`true` when Ramp manages the vendor.'
        is_ap_vendor:
          type: boolean
          description: '`true` for an accounts-payable vendor.'
        default_gl_account:
          type:
            - string
            - 'null'
          description: Default account in the general ledger.
        payment_terms:
          type:
            - string
            - 'null'
          description: Payment terms.
        external_vendor_id:
          type:
            - string
            - 'null'
          description: Vendor ID in the general ledger.
        gl_type:
          type:
            - string
            - 'null'
          description: General-ledger provider.
        realm_id:
          type:
            - string
            - 'null'
          description: Company ID in the general ledger.
        default_expense_account_id:
          type:
            - string
            - 'null'
          description: Default expense ledger account (`lac_…`).
        last_gl_sync:
          type:
            - string
            - 'null'
          description: Last sync with the general ledger.
        gl_sync_status:
          type:
            - string
            - 'null'
          description: Sync status with the general ledger.
        created_at:
          type:
            - string
            - 'null'
          description: Time the vendor was created (ISO 8601).
        files_count:
          type: integer
          description: In list responses only.
        total_bills_amount:
          type:
            - string
            - 'null'
          description: Total of the vendor bills (decimal string). In list responses only.
    VaultBankStatement:
      type: object
      description: A bank statement. `id` is `bnk_<uuid>`.
      properties:
        id:
          type: string
          example: bnk_abc123
          description: Bank statement ID (`bnk_…`).
        document_id:
          type:
            - string
            - 'null'
          description: Document ID (`doc_…`).
        organization_id:
          type:
            - string
            - 'null'
          description: Organization ID (`org_…`).
        bank_name:
          type:
            - string
            - 'null'
          description: Bank name.
        account_number:
          type:
            - string
            - 'null'
          description: Account number.
        account_number_last_four:
          type:
            - string
            - 'null'
          description: Last four digits of the account number.
        account_name:
          type:
            - string
            - 'null'
          description: Account name.
        linked_account_id:
          type:
            - string
            - 'null'
          description: >-
            Source selected for statement imports, using the same public ID as
            the document source_id.
        statement_date:
          type:
            - string
            - 'null'
          description: Statement date.
        period_start:
          type:
            - string
            - 'null'
          description: Start of the statement period.
        period_end:
          type:
            - string
            - 'null'
          description: End of the statement period.
        opening_balance:
          type:
            - string
            - 'null'
          description: Opening balance (decimal string).
        closing_balance:
          type:
            - string
            - 'null'
          description: Closing balance (decimal string).
        currency:
          type: string
          description: Statement currency.
        account_category:
          type: string
          description: Account category, such as bank or exchange.
        reconciliation_status:
          type: string
          enum:
            - not_reconciled
            - reconciled
          readOnly: true
          description: >-
            Statement reconciliation state maintained by import and dashboard
            workflows. This is separate from import job completion.
        transactions_count:
          type:
            - integer
            - 'null'
          description: Number of extracted lines.
        expected_transaction_count:
          type:
            - integer
            - 'null'
          description: >-
            How many activity rows the source document prints, counted from the
            PDF itself rather than from the extraction. Null when no verdict
            could be reached.
        extraction_completeness:
          type: string
          enum:
            - complete
            - incomplete
            - unknown
            - not_applicable
          description: >-
            Whether the extracted lines match the document. `not_applicable` for
            a file with nothing to check against, such as a CSV.
        extraction_completeness_detail:
          type:
            - object
            - 'null'
          description: >-
            Counts of expected, missing and unexpected lines. The reason
            `legacy_pre_feature` means the check did not run.
          properties:
            reason:
              type: string
              description: Why completeness has its value.
            missing_count:
              type:
                - integer
                - 'null'
              description: Lines in the document that were not extracted.
            unexpected_count:
              type:
                - integer
                - 'null'
              description: Extracted lines that the document does not show.
            short_dates:
              type:
                - array
                - 'null'
              items:
                type: string
              description: Dates with fewer extracted lines than the document shows.
            repair_outcome:
              type:
                - string
                - 'null'
              description: Result of the automatic repair, if one ran.
        reconciled_at:
          type:
            - string
            - 'null'
          readOnly: true
          description: Recorded reconciliation timestamp, or null when none is recorded.
        reconciled_by:
          type:
            - string
            - 'null'
          readOnly: true
          description: >-
            User ID recorded for reconciliation, or null when no user is
            recorded.
        notes:
          type:
            - string
            - 'null'
          description: Notes.
        created_at:
          type:
            - string
            - 'null'
          description: Time the bank statement was created (ISO 8601).
        lines:
          $ref: '#/components/schemas/StatementImportRows'
          description: >-
            Present only with `expand=statement.lines`. By default, an import
            takes only pending rows that are not invalid.
    StatementImportRows:
      type: object
      additionalProperties: false
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/StatementImportRow'
          description: Lines on this page.
        count:
          type: integer
          minimum: 0
          description: Number of lines that match the filters.
        has_more:
          type: boolean
          description: Whether another page of lines is available.
        next_cursor:
          type:
            - string
            - 'null'
          description: >-
            Pass as `statement_cursor` with the same `document_ids` and
            `expand`.
      required:
        - data
        - count
        - has_more
        - next_cursor
    StatementImportRow:
      type: object
      additionalProperties: false
      description: >-
        An extracted statement row for review or import selection. Not an
        imported transaction.
      properties:
        id:
          type: string
          pattern: ^bkl_[A-Za-z0-9-]+$
          description: Statement line ID (`bkl_…`). Use it in `statement_line_ids`.
        statement_id:
          type: string
          description: Statement ID (`bnk_…`).
        transaction_date:
          type: string
          format: date
          description: Date of the line.
        description:
          type:
            - string
            - 'null'
          description: Description on the statement.
        amount:
          type:
            - string
            - 'null'
          pattern: ^-?[0-9]+(?:\.[0-9]+)?$
          description: >-
            Statement amount, not necessarily asset quantity. Null when
            extraction could not establish it.
        transaction_type:
          type: string
          enum:
            - debit
            - credit
          description: '`debit` or `credit`.'
        validation_state:
          type:
            - string
            - 'null'
          description: >-
            `invalid` rows cannot be imported. Null means no validation verdict
            was stored; it does not exclude the row.
          enum:
            - valid
            - invalid
            - null
        validation_reasons:
          type:
            - array
            - 'null'
          items:
            type: string
          description: Why the line is invalid.
        import_status:
          type: string
          enum:
            - pending
            - imported
            - ignored
            - duplicate
          description: Import status of the line.
        imported_transaction_id:
          type:
            - string
            - 'null'
          description: Created or matched transaction, when available.
        imported_sequence_number:
          type:
            - string
            - 'null'
          description: Sequence number of the imported transaction.
        reconciliation_status:
          type:
            - string
            - 'null'
          description: >-
            Stored row reconciliation state. Import completion does not prove
            statement completeness.
        reference_number:
          type:
            - string
            - 'null'
          description: Reference number on the statement.
        category:
          type:
            - string
            - 'null'
          description: Category on the statement.
        counterparty:
          type:
            - string
            - 'null'
          description: Counterparty on the statement.
        imported_at:
          type:
            - string
            - 'null'
          description: Time the line was imported.
        created_at:
          type:
            - string
            - 'null'
          description: Time the statement line was created (ISO 8601).
        is_reconciled:
          type: boolean
          description: '`true` when the line is reconciled.'
      required:
        - id
        - statement_id
        - transaction_date
        - description
        - amount
        - transaction_type
        - validation_state
        - validation_reasons
        - import_status
        - imported_transaction_id
        - imported_sequence_number
        - reconciliation_status
        - reference_number
        - category
        - counterparty
        - imported_at
        - created_at
        - is_reconciled
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Your organization API key. Some operations also need a key that is
        associated with a user; their pages say so.

````