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

# Batch Create

> Create multiple data connectors in a single call. Useful for multi-site SharePoint connections where each site is a separate connector.



## OpenAPI

````yaml /deasy-openapi-stainless.yml post /data_connector/create_batch
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: /rest/unstructured
security: []
paths:
  /data_connector/create_batch:
    post:
      tags:
        - Data Connectors
      summary: Batch Create
      description: >-
        Create multiple data connectors in a single call. Useful for multi-site
        SharePoint connections where each site is a separate connector.
      operationId: create_data_sources_batch_route_data_connector_create_batch_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchCreateVDBConnectorRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchConnectorResponse'
        '403':
          description: Missing token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
        '500':
          description: >-
            Internal Server Error. An unexpected error occurred while processing
            the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
      security:
        - BasicAuth: []
        - BearerAuth: []
          UserIdAuth: []
      x-codeSamples:
        - lang: Python
          source: |-
            import os
            from unstructured import UnstructuredClient

            client = UnstructuredClient(
                username=os.environ.get("UNSTRUCTURED_USERNAME"),  # This is the default and can be omitted
                password=os.environ.get("UNSTRUCTURED_PASSWORD"),  # This is the default and can be omitted
            )
            response = client.data_source.create_batch(
                connectors=[{
                    "connector_body": {
                        "client_id": "client_id",
                        "client_secret": "client_secret",
                        "name": "name",
                        "tenant_id": "tenant_id",
                        "type": "OnedriveDataSourceManager",
                    },
                    "connector_name": "connector_name",
                }],
            )
            print(response.profile_ids)
        - lang: JavaScript
          source: |-
            import UnstructuredClient from 'unstructured-sdk';

            const client = new UnstructuredClient({
              authMethod: 'My Auth Method',
              username: process.env['UNSTRUCTURED_USERNAME'], // This is the default and can be omitted
              password: process.env['UNSTRUCTURED_PASSWORD'], // This is the default and can be omitted
            });

            const response = await client.dataSource.createBatch({
              connectors: [
                {
                  connector_body: {
                    client_id: 'client_id',
                    client_secret: 'client_secret',
                    name: 'name',
                    tenant_id: 'tenant_id',
                    type: 'OnedriveDataSourceManager',
                  },
                  connector_name: 'connector_name',
                },
              ],
            });

            console.log(response.profile_ids);
