> ## 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 invocation

> Creates a new invocation for a source.



## OpenAPI

````yaml /sync.openapi.json post /api/v1/sources/{source_id}/invocations
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/{source_id}/invocations:
    post:
      tags:
        - Invocation
      summary: Create invocation
      description: Creates a new invocation for a source.
      operationId: create_job
      parameters:
        - name: source_id
          in: path
          description: Source ID
          required: true
          schema:
            $ref: '#/components/schemas/SourceId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateJobPayload'
        required: true
      responses:
        '201':
          description: Invocation creation successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateJobResponse'
        '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: Source not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Invocation 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:
    SourceId:
      type: string
      format: uuid
    CreateJobPayload:
      type: object
      properties:
        custom_id:
          type:
            - string
            - 'null'
          maxLength: 120
          description: >-
            Custom ID for Chroma object IDs (optional, S3 sources only).

            If provided, chunk IDs become "custom_id-{chunk}" instead of
            "sha256(object_key)-{chunk}".

            Also stored as "custom_id" metadata on each chunk.
        metadata:
          type:
            - object
            - 'null'
          description: >-
            Additional metadata to merge with standard chunk metadata (optional,
            S3 sources only).
          additionalProperties: {}
          propertyNames:
            type: string
        object_key:
          type:
            - string
            - 'null'
          description: >-
            Full S3 object key to sync (required for S3 sources, not allowed for
            other source types).

            Must be the complete key including any path prefix configured on the
            source.
        ref_identifier:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/GitRefIdentifier'
              description: Git ref identifier for GitHub sources (optional)
        target_collection_name:
          type:
            - string
            - 'null'
          description: >-
            Target collection name (optional for S3 sources, required for
            others).

            For S3 sources: if not provided, uses collection_name from source
            config.

            For GitHub and WebScrape sources: required.
    CreateJobResponse:
      type: object
      required:
        - invocation_id
      properties:
        invocation_id:
          $ref: '#/components/schemas/JobId'
          description: ID of the newly created invocation
    ErrorResponse:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
        message:
          type: string
    GitRefIdentifier:
      oneOf:
        - type: object
          required:
            - sha
          properties:
            sha:
              type: string
        - type: object
          required:
            - branch
          properties:
            branch:
              type: string
    JobId:
      type: string
      format: uuid
  securitySchemes:
    x-chroma-token:
      type: apiKey
      in: header
      name: x-chroma-token

````