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

# Convert PDF files to markdown

> Convert PDF files to Markdown format for use in alignment and fine-tuning.

> ⚠️ We recommend using the data jobs API instead.
>
> When using `POST /v1/flow/data-jobs/{id}/add-files`, ingestion is triggered automatically — you do not need to call this endpoint directly. See [Create instruction fine-tuning data](/flow/sdk/data-engine/standard-instruction-finetuning) for the data jobs workflow.

Submit one or more uploaded file IDs to start an ingestion job. The system converts each file to markdown for use in downstream workflows like fine-tuning.

The response includes a `file_records` array with per-file tracking. Each record contains the file's status, timestamps for each state transition, and error diagnostics if a failure occurs.

For job states, error codes, and SDK examples, see [Monitor ingestion](/flow/sdk/data-engine/monitor-ingestion).


## OpenAPI

````yaml post /v1/flow/alignment/ingestion
openapi: 3.1.0
info:
  title: SeekrFlow API
  description: SeekrFlow API Documentation
  termsOfService: http://www.seekr.com/support
  contact:
    name: Seekr API Support
    url: http://www.seekr.com/contact
    email: contact@seekr.com
  version: 5.87.1
servers:
  - url: https://flow.seekr.com
    description: SeekrBuild server base URL
security: []
paths:
  /v1/flow/alignment/ingestion:
    post:
      tags:
        - Alignment
      summary: Convert PDF files to markdown
      description: >-
        Convert PDF files to Markdown format for use in alignment and
        fine-tuning.
      operationId: ingest_files_v1_flow_alignment_ingestion_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IngestionRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IngestionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    IngestionRequest:
      properties:
        files:
          items:
            type: string
          type: array
          title: Files
          description: List of file ids to use for alignment
        method:
          type: string
          title: Method
          description: Method to use for ingestion
          default: best
      additionalProperties: true
      type: object
      required:
        - files
      title: IngestionRequest
    IngestionResponse:
      properties:
        id:
          type: string
          title: Id
          description: Ingestion job ID
        created_at:
          type: string
          format: date-time
          title: Created At
        status:
          $ref: '#/components/schemas/IngestionJobStatus'
        output_files:
          items:
            type: string
          type: array
          title: Output Files
        file_records:
          anyOf:
            - items:
                $ref: '#/components/schemas/IngestionFileRecord'
              type: array
            - type: 'null'
          title: File Records
          description: Detailed file records with queue positions
      additionalProperties: true
      type: object
      required:
        - id
        - created_at
        - status
        - output_files
      title: IngestionResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    IngestionJobStatus:
      type: string
      enum:
        - queued
        - running
        - completed
        - failed
      title: IngestionJobStatus
    IngestionFileRecord:
      properties:
        record_id:
          type: string
          title: Record Id
          description: File record ID
        ingestion_job_id:
          type: string
          title: Ingestion Job Id
          description: Parent ingestion job ID
        alignment_file_id:
          type: string
          title: Alignment File Id
          description: Alignment file ID
        user_id:
          type: string
          title: User Id
          description: Owner of the ingestion job
        filename:
          type: string
          title: Filename
          description: Filename
        metaflow_job_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Metaflow Job Id
          description: Metaflow job handling this file
        method:
          anyOf:
            - type: string
            - type: 'null'
          title: Method
          description: Ingestion method used for processing
        status:
          type: string
          title: Status
          description: File processing status
        queue_position:
          anyOf:
            - type: integer
            - type: 'null'
          title: Queue Position
          description: Position in queue if status is queued
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
          description: Error message if failed
        suggested_fix:
          anyOf:
            - type: string
            - type: 'null'
          title: Suggested Fix
          description: Suggested fix when processing fails
        worker_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Worker Id
          description: Worker currently handling the file
        deleted:
          type: boolean
          title: Deleted
          description: Whether this record has been soft-deleted
          default: false
        created_at:
          type: string
          format: date-time
          title: Created At
        processing_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Processing At
          description: Timestamp when processing started
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Completed At
          description: Timestamp when processing completed
        failed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Failed At
          description: Timestamp when processing failed
      additionalProperties: true
      type: object
      required:
        - record_id
        - ingestion_job_id
        - alignment_file_id
        - user_id
        - filename
        - status
        - created_at
      title: IngestionFileRecord
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      description: Seekr API Key without 'Bearer' Prefix
      in: header
      name: Authorization

````