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

# Import a file

> A CSV of identities or a JSONL file with one batch item per line, processed in the background.



## OpenAPI

````yaml openapi/en/cell.json POST /v1/ingest/files
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-1
        description: The region of the space, which also comes in the key.
security: []
paths:
  /v1/ingest/files:
    post:
      tags:
        - ingest
      summary: Import a file
      description: >-
        A CSV that seeds identity (one `identify` per row, 5.3) or JSONL with
        one batch item per line.

        The body streams into object storage; `import_file` ingests it and the
        GET below follows it.


        **Authentication.** Source key: `Authorization: Bearer nia_sk_...`.
        Required scope: `track`.
      operationId: upload_file_v1_ingest_files_post
      requestBody:
        content:
          application/x-ndjson:
            schema:
              type: string
          text/csv:
            schema:
              type: string
        required: true
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileImportOut'
              example:
                import_id: 0192f7a1-5b10-7c3a-8e21-4d2f8a4c0e0a
                format: csv
                status: queued
                size_bytes: 1842201
                sha256: >-
                  9c1e5a7b3d2f40e18a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b7c6d5e4f
                records: 0
                accepted: 0
                duplicates: 0
                rejected: 0
                errors: []
                created_at: '2026-09-22T12:00:04Z'
                finished_at: null
          description: >-
            The file is stored and queued; follow it with `GET
            /v1/ingest/files/{import_id}`.
      security:
        - sourceKey: []
components:
  schemas:
    FileImportOut:
      additionalProperties: false
      description: >-
        `POST /v1/ingest/files` answers 202 with this; `GET
        /v1/ingest/files/{import_id}` follows it.
      properties:
        accepted:
          title: Accepted
          type: integer
        created_at:
          format: date-time
          title: Created At
          type: string
        duplicates:
          title: Duplicates
          type: integer
        errors:
          description: The first 100 rejected rows; values are never echoed.
          items:
            $ref: '#/components/schemas/RowError'
          title: Errors
          type: array
        finished_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Finished At
        format:
          enum:
            - csv
            - jsonl
          title: Format
          type: string
        import_id:
          format: uuid
          title: Import Id
          type: string
        records:
          description: Records in the file, blank lines included.
          title: Records
          type: integer
        rejected:
          title: Rejected
          type: integer
        sha256:
          title: Sha256
          type: string
        size_bytes:
          title: Size Bytes
          type: integer
        status:
          enum:
            - queued
            - running
            - completed
            - failed
          title: Status
          type: string
      required:
        - import_id
        - status
        - format
        - size_bytes
        - sha256
        - records
        - accepted
        - duplicates
        - rejected
        - errors
        - created_at
      title: FileImportOut
      type: object
    RowError:
      additionalProperties: false
      properties:
        code:
          title: Code
          type: string
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
        row:
          description: 1-based row of the file, header excluded; 0 for the whole import.
          title: Row
          type: integer
      required:
        - row
        - code
      title: RowError
      type: object
  securitySchemes:
    sourceKey:
      type: http
      scheme: bearer
      description: nia_sk_...

````