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

> ## Agent Instructions
> Conare's API is at https://api.conare.ai. Authenticate with `Authorization: Bearer $CONARE_API_KEY`.
> The full OpenAPI spec is at https://api.conare.ai/openapi.yaml; each endpoint has a page under /api-reference, and appending .md to any page URL returns its Markdown.
> Embed with model conare-embed-1; send input_type "query" for search queries. Rerank with conare-rerank-1.
> Prefer the TypeScript SDK (`npm install conare`) or plain HTTP in examples.
> Install the Conare skill with `npx skills add https://docs.conare.ai`; search these docs over MCP at https://docs.conare.ai/mcp; the whole site is at https://docs.conare.ai/llms-full.txt.

# Import an upload

> Imports a completed upload of JSON lines, one `CustomDocumentInput` a line, as pushes of 100.

- `snapshot` also deletes what the file does not hold.
- Follow it with `GET /runs/{id}`; per-line results and failures page at `/runs/{id}/results` and `/failures`.




## OpenAPI

````yaml /openapi.yaml post /sources/{id}/imports
openapi: 3.1.0
info:
  title: Conare API
  version: '1'
  summary: Store your data, keep it in sync, and return the right context to your AI.
  description: >
    Write documents into namespaces, search them, and sync apps into them.


    - Base URL `https://api.conare.ai`; send `Authorization: Bearer sk-conare-…`
    (keys at conare.ai/dashboard/keys).

    - A multi-organization key sends `X-Conare-Org: <organization id>` on every
    request (`GET /organizations` lists them).

    - Bodies are JSON in snake_case; an unknown field is 400 `invalid_json`
    (`/v1` and `/v2` ignore it). Errors are `{"error": {"code", "message",
    "request_id"}}`.

    - Send every write with an `Idempotency-Key` and retry with the same key: a
    repeat within 24 hours replays the first answer.

    - 429 and 503 carry `Retry-After` (seconds).

    - `Conare-Degraded` marks a success that skipped or slowed part of search,
    e.g. `rerank` or `embed-busy`.
  contact:
    name: Conare
    url: https://conare.ai
servers:
  - url: https://api.conare.ai
security:
  - apiKey: []
tags:
  - name: Namespaces
    description: >-
      A namespace is a named set of documents, e.g. `docs` or `user-42`; the
      first write creates it.
  - name: Documents
    description: >-
      A document is `{ id, text, metadata }`, chunked and embedded on write;
      writing the same id replaces it.
  - name: Query
    description: >-
      Hybrid search (vector and keyword) over your namespaces, filtered by
      metadata and reranked.
  - name: Models
    description: >-
      Embed and rerank text with Conare's models, through Conare's own routes or
      OpenAI- and Cohere-compatible ones.
  - name: Sources
    description: Apps, buckets and custom sources, each kept in sync into one namespace.
  - name: Custom sources
    description: >-
      Documents you push from your own system, keyed by your `external_id`, with
      snapshot runs to mirror a whole set.
  - name: Parse
    description: Parse a file to Markdown without storing it.
  - name: Files
    description: >-
      Upload a file and Conare stores it as one document, each hit citing its
      page, slide, sheet rows or section.
  - name: Users
    description: >-
      Delete everything Conare holds of one of your users, across every
      namespace and source.
  - name: Events
    description: What changed, in order (`seq`), to read from a cursor.
  - name: Health
    description: Service health.
  - name: Organizations
    description: The organizations a key acts for.
paths:
  /sources/{id}/imports:
    parameters:
      - $ref: '#/components/parameters/SourceId'
    post:
      tags:
        - Custom sources
      summary: Import an upload
      description: >
        Imports a completed upload of JSON lines, one `CustomDocumentInput` a
        line, as pushes of 100.


        - `snapshot` also deletes what the file does not hold.

        - Follow it with `GET /runs/{id}`; per-line results and failures page at
        `/runs/{id}/results` and `/failures`.
      operationId: createImport
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - upload
              properties:
                upload:
                  type: string
                  description: An upload id (`upl_…`), completed with purpose `import`.
                mode:
                  type: string
                  enum:
                    - delta
                    - snapshot
                  default: delta
                expected:
                  type: integer
                  format: int64
                  minimum: 0
                allow_mass_delete:
                  type: boolean
                  default: false
      responses:
        '202':
          description: The import run, queued.
          content:
            application/json:
              schema:
                type: object
                required:
                  - run
                properties:
                  run:
                    $ref: '#/components/schemas/Run'
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
        '409':
          $ref: '#/components/responses/Error'
