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

# Start Ingestion

> Once you've added files to a memory, call this endpoint to begin ingesting the files.



## OpenAPI

````yaml POST /memories/start-ingestion
openapi: 3.1.0
info:
  title: duohub Retriever API
  description: >-
    Retrieve assisted or non-assisted memory from a duohub knowledge graph. For
    best performance, use the official `duohub` Python package.
  version: 1.0.0
servers:
  - url: https://api.duohub.ai
security:
  - APIKeyHeader: []
paths:
  /memories/start-ingestion:
    post:
      tags:
        - Memories
      summary: Start Ingestion
      description: Start ingestion process for a memory and check token quota
      operationId: startIngestion
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - memoryID
              properties:
                memoryID:
                  type: string
                  description: ID of the memory to start ingestion for
            example:
              memoryID: mem-123
      responses:
        '200':
          description: Ingestion started successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - success
                  message:
                    type: string
                    description: Success message
                  data:
                    type: object
                    properties:
                      tokenMetrics:
                        type: object
                        properties:
                          tokensForIngestion:
                            type: integer
                            description: Tokens that will be used by this job
                          tokensRemaining:
                            type: integer
                            description: Tokens still available for use
                          totalTokenLimit:
                            type: integer
                            description: User's total token limit
                      sampleCount:
                        type: integer
                        description: Number of samples to be processed
                required:
                  - status
                  - message
                  - data
                example:
                  status: success
                  message: Sample batch processing started
                  data:
                    tokenMetrics:
                      tokensForIngestion: 5000
                      tokensRemaining: 95000
                      totalTokenLimit: 100000
                    sampleCount: 10
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message
                  status:
                    type: string
                    enum:
                      - bad_request
                      - quota_exceeded
                  data:
                    type: object
                    properties:
                      tokensNeeded:
                        type: integer
                        description: Total tokens needed for ingestion
                      tokensAvailable:
                        type: integer
                        description: Available tokens in quota
                      tokensExceeded:
                        type: integer
                        description: Number of tokens exceeding quota
                required:
                  - error
                  - status
                examples:
                  missing_memory_id:
                    value:
                      error: memoryID is required
                      status: bad_request
                  no_samples:
                    value:
                      error: No samples found for this memory
                      status: bad_request
                  quota_exceeded:
                    value:
                      error: Token quota exceeded
                      status: quota_exceeded
                      data:
                        tokensNeeded: 15000
                        tokensAvailable: 10000
                        tokensExceeded: 5000
components:
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: 'Your duohub API key. Type: str'

````