components:
  schemas:
    BatchCreateVDBConnectorRequest:
      properties:
        connectors:
          items:
            $ref: '#/components/schemas/CreateVDBConnectorRequest'
          type: array
          title: Connectors
      type: object
      required:
        - connectors
      title: BatchCreateVDBConnectorRequest
    BatchConnectorResponse:
      properties:
        profile_ids:
          items:
            type: string
          type: array
          title: Profile Ids
      type: object
      required:
        - profile_ids
      title: BatchConnectorResponse
    HTTPError:
      properties:
        detail:
          type: string
          title: Detail
      type: object
      required:
        - detail
      title: HTTPError
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CreateVDBConnectorRequest:
      properties:
        connector_name:
          type: string
          title: Connector Name
        connector_body:
          oneOf:
            - $ref: '#/components/schemas/OnedriveConnectorConfig'
            - $ref: '#/components/schemas/PSQLConnectorConfig'
            - $ref: '#/components/schemas/QdrantConnectorConfig'
            - $ref: '#/components/schemas/S3ConnectorConfig'
            - $ref: '#/components/schemas/SharepointConnectorConfig'
          title: Connector Body
          discriminator:
            propertyName: type
            mapping:
              OnedriveDataSourceManager:
                $ref: '#/components/schemas/OnedriveConnectorConfig'
              PSQLVectorDBManager:
                $ref: '#/components/schemas/PSQLConnectorConfig'
              QdrantVectorDBManager:
                $ref: '#/components/schemas/QdrantConnectorConfig'
              S3DataSourceManager:
                $ref: '#/components/schemas/S3ConnectorConfig'
              SharepointDataSourceManager:
                $ref: '#/components/schemas/SharepointConnectorConfig'
      type: object
      required:
        - connector_name
        - connector_body
      title: CreateVDBConnectorRequest
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    OnedriveConnectorConfig:
      properties:
        type:
          type: string
          enum:
            - OnedriveDataSourceManager
          const: OnedriveDataSourceManager
          title: Type
          default: OnedriveDataSourceManager
        name:
          type: string
          title: Name
        client_id:
          type: string
          title: Client Id
        client_secret:
          type: string
          title: Client Secret
        tenant_id:
          type: string
          title: Tenant Id
        onedrive_site_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Onedrive Site Name
        onedrive_site_names:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Onedrive Site Names
        drives:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Drives
      type: object
      required:
        - name
        - client_id
        - client_secret
        - tenant_id
      title: OnedriveConnectorConfig
    PSQLConnectorConfig:
      properties:
        type:
          type: string
          enum:
            - PSQLVectorDBManager
          const: PSQLVectorDBManager
          title: Type
          default: PSQLVectorDBManager
        database_name:
          type: string
          title: Database Name
        collection_name:
          type: string
          title: Collection Name
        url:
          type: string
          title: Url
        password:
          type: string
          title: Password
        db_user:
          type: string
          title: Db User
        port:
          type: string
          title: Port
        name:
          type: string
          title: Name
        index_info:
          anyOf:
            - $ref: '#/components/schemas/PSQLIndexInfo'
            - type: 'null'
        filename_key:
          type: string
          title: Filename Key
          default: filename
        text_key:
          type: string
          title: Text Key
          default: text
      type: object
      required:
        - database_name
        - collection_name
        - url
        - password
        - db_user
        - port
        - name
      title: PSQLConnectorConfig
    QdrantConnectorConfig:
      properties:
        type:
          type: string
          enum:
            - QdrantVectorDBManager
          const: QdrantVectorDBManager
          title: Type
          default: QdrantVectorDBManager
        name:
          type: string
          title: Name
        filename_key:
          type: string
          title: Filename Key
          default: filename
        text_key:
          type: string
          title: Text Key
          default: text
        api_key:
          type: string
          title: Api Key
        collection_name:
          type: string
          title: Collection Name
        url:
          type: string
          title: Url
        index_info:
          anyOf:
            - $ref: '#/components/schemas/QdrantIndexInfo'
            - type: 'null'
      type: object
      required:
        - name
        - api_key
        - collection_name
        - url
      title: QdrantConnectorConfig
    S3ConnectorConfig:
      properties:
        type:
          type: string
          enum:
            - S3DataSourceManager
          const: S3DataSourceManager
          title: Type
          default: S3DataSourceManager
        bucket_name:
          type: string
          title: Bucket Name
        aws_access_key_id:
          type: string
          title: Aws Access Key Id
        aws_secret_access_key:
          type: string
          title: Aws Secret Access Key
        name:
          type: string
          title: Name
        region:
          anyOf:
            - type: string
            - type: 'null'
          title: Region
          default: us-east-1
      type: object
      required:
        - bucket_name
        - aws_access_key_id
        - aws_secret_access_key
        - name
      title: S3ConnectorConfig
    SharepointConnectorConfig:
      properties:
        type:
          type: string
          enum:
            - SharepointDataSourceManager
          const: SharepointDataSourceManager
          title: Type
          default: SharepointDataSourceManager
        name:
          type: string
          title: Name
        client_id:
          type: string
          title: Client Id
        client_secret:
          type: string
          title: Client Secret
        tenant_id:
          type: string
          title: Tenant Id
        sharepoint_site_name:
          type: string
          title: Sharepoint Site Name
        drives:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Drives
      type: object
      required:
        - name
        - client_id
        - client_secret
        - tenant_id
        - sharepoint_site_name
      title: SharepointConnectorConfig
    PSQLIndexInfo:
      properties:
        found_indexes:
          items:
            type: string
          type: array
          title: Found Indexes
        total_indexes_found:
          type: integer
          title: Total Indexes Found
      type: object
      required:
        - found_indexes
        - total_indexes_found
      title: PSQLIndexInfo
    QdrantIndexInfo:
      properties:
        total_indexes_found:
          type: integer
          title: Total Indexes Found
      type: object
      required:
        - total_indexes_found
      title: QdrantIndexInfo
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
    BearerAuth:
      type: http
      scheme: bearer
    UserIdAuth:
      type: apiKey
      in: header
      name: X-User-ID

````