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

# Complete Trace Upload

> Notify the platform that the batch file has been pushed to its signed GCS URL. Verifies the stored object and starts trace ingestion; poll the upload for per-trace outcomes.



## OpenAPI

````yaml /openapi.json post /api/v1/trace-sources/{source_id}/uploads/{upload_id}/complete
openapi: 3.1.0
info:
  title: Trajectory API
  version: 0.1.0
  x-trajectory-api-version: '2026-10-14'
  description: >-
    This contract is API version 2026-10-14. The optional Trajectory-API-Version
    header pins it, and tmp-contract is accepted as an alias. Requests without
    the header get this version. Version 2026-10-07 and the pre-launch legacy
    response formats are retired.
servers:
  - url: https://api.trajectory.ai
security: []
tags:
  - name: projects
    x-group: Projects
  - name: specs
    x-group: Specs
  - name: diagnostics
    x-group: Diagnostics
  - name: spec-ingestion
    x-group: Spec submissions
  - name: spec-findings
    x-group: Spec findings
  - name: eval
    x-group: Evaluations
  - name: training
    x-group: Training
  - name: deployments
    x-group: Deployments
  - name: model-endpoints
    x-group: Model endpoints
  - name: inference
    x-group: Inference
  - name: trajectories
    x-group: Trajectories
  - name: artifacts
    x-group: Artifacts
  - name: telemetry
    x-group: Telemetry
  - name: supported-models
    x-group: Supported models
  - name: organizations
    x-group: Organizations
  - name: secrets
    x-group: Secrets
  - name: datasets
    x-group: Datasets