components:
  parameters:
    SourceId:
      name: id
      in: path
      required: true
      description: The source id, `src_…`.
      schema:
        type: string
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        One key (a UUID) per logical write, sent again on each retry: a repeat
        within 24 hours replays the first successful answer.
      schema:
        type: string
        minLength: 1
        maxLength: 255
        pattern: ^[\x21-\x7e]+$
      example: 3f2c9a0e-6a1b-4f7e-9c55-0b8f1d2e7a41
  schemas:
    Run:
      type: object
      required:
        - id
        - source_id
        - kind
        - trigger
        - state
        - phase
        - attempt
        - sweep
        - sweep_reason
        - expected
        - counts
        - error
        - created_at
        - started_at
        - finished_at
      properties:
        id:
          type: string
          examples:
            - run_8c1e0f3a2b4d5c6e7f8a9b0c
        source_id:
          type:
            - string
            - 'null'
        kind:
          type: string
          enum:
            - snapshot
            - import
            - delete
            - purge
        trigger:
          type: string
          enum:
            - api
            - schedule
            - janitor
            - purge
            - connect
        state:
          type: string
          enum:
            - queued
            - running
            - succeeded
            - failed
            - canceled
        phase:
          type:
            - string
            - 'null'
          examples:
            - receiving
            - sweeping
            - draining
            - deleting
            - waiting
            - verifying
            - reverifying
        attempt:
          type: integer
        sweep:
          type: string
          enum:
            - none
            - applied
            - held
            - blocked
          description: >-
            A snapshot's deletes: `applied`, `held` (over 10% and 1,000 at once,
            until a run 24 h later agrees) or `blocked` (none).
        sweep_reason:
          type:
            - string
            - 'null'
        expected:
          type:
            - integer
            - 'null'
          format: int64
        counts:
          type: object
          description: >-
            What the run did, e.g. `seen`, `planned`, `deleted`; an import's
            `lines`, `created`, `updated`, `rejected`.
          additionalProperties:
            type: integer
        error:
          type:
            - object
            - 'null'
          description: '`{code, message}` of a failed run.'
        progress:
          type: object
          description: A running import's progress, measured over the last minute.
          properties:
            done:
              type: integer
            expected:
              type: integer
            rate_per_s:
              type: number
            eta_s:
              type: number
            eta_is_estimate:
              type: boolean
              const: true
        created_at:
          type: string
          format: date-time
        started_at:
          type:
            - string
            - 'null'
          format: date-time
        finished_at:
          type:
            - string
            - 'null'
          format: date-time
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - request_id
          properties:
            code:
              type: string
              description: >
                Stable, machine-readable, by status:


                - 400: `invalid_request`, `fetch_failed`, `invalid_json`,
                `invalid_namespace`, `invalid_id`, `invalid_metadata`,
                `invalid_filter`, `invalid_cursor`, `invalid`, `md5_mismatch`,
                `idempotency_key_required`, `invalid_path`

                - 401: `unauthorized`, `invalid_upload`

                - 402 (billed calls only): `credits_exhausted`,
                `spend_cap_reached`, `monthly_limit_reached`, `payment_failed`

                - 403: `forbidden`, `namespace_forbidden`,
                `key_scope_models_only`, `namespace_not_allowed`

                - 404: `namespace_not_found`, `document_not_found`,
                `source_not_found`, `model_not_found`, `key_not_found`,
                `file_not_found`, `parse_not_found`, `not_found`

                - 405: `method_not_allowed`

                - 409: `version_conflict`, `conflict`,
                `idempotency_in_progress`, `run_active`, `run_not_receiving`,
                `source_deleting`, `user_purging`, `upload_incomplete`,
                `namespace_has_sources`, `too_many_exclusions`, `push_source`,
                `pull_source`, `files_source`, `no_original`, `file_replaced`,
                `gcs_bucket_claimed`, `limit_reached`

                - 410: `upload_expired`, `model_retired`

                - 413: `payload_too_large`, `too_large`

                - 415: `unsupported_file`, `type_mismatch`,
                `unsupported_encoding`

                - 422: `idempotency_key_reused`, `no_text`, `unreadable_file`,
                `password_protected`, `gcs_access_denied`, `gcs_not_verified`,
                `gcs_bucket_not_found`

                - 429: `rate_limited`

                - 500: `internal_error`; 502: `upstream_error`; 501:
                `models_only`

                - 503: `unavailable`, `sources_unavailable`, `timeout`,
                `embed_unavailable`, `sync_storage_unavailable`,
                `sync_unconfigured`, `files_unconfigured`, `files_unavailable`,
                `gcs_unconfigured`, `gcs_unavailable`, `gcs_auth_failed`
            message:
              type: string
            request_id:
              type: string
  responses:
    Error:
      description: An error. `X-Request-Id` is also in the response headers.
      headers:
        X-Request-Id:
          schema:
            type: string
        Retry-After:
          description: Seconds to wait before retrying (429, 503).
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: invalid_request
              message: text is required
              request_id: 7d0f4c1e-2b8a-4e39-9a61-3c5e8b2f9d04
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: sk-conare-…
      description: >-
        A key from conare.ai/dashboard/keys with full access, some namespaces,
        or models only (`/embed`, `/rerank`, `/v1`, `/v2/rerank`, `/parse`).

````

## Related topics

- [List an import's failures](https://docs.conare.ai/ar/api-reference/custom-sources/list-an-imports-failures.md)
- [List an import's results](https://docs.conare.ai/ar/api-reference/custom-sources/list-an-imports-results.md)
- [Start an upload](https://docs.conare.ai/ar/api-reference/custom-sources/start-an-upload.md)
- [Complete an upload](https://docs.conare.ai/ar/api-reference/custom-sources/complete-an-upload.md)
- [Get an upload](https://docs.conare.ai/ar/api-reference/custom-sources/get-an-upload.md)


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