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

# Allocate submission uploads

> Request upload URLs for files declared in a spec submission.



## OpenAPI

````yaml /openapi.json post /api/v1/specs/ingestion/sessions/{operation_id}/uploads
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/specs/ingestion/sessions/{operation_id}/uploads:
    post:
      tags:
        - spec-ingestion
      summary: Allocate submission uploads
      description: Request upload URLs for files declared in a spec submission.
      operationId: allocateSpecSubmissionUploads
      parameters:
        - name: operation_id
          in: path
          required: true
          schema:
            type: string
            title: Operation Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BenchmarkIngestionAllocateObjectsRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BenchmarkIngestionUploadUrls'
        default:
          $ref: '#/components/responses/ApiErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    BenchmarkIngestionAllocateObjectsRequest:
      properties:
        files:
          items:
            $ref: '#/components/schemas/BenchmarkIngestionUploadObject'
          type: array
          maxItems: 5000
          minItems: 1
          title: Files
          description: >-
            At most 1000 files and 1024 KiB with `put`, or 5000 files and 4096
            KiB with `post`.
        upload_method:
          type: string
          enum:
            - put
            - post
          title: Upload Method
          description: >-
            `put` returns a signed PUT URL per file. `post` returns one signed
            form-upload policy for the whole batch; uploads are checked against
            their declarations when the submission is verified.
          default: put
      additionalProperties: false
      type: object
      required:
        - files
      title: BenchmarkIngestionAllocateObjectsRequest
    BenchmarkIngestionUploadUrls:
      properties:
        urls:
          items:
            $ref: '#/components/schemas/BenchmarkUploadUrl'
          type: array
          title: Urls
        reused:
          items:
            type: string
          type: array
          title: Reused
          description: >-
            Paths declared with `reuse` that read an earlier upload; do not
            upload them.
        policy:
          anyOf:
            - $ref: '#/components/schemas/BenchmarkIngestionUploadPolicy'
            - type: 'null'
          description: Set instead of `urls` when the allocation requested `post`.
      type: object
      required:
        - urls
      title: BenchmarkIngestionUploadUrls
    BenchmarkIngestionUploadObject:
      properties:
        path:
          type: string
          title: Path
        content_type:
          type: string
          title: Content Type
        size_bytes:
          type: integer
          title: Size Bytes
        md5:
          type: string
          maxLength: 24
          pattern: ^[A-Za-z0-9+/]{22}==$
          title: Md5
        kind:
          type: string
          enum:
            - artifact
            - part
          title: Kind
          default: artifact
        same_as:
          anyOf:
            - type: string
              maxLength: 1024
            - type: 'null'
          title: Same As
          description: >-
            Path of an artifact declared earlier in this submission, or in this
            request, with the same `md5` and `size_bytes`. Its object is read in
            place of this path, so this path is not uploaded. A runtime's
            Dockerfile cannot be a `same_as` path.
        reuse:
          type: boolean
          title: Reuse
          description: >-
            Let the API reuse an identical artifact this organization uploaded
            in an earlier submission. Reused paths are returned in `reused` and
            must not be uploaded. This flag is not part of the declaration or
            the upload digest. A runtime's Dockerfile cannot be reused.
          default: false
      additionalProperties: false
      type: object
      required:
        - path
        - content_type
        - size_bytes
        - md5
      title: BenchmarkIngestionUploadObject
    BenchmarkUploadUrl:
      properties:
        path:
          type: string
          title: Path
        url:
          type: string
          title: Url
        headers:
          additionalProperties:
            type: string
          type: object
          title: Headers
      type: object
      required:
        - path
        - url
        - headers
      title: BenchmarkUploadUrl
    BenchmarkIngestionUploadPolicy:
      properties:
        url:
          type: string
          title: Url
          description: Form upload endpoint (POST) for every file in the batch.
        fields:
          additionalProperties:
            type: string
          type: object
          title: Fields
          description: >-
            Signed form fields; send them with `key`, `Content-Type`, and the
            file as the last field, `file`.
        artifact_prefix:
          type: string
          title: Artifact Prefix
          description: An artifact's `key` is this prefix plus its path.
        part_prefix:
          type: string
          title: Part Prefix
          description: A task part's `key` is this prefix plus its path.
        expires_at:
          type: string
          format: date-time
          title: Expires At
          description: Uploads must start before this time.
      type: object
      required:
        - url
        - fields
        - artifact_prefix
        - part_prefix
        - expires_at
      title: BenchmarkIngestionUploadPolicy
    ApiErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/ApiErrorBody'
      required:
        - error
      title: ApiErrorEnvelope
      type: object
    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
  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'
  headers:
    RequestId:
      schema:
        type: string
    TrajectoryShouldRetry:
      schema:
        type: boolean
    RetryAfter:
      schema:
        type: string
  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.