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

# Create Data Source Batch

> Creates multiple data sources in a single request



## OpenAPI

````yaml POST /api/v1/data-sources/batch
openapi: 3.0.1
info:
  title: Knowledge Engine API
  description: Public API endpoints for managing knowledge engines
  version: 1.0.0
servers:
  - url: https://api.getdecisional.ai
security: []
paths:
  /api/v1/data-sources/batch:
    post:
      summary: Create multiple data sources
      description: Creates multiple data sources in a single request
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - files[]
                - data
              properties:
                files[]:
                  type: array
                  items:
                    type: string
                    format: binary
                  description: Array of files to upload
                data:
                  type: string
                  description: >-
                    JSON string containing an array of data sources metadata. 

                     **Example**: 
                    ```

                    [{"name":"Doc
                    1","type":"file","knowledge_engine_id":"kng_abc123xyz789"},{"name":"Doc
                    2","type":"file","knowledge_engine_id":"kng_abc123xyz789"}]

                    ```
                  example: >-
                    [{"name":"Doc
                    1","type":"file","knowledge_engine_id":"kng_abc123xyz789"},{"name":"Doc
                    2","type":"file","knowledge_engine_id":"kng_abc123xyz789"}]
            example:
              files[]:
                - <file1 binary>
                - <file2 binary>
              data: >-
                [{"name":"Doc
                1","type":"file","knowledge_engine_id":"kng_abc123xyz789"},{"name":"Doc
                2","type":"file","knowledge_engine_id":"kng_abc123xyz789"}]
      responses:
        '202':
          description: Data sources accepted for processing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataSourceBatchResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    DataSourceBatchResponse:
      type: array
      items:
        type: object
        properties:
          name:
            type: string
            description: Name of the data source
          success:
            type: boolean
            description: Data source creation status
          error:
            type: string
            description: Error message if the data source was not created successfully
          data_source:
            $ref: '#/components/schemas/DataSourceResponse'
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message
          example: >-
            Invalid knowledge engine name: exceeds maximum length of 50
            characters
    DataSourceResponse:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the data source
          example: ds_abc123xyz789
        name:
          type: string
          description: Name of the data source
          example: Annual Report 2023
        type:
          type: string
          enum:
            - file
            - ticket
          description: Type of the data source
          example: file
        status:
          type: string
          enum:
            - processing
            - processed
          description: Current status of the data source
          example: processed
        notes:
          type: object
          description: Custom attributes and fields
          example:
            category: financial
        knowledge_engine_id:
          type: string
          description: ID of the knowledge engine this data source belongs to
          example: kng_abc123xyz789
        created_at:
          type: integer
          format: int64
          description: Unix timestamp when this entity was created
          example: 1679644800

````