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

# List file imports

> Returns a cursor-paginated list of file imports for a data stream, newest first. Rows on this stream-scoped route additionally carry the ClickHouse aggregates (record_count, total_credits, total_debits, net_amount, date_range_start, date_range_end, currency).



## OpenAPI

````yaml /openapi.json get /data_streams/{key}/file_imports
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:
  /data_streams/{key}/file_imports:
    get:
      summary: List file imports
      description: >-
        Returns a cursor-paginated list of file imports for a data stream,
        newest first. Rows on this stream-scoped route additionally carry the
        ClickHouse aggregates (record_count, total_credits, total_debits,
        net_amount, date_range_start, date_range_end, currency).
      parameters:
        - in: path
          name: key
          required: true
          schema:
            type: string
          description: The immutable data stream key
        - in: query
          name: limit
          schema:
            type: integer
            minimum: 1
            maximum: 200
            default: 50
        - in: query
          name: cursor
          schema:
            type: string
          description: >-
            Opaque cursor from a previous response's `next_cursor`. Pass it back
            unchanged; `next_cursor: null` is the only terminator.
        - in: query
          name: status
          schema:
            type: string
            enum:
              - pending
              - processing
              - replicating
              - completed
              - failed
              - cancelled
        - in: query
          name: source
          schema:
            type: string
          description: Filter by import source (e.g. `csv`, `nacha`, `bulk_api`)
        - in: query
          name: created_after
          schema:
            type: string
            format: date-time
          description: ISO8601; inclusive
        - in: query
          name: created_before
          schema:
            type: string
            format: date-time
          description: ISO8601; inclusive
      responses:
        '200':
          description: Cursor-paginated list of file imports
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/FileImport'
                  next_cursor:
                    type: string
                    nullable: true
                    description: Pass as `cursor` for the next page; null on the last page
                  limit:
                    type: integer
        '401':
          description: Unauthorized
        '404':
          description: Data stream not found
components:
  schemas:
    FileImport:
      type: object
      description: >-
        A file import (CSV/NACHA upload or bulk API submission) and its
        ingestion lifecycle. Aggregate fields (record_count, total_credits,
        total_debits, net_amount, date_range_start, date_range_end, currency)
        are merged in only on the stream-scoped index GET
        /data_streams/{key}/file_imports, and are trustworthy once status is
        `completed`.
      properties:
        id:
          type: integer
        status:
          type: string
          enum:
            - pending
            - processing
            - replicating
            - completed
            - failed
            - cancelled
        source:
          type: string
          nullable: true
          description: Origin of the import (e.g. `csv`, `nacha`, `bulk_api`)
        filename:
          type: string
          nullable: true
        total_items:
          type: integer
        processed_items:
          type: integer
        successful_items:
          type: integer
        failed_items:
          type: integer
        skipped_items:
          type: integer
          description: >-
            Records skipped due to `on_conflict: skip` matching an existing
            `external_id`
        expected_records_count:
          type: integer
          nullable: true
        progress:
          type: integer
          description: processed_items / total_items as a percentage (0-100)
        parsing:
          type: boolean
          description: True until rows start landing; file totals are unknown while parsing
        decimal_places:
          type: integer
          description: Number of decimal places (2 for USD)
        stuck:
          type: boolean
          description: Currently processing with no heartbeat for >5 minutes
        on_conflict:
          type: string
          nullable: true
        error_message:
          type: string
          nullable: true
        error_details:
          type: object
          nullable: true
        data_stream_ids:
          type: array
          items:
            type: integer
        created_at:
          type: string
          format: date-time
        started_at:
          type: string
          format: date-time
          nullable: true
        records_written_at:
          type: string
          format: date-time
          nullable: true
        completed_at:
          type: string
          format: date-time
          nullable: true
        last_progress_at:
          type: string
          format: date-time
          nullable: true
        cancellation_requested_at:
          type: string
          format: date-time
          nullable: true
        url:
          type: string
          description: e.g. /v1/file_imports/123
        records_url:
          type: string
          description: e.g. /v1/file_imports/123/records
        record_count:
          type: integer
          description: Aggregate; stream-scoped index only
        total_credits:
          type: integer
          description: Aggregate, in cents; stream-scoped index only
        total_debits:
          type: integer
          description: Aggregate, in cents; stream-scoped index only
        net_amount:
          type: integer
          description: 'Aggregate: credits minus debits, in cents; stream-scoped index only'
        date_range_start:
          type: string
          format: date
          nullable: true
          description: Aggregate; stream-scoped index only
        date_range_end:
          type: string
          format: date
          nullable: true
          description: Aggregate; stream-scoped index only
        currency:
          type: string
          nullable: true
          description: Aggregate; stream-scoped index only
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````