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

# Complete the upload (assemble + create the campaign)

> Verify every file's chunk-list root, splice the chunks into files, validate the tree as a LeRobot dataset, create an owner-scoped campaign over it (provenance `source=upload`), and start health immediately. Video files are OPTIONAL, health runs on action data alone (episode previews/clips 404 until videos exist). All required (non-video) files must be fully received, else 409, and NOTE this endpoint's 409 `detail` is an OBJECT ({ error, missing: {path: [chunk indices]} }), not a string. Idempotent: repeating returns the campaign already created. DELETE /api/workbench/uploads/{upload_id} cleans up an abandoned upload (a completed campaign's dataset lives on independently).




## OpenAPI

````yaml /forge-api-v1.yaml post /api/workbench/uploads/{upload_id}/complete
openapi: 3.0.3
info:
  title: Alakazam Forge API
  version: '1.0'
  description: |
    The Forge Dataset Workbench API: upload or import robotics datasets,
    audit them, propose and run augmentation campaigns, review, and deliver.
    Served by the Forge workbench service at forge.alakazam.gg (not
    api.alakazam.gg).
servers:
  - url: https://forge.alakazam.gg
    description: Forge (Dataset Workbench)
security: []
tags:
  - name: Dataset Workbench
    description: |
      **Served at `https://forge.alakazam.gg`** (not the main API host). The
      Forge Dataset Workbench is the client surface of the robotics
      data-augmentation service: bring a LeRobot robot dataset, a public
      Hugging Face repo, a resumable chunked upload, or a one-click curated
      sample, and walk one owner-scoped **campaign** through the spine
      Source & Health → Sample → Transform → Run + Verify → Deliver, leaving
      with a verified augmented dataset. Every endpoint requires a **Supabase
      user access token** (`Authorization: Bearer …`, the `UserAuth` scheme);
      a missing or invalid token returns `401`, and another user's campaigns,
      runs, and uploads read as `404`. Errors use the platform envelope
      `{"detail": "…"}`. Nothing bills until **Deliver**, which charges 1
      credit per never-before-billed kept episode from your credits wallet.
  - name: Playground batches
    description: |
      The Forge playground's "describe a change" flow is not a REST surface on
      this host: a described change is submitted as a **scenario batch**
      through the platform (the Supabase RPC `create_scenario_batch`) and its
      progress/results stream back over Supabase realtime on the
      `scenario_batches` table. For the equivalent public REST surface, see
      **Scenario Studio** (`/v1/scenario-batches`).
paths:
  /api/workbench/uploads/{upload_id}/complete:
    servers:
      - url: https://forge.alakazam.gg
        description: Forge (Dataset Workbench)
    post:
      tags:
        - Dataset Workbench
      summary: Complete the upload (assemble + create the campaign)
      description: >
        Verify every file's chunk-list root, splice the chunks into files,
        validate the tree as a LeRobot dataset, create an owner-scoped campaign
        over it (provenance `source=upload`), and start health immediately.
        Video files are OPTIONAL, health runs on action data alone (episode
        previews/clips 404 until videos exist). All required (non-video) files
        must be fully received, else 409, and NOTE this endpoint's 409 `detail`
        is an OBJECT ({ error, missing: {path: [chunk indices]} }), not a
        string. Idempotent: repeating returns the campaign already created.
        DELETE /api/workbench/uploads/{upload_id} cleans up an abandoned upload
        (a completed campaign's dataset lives on independently).
      parameters:
        - name: upload_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                campaign_name:
                  type: string
                  nullable: true
                  description: Optional display name for the created campaign.
      responses:
        '200':
          description: >-
            The campaign created over the uploaded dataset (health already
            computing).
          content:
            application/json:
              schema:
                type: object
                properties:
                  campaign_id:
                    type: string
                    example: camp_1f2e3d4c5b6a
        '400':
          description: >-
            A file failed its integrity check, the assembled tree is not a
            recognizable LeRobot dataset, or it has no complete action data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Upload not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >-
            Required (non-video) files are still incomplete. UNLIKE every other
            error here, `detail` is an object carrying the missing chunk map.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: object
                    properties:
                      error:
                        type: string
                      missing:
                        type: object
                        additionalProperties:
                          type: array
                          items:
                            type: integer
                        description: Missing chunk indices per required file.
      security:
        - UserAuth: []
components:
  schemas:
    Error:
      type: object
      properties:
        detail:
          type: string
          description: Human-readable error message.
        errors:
          type: array
          items:
            type: string
          description: Field-level validation errors (e.g. on 422 from POST /v1/worlds).
        schemaVersion:
          type: string
      required:
        - detail
  securitySchemes:
    UserAuth:
      type: http
      scheme: bearer
      description: >
        Either a Supabase user access token (from a password login, or the
        passwordless magic-link flow) or a long-lived `forge_sk_…` API key. Both
        are sent as `Authorization: Bearer <value>` and resolve to the same
        owner, so every endpoint accepts either. Session tokens expire in ~1h;
        API keys do not expire and are the credential for MCP clients, CI, and
        partner integrations.

````