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

# Ingest Document

> Upload a document and start processing it.



## OpenAPI

````yaml post /api/v1/documents/ingest
openapi: 3.1.0
info:
  title: Fieldwise API
  description: API for the Fieldwise platform.
  version: 1.0.0
servers:
  - url: https://api.fieldwise.ai
security:
  - ApiKeyAuth: []
paths:
  /api/v1/documents/ingest:
    post:
      tags:
        - Documents
      summary: Ingest Document
      description: Upload a document and start processing it.
      operationId: ingest_document_api_v1_documents_ingest_post
      parameters:
        - name: X-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Body_ingest_document_api_v1_documents_ingest_post
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadResponse'
        '400':
          description: Invalid request or unsupported file type
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
        '401':
          description: Unauthorized access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
        '422':
          description: Unprocessable entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
components:
  schemas:
    Body_ingest_document_api_v1_documents_ingest_post:
      properties:
        file:
          type: string
          format: binary
          title: File
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
        metadata:
          anyOf:
            - type: string
            - type: 'null'
          title: Metadata
      type: object
      required:
        - file
      title: Body_ingest_document_api_v1_documents_ingest_post
    UploadResponse:
      properties:
        success:
          type: boolean
          title: Success
          default: true
        data:
          allOf:
            - $ref: '#/components/schemas/UploadResponseData'
          description: Response data
        error:
          anyOf:
            - $ref: '#/components/schemas/ErrorDetail'
            - type: 'null'
        meta:
          $ref: '#/components/schemas/MetaData'
      type: object
      required:
        - data
      title: UploadResponse
    ErrorDetail:
      properties:
        message:
          type: string
          title: Message
          description: Error message
        error_code:
          type: string
          title: Error Code
          description: Error code identifier
        details:
          anyOf:
            - items:
                type: object
              type: array
            - type: 'null'
          title: Details
          description: Additional error details
      type: object
      required:
        - message
        - error_code
      title: ErrorDetail
      description: Schema for API error responses.
      example:
        error_code: RESOURCE_NOT_FOUND
        message: Resource not found
    UploadResponseData:
      properties:
        task_identifier:
          anyOf:
            - type: string
            - type: 'null'
          title: Task Identifier
          description: >-
            Task identifier for tracking progress (null for synchronous
            operations)
        file_path:
          anyOf:
            - type: string
            - type: 'null'
          title: File Path
          description: Path where the file is stored (null for embedding-based documents)
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
          description: External identifier if provided
      type: object
      title: UploadResponseData
    MetaData:
      properties:
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        version:
          type: string
          title: Version
          default: '1.0'
      type: object
      title: MetaData
      description: Metadata for API responses
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````