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

# Ingest Sources

> Enqueue a batch of sources for asynchronous ingestion. Fire-and-forget: returns 202 with a job_id you can poll via GET /jobs/{job_id}.



## OpenAPI

````yaml https://api.crosmos.dev/openapi.json post /api/v1/sources
openapi: 3.1.0
info:
  title: Crosmos API
  version: 0.1.0
servers:
  - url: /
security: []
paths:
  /api/v1/sources:
    post:
      tags:
        - sources
      summary: Ingest Sources
      description: >-
        Enqueue a batch of sources for asynchronous ingestion. Fire-and-forget:
        returns 202 with a job_id you can poll via GET /jobs/{job_id}.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IngestSourcesRequest'
      responses:
        '202':
          description: Accepted — job enqueued
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IngestAcceptedResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SourceErrorBody'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SourceErrorBody'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SourceErrorBody'
        '429':
          description: Rate limited / quota / pending cap
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/RateLimitedBody'
                  - $ref: '#/components/schemas/QuotaExceededBody'
                  - $ref: '#/components/schemas/SourceErrorBody'
        '503':
          description: Queue full
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SourceErrorBody'
      security:
        - bearerAuth: []
components:
  schemas:
    IngestSourcesRequest:
      type: object
      properties:
        space_id:
          type: string
          format: uuid
        sources:
          type: array
          items:
            $ref: '#/components/schemas/SourcePayload'
          minItems: 1
          maxItems: 100
      required:
        - space_id
        - sources
    IngestAcceptedResponse:
      type: object
      properties:
        job_id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - pending
        source_ids:
          type: array
          items:
            type: string
            format: uuid
        jobs:
          type: array
          items:
            type: object
            properties:
              job_id:
                type: string
                format: uuid
              source_ids:
                type: array
                items:
                  type: string
                  format: uuid
            required:
              - job_id
              - source_ids
          description: One entry per job the request was split into.
      required:
        - job_id
        - status
        - source_ids
        - jobs
    SourceErrorBody:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
    RateLimitedBody:
      type: object
      properties:
        detail:
          type: object
          properties:
            error:
              type: string
              enum:
                - rate_limited
            scope:
              type: string
              enum:
                - rpm
                - day
            limit:
              type: integer
            count:
              type: integer
          required:
            - error
            - scope
            - limit
            - count
      required:
        - detail
    QuotaExceededBody:
      type: object
      properties:
        detail:
          type: object
          properties:
            error:
              type: string
              enum:
                - quota_exceeded
            key:
              type: string
            limit:
              type: integer
            used:
              type: integer
          required:
            - error
            - key
            - limit
            - used
      required:
        - detail
    SourcePayload:
      type: object
      properties:
        content:
          type: string
          minLength: 1
          maxLength: 100000
        content_type:
          type: string
          enum:
            - text
            - markdown
            - conversation
            - html
            - json
            - pdf
            - image
            - audio
            - video
          default: text
          description: Today only `text` and `markdown` are processable.
        role:
          type: string
          minLength: 1
          maxLength: 50
        visibility:
          $ref: '#/components/schemas/MemoryVisibility'
        meta:
          type: object
          nullable: true
          additionalProperties:
            nullable: true
      required:
        - content
    MemoryVisibility:
      type: string
      enum:
        - private
        - org
      default: private
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: JWT access token or API key (csk_...)

````

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