paths:
  /api/v1/trace-sources/{source_id}/uploads/{upload_id}/complete:
    post:
      tags:
        - trace-sources
      summary: Complete Trace Upload
      description: >-
        Notify the platform that the batch file has been pushed to its signed
        GCS URL. Verifies the stored object and starts trace ingestion; poll the
        upload for per-trace outcomes.
      operationId: completeTraceUpload
      parameters:
        - name: source_id
          in: path
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 64
            title: Source Id
        - name: upload_id
          in: path
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 64
            title: Upload Id
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TraceUpload'
        '400':
          description: The request is malformed or cannot be processed.
          headers:
            X-Request-ID:
              $ref: '#/components/headers/RequestId'
            Trajectory-Should-Retry:
              $ref: '#/components/headers/TrajectoryShouldRetry'
            Retry-After:
              $ref: '#/components/headers/RetryAfter'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvalidRequestErrorResponse'
        '404':
          description: >-
            The requested resource does not exist or is not visible to the
            caller.
          headers:
            X-Request-ID:
              $ref: '#/components/headers/RequestId'
            Trajectory-Should-Retry:
              $ref: '#/components/headers/TrajectoryShouldRetry'
            Retry-After:
              $ref: '#/components/headers/RetryAfter'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFoundErrorResponse'
        '503':
          description: Trajectory or one of its dependencies is temporarily unavailable.
          headers:
            X-Request-ID:
              $ref: '#/components/headers/RequestId'
            Trajectory-Should-Retry:
              $ref: '#/components/headers/TrajectoryShouldRetry'
            Retry-After:
              $ref: '#/components/headers/RetryAfter'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceUnavailableErrorResponse'
        default:
          $ref: '#/components/responses/ApiErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    TraceUpload:
      properties:
        upload_id:
          type: string
          title: Upload Id
          description: Identifier of the upload.
        source_id:
          type: string
          title: Source Id
          description: The source the traces were imported into.
        kind:
          type: string
          const: signed_url
          title: Kind
          description: How the traces were uploaded.
        status:
          type: string
          enum:
            - uploading
            - pending
            - completed
            - failed
          title: Status
          description: >-
            `uploading` until the file is pushed to the signed URL and
            completed; `pending` until its traces are imported; `completed` once
            each trace has an outcome; `failed` if the file could not be
            imported.
        byte_size:
          type: integer
          minimum: 0
          title: Byte Size
          description: Size of the uploaded file in bytes.
        imported_count:
          type: integer
          minimum: 0
          title: Imported Count
          description: Traces imported as new trajectories.
        skipped_count:
          type: integer
          minimum: 0
          title: Skipped Count
          description: Traces already imported by an earlier upload.
        failed_count:
          type: integer
          minimum: 0
          title: Failed Count
          description: Traces that were not imported.
        failures:
          items:
            $ref: '#/components/schemas/TraceUploadFailure'
          type: array
          title: Failures
          description: The first 100 traces that were not imported, with their reasons.
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: Why a failed upload's file could not be imported.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Time the upload was accepted.
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Completed At
          description: Time the upload finished.
      type: object
      required:
        - upload_id
        - source_id
        - kind
        - status
        - byte_size
        - imported_count
        - skipped_count
        - failed_count
        - failures
        - error
        - created_at
        - completed_at
      title: TraceUpload
    InvalidRequestErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/InvalidRequestErrorBody'
      type: object
      required:
        - error
      title: InvalidRequestErrorResponse
    ResourceNotFoundErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/ResourceNotFoundErrorBody'
      type: object
      required:
        - error
      title: ResourceNotFoundErrorResponse
    ServiceUnavailableErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/ServiceUnavailableErrorBody'
      type: object
      required:
        - error
      title: ServiceUnavailableErrorResponse
    TraceUploadFailure:
      properties:
        trace_id:
          type: string
          title: Trace Id
          description: The OTLP trace ID that was not imported.
        reason:
          type: string
          title: Reason
          description: >-
            Why, as a reason code such as `no_content` or `import_failed`; new
            codes may appear.
        detail:
          type: string
          title: Detail
          description: More about the failure, possibly empty.
      type: object
      required:
        - trace_id
        - reason
        - detail
      title: TraceUploadFailure
    InvalidRequestErrorBody:
      properties:
        type:
          type: string
          const: invalid_request_error
          title: Type
        code:
          type: string
          const: invalid_request
          title: Code
        message:
          type: string
          title: Message
        param:
          anyOf:
            - type: string
            - type: 'null'
          title: Param
        doc_url:
          type: string
          title: Doc Url
        context:
          $ref: '#/components/schemas/EmptyErrorContext'
      type: object
      required:
        - type
        - code
        - message
        - doc_url
        - context
      title: InvalidRequestErrorBody
    ResourceNotFoundErrorBody:
      properties:
        type:
          type: string
          const: invalid_request_error
          title: Type
        code:
          type: string
          const: resource_not_found
          title: Code
        message:
          type: string
          title: Message
        param:
          anyOf:
            - type: string
            - type: 'null'
          title: Param
        doc_url:
          type: string
          title: Doc Url
        context:
          $ref: '#/components/schemas/EmptyErrorContext'
      type: object
      required:
        - type
        - code
        - message
        - doc_url
        - context
      title: ResourceNotFoundErrorBody
    ServiceUnavailableErrorBody:
      properties:
        type:
          type: string
          const: dependency_error
          title: Type
        code:
          type: string
          const: service_unavailable
          title: Code
        message:
          type: string
          title: Message
        param:
          anyOf:
            - type: string
            - type: 'null'
          title: Param
        doc_url:
          type: string
          title: Doc Url
        context:
          $ref: '#/components/schemas/EmptyErrorContext'
      type: object
      required:
        - type
        - code
        - message
        - doc_url
        - context
      title: ServiceUnavailableErrorBody
    ApiErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/ApiErrorBody'
      required:
        - error
      title: ApiErrorEnvelope
      type: object
    EmptyErrorContext:
      properties: {}
      additionalProperties: false
      type: object
      title: EmptyErrorContext
    ApiErrorBody:
      properties:
        type:
          $ref: '#/components/schemas/ErrorType'
        code:
          type: string
          title: Code
        message:
          type: string
          title: Message
        param:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Param
        doc_url:
          type: string
          title: Doc Url
        context:
          additionalProperties: true
          title: Context
          type: object
      required:
        - type
        - code
        - message
        - doc_url
        - context
      title: ApiErrorBody
      type: object
    ErrorType:
      enum:
        - invalid_request_error
        - authentication_error
        - permission_error
        - conflict_error
        - billing_error
        - rate_limit_error
        - dependency_error
        - api_error
      title: ErrorType
      type: string
  headers:
    RequestId:
      schema:
        type: string
    TrajectoryShouldRetry:
      schema:
        type: boolean
    RetryAfter:
      schema:
        type: string
  responses:
    ApiErrorResponse:
      description: >-
        Common API error. Possible codes: `authentication_required`,
        `permission_denied`, `validation_error`, `rate_limited`,
        `internal_error`, `service_unavailable`.
      headers:
        X-Request-ID:
          $ref: '#/components/headers/RequestId'
        Trajectory-Should-Retry:
          $ref: '#/components/headers/TrajectoryShouldRetry'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorEnvelope'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Organization API key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.