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

# Create Source Batch

> Creates a new source batch container for organizing and managing related document sources. A source batch acts as a logical grouping that must be created before uploading any sources. The returned `source_batch_id` is required when creating sources and can be used to reference all contained sources in chat or search requests.

**Workflow:**
1. Create a source batch (this endpoint)
2. Upload sources to the batch using the returned `source_batch_id`
3. Use the `source_batch_id` in chat/search API requests to access all sources in the batch



## OpenAPI

````yaml POST /v1/source_batches
openapi: 3.0.1
info:
  title: LinqAlpha API
  description: >-
    Linq helps finance professionals make informed decisions using
    Retrieval-Augmented Generation (RAG)-enhanced answers. By leveraging
    cutting-edge Large Language Models (LLM) and supplementary technology, Linq
    provides the most optimized responses based on your queries.
  version: 1.0.0
  license:
    name: MIT
servers:
  - url: https://api.linqalpha.com
security:
  - ApiKeyAuth: []
tags:
  - name: Search
    description: Search and generate responses
  - name: Data
    description: Data retrieval and mapping
  - name: Feedback
    description: Conversation feedback
  - name: RMS
    description: Research Management System
  - name: Source Management
    description: Source batch and file management
  - name: MCP
    description: >-
      LinqAlpha MCP — Financial data tools for AI assistants via Model Context
      Protocol
  - name: Connectors
    description: Customer Connectors — customer-owned MCP connector management
  - name: Briefing
    description: Briefing Agent — automated market briefings with scheduling and delivery
  - name: Status
    description: Sync status — check organization, document, and container sync progress
paths:
  /v1/source_batches:
    post:
      tags:
        - Source Management
      summary: Create Source Batch
      description: >-
        Creates a new source batch container for organizing and managing related
        document sources. A source batch acts as a logical grouping that must be
        created before uploading any sources. The returned `source_batch_id` is
        required when creating sources and can be used to reference all
        contained sources in chat or search requests.


        **Workflow:**

        1. Create a source batch (this endpoint)

        2. Upload sources to the batch using the returned `source_batch_id`

        3. Use the `source_batch_id` in chat/search API requests to access all
        sources in the batch
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSourceBatchRequest'
            example:
              name: Q4_Financial_Reports
              description: Financial documents for Q4 2024 analysis
      responses:
        '200':
          description: Source batch created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSourceBatchResponse'
              example:
                source_batch_id: 123e4567-e89b-12d3-a456-426614174000
        '400':
          description: Bad request - invalid parameters
        '401':
          description: Unauthorized - invalid or missing API key
components:
  schemas:
    CreateSourceBatchRequest:
      type: object
      properties:
        user_id:
          type: string
          description: User ID
          example: 123e4567-e89b-12d3-a456-426614174000
        organization_id:
          type: string
          format: uuid
          description: Organization ID
          example: 123e4567-e89b-12d3-a456-426614174000
        user_email:
          type: string
          description: User email
          example: john.doe@example.com
        user_name:
          type: string
          description: User name
          example: John Doe
        name:
          type: string
          description: >-
            Descriptive name for the source batch (e.g., project name, document
            category)
          minLength: 1
          maxLength: 255
          example: Q4_Financial_Reports
        description:
          type: string
          description: >-
            Optional detailed description of the source batch purpose and
            contents
          maxLength: 1000
          example: >-
            Financial documents including revenue reports, expense summaries,
            and forecasts for Q4 2024
      required:
        - name
    CreateSourceBatchResponse:
      type: object
      properties:
        source_batch_id:
          type: string
          format: uuid
          description: >-
            Unique identifier for the created source batch. Use this ID when
            uploading sources and referencing the batch in chat/search requests.
          example: 123e4567-e89b-12d3-a456-426614174000
      required:
        - source_batch_id
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````