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

# Create source

> Creates a new sync source.



## OpenAPI

````yaml /sync.openapi.json post /api/v1/sources
openapi: 3.1.0
info:
  title: Chroma Sync Service
  description: >-
    Chroma Sync Service provides APIs for managing data synchronization sources
    and invocations. The service supports syncing content from GitHub
    repositories, web scrape targets, and S3 buckets to Chroma collections.
  license:
    name: ''
  version: 0.1.0
servers:
  - url: https://sync.trychroma.com
security: []
paths:
  /api/v1/sources:
    post:
      tags:
        - Source
      summary: Create source
      description: Creates a new sync source.
      operationId: create_source
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSourcePayload'
        required: true
      responses:
        '201':
          description: Source creation successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSourceResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Source exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - x-chroma-token: []
components:
  schemas:
    CreateSourcePayload:
      allOf:
        - $ref: '#/components/schemas/SourceType'
        - type: object
          required:
            - database_name
          properties:
            chunking:
              $ref: '#/components/schemas/SourceChunkingConfig'
              description: Optional chunking configuration for this source.
            database_name:
              type: string
            embedding:
              $ref: '#/components/schemas/SourceEmbeddingConfig'
            embedding_model:
              oneOf:
                - type: 'null'
                - $ref: '#/components/schemas/DenseEmbeddingModel'
    CreateSourceResponse:
      type: object
      required:
        - source_id
      properties:
        source_id:
          $ref: '#/components/schemas/SourceId'
          description: Source ID
    ErrorResponse:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
        message:
          type: string
    SourceType:
      oneOf:
        - type: object
          required:
            - github
          properties:
            github:
              type: object
              required:
                - repository
              properties:
                app_id:
                  type:
                    - string
                    - 'null'
                include_globs:
                  type:
                    - array
                    - 'null'
                  items:
                    type: string
                  uniqueItems: true
                repository:
                  type: string
        - type: object
          required:
            - web_scrape
          properties:
            web_scrape:
              type: object
              required:
                - starting_url
              properties:
                exclude_path_regexes:
                  type:
                    - array
                    - 'null'
                  items:
                    type: string
                  uniqueItems: true
                include_path_regexes:
                  type:
                    - array
                    - 'null'
                  items:
                    type: string
                  uniqueItems: true
                max_depth:
                  type:
                    - integer
                    - 'null'
                  format: int32
                  minimum: 0
                page_limit:
                  type:
                    - integer
                    - 'null'
                  format: int32
                  minimum: 0
                starting_url:
                  type: string
        - type: object
          required:
            - s3
          properties:
            s3:
              type: object
              required:
                - bucket_name
                - region
                - collection_name
              description: >-
                Provide either `aws_credential_id` referencing credentials saved
                in the dashboard, or pass `aws_access_key_id` and
                `aws_secret_access_key` inline (in which case credentials are
                stored automatically and a credential ID is allocated for
                reuse).
              properties:
                auto_sync:
                  oneOf:
                    - type: 'null'
                    - $ref: '#/components/schemas/AutoSync'
                      description: |-
                        Auto sync configuration for S3 source (default: none)
                        Only 'none' is supported initially
                aws_credential_id:
                  type:
                    - integer
                    - 'null'
                  format: int32
                  description: >-
                    ID of AWS credentials saved in the Chroma dashboard.
                    Mutually exclusive with
                    `aws_access_key_id`/`aws_secret_access_key`.
                aws_access_key_id:
                  type:
                    - string
                    - 'null'
                  description: >-
                    Inline AWS access key ID. Must be provided together with
                    `aws_secret_access_key`. The credentials are stored on your
                    team for reuse.
                aws_secret_access_key:
                  type:
                    - string
                    - 'null'
                  description: >-
                    Inline AWS secret access key. Must be provided together with
                    `aws_access_key_id`.
                bucket_name:
                  type: string
                collection_name:
                  type: string
                path_prefix:
                  type:
                    - string
                    - 'null'
                region:
                  type: string
        - type: object
          required:
            - file_upload
          description: >-
            File-upload sources are created automatically by the [`POST
            /api/v1/add-file`](#tag/file-upload) endpoint. They cannot be
            created directly via this endpoint.
          properties:
            file_upload:
              type: object
              additionalProperties: false
    SourceChunkingConfig:
      oneOf:
        - type: object
          required:
            - type
          properties:
            max_size_bytes:
              type: integer
              minimum: 0
            type:
              type: string
              enum:
                - tree_sitter
        - type: object
          required:
            - type
          properties:
            max_lines:
              type: integer
              minimum: 0
            max_size_bytes:
              type: integer
              minimum: 0
            type:
              type: string
              enum:
                - lines
    SourceEmbeddingConfig:
      type: object
      properties:
        dense:
          $ref: '#/components/schemas/DenseEmbeddingConfig'
        sparse:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/SparseEmbeddingConfig'
    DenseEmbeddingModel:
      oneOf:
        - type: object
          required:
            - model
          properties:
            model:
              type: string
              enum:
                - Qwen/Qwen3-Embedding-0.6B
            task:
              oneOf:
                - type: 'null'
                - $ref: '#/components/schemas/Qwen3EmbeddingTask'
    SourceId:
      type: string
      format: uuid
    AutoSync:
      type: string
      description: |-
        Auto-sync mode for S3 sources
        - `none`: Manual invocations only (default)
        - `direct`: Triggered by S3 events
        - `metadata`: Triggered by S3 events with custom metadata support
      enum:
        - none
        - direct
        - metadata
    DenseEmbeddingConfig:
      allOf:
        - $ref: '#/components/schemas/DenseEmbeddingModel'
    SparseEmbeddingConfig:
      type: object
      properties:
        key:
          type: string
        model:
          $ref: '#/components/schemas/SparseEmbeddingModel'
    Qwen3EmbeddingTask:
      type: object
      required:
        - task_name
      properties:
        document_prompt:
          type:
            - string
            - 'null'
        query_prompt:
          type:
            - string
            - 'null'
        task_name:
          type: string
    SparseEmbeddingModel:
      type: string
      enum:
        - Chroma/BM25
        - prithivida/Splade_PP_en_v1
  securitySchemes:
    x-chroma-token:
      type: apiKey
      in: header
      name: x-chroma-token

````