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

# Complete an upload



## OpenAPI

````yaml /api/openapi.json post /api/v1/upload/complete
openapi: 3.0.2
info:
  title: Melius API
  version: '1'
  description: >-
    The Melius REST API. Authenticate with an API key as a bearer token
    (`Authorization: Bearer mel_...`) and select the team to act on with the
    `x-team-id` header. Generations run through the same node + run pipeline as
    the app: create a node on a canvas, start a run, poll the run, then read the
    resulting version asset.
servers:
  - url: https://api.melius.com
security:
  - apiKey: []
    teamId: []
paths:
  /api/v1/upload/complete:
    post:
      tags:
        - upload
      summary: Complete an upload
      operationId: upload.complete
      parameters: []
      requestBody:
        description: Body
        content:
          application/json:
            schema:
              type: object
              properties:
                uploadId:
                  type: string
                s3Bucket:
                  type: string
                s3Key:
                  type: string
                filename:
                  type: string
                contentType:
                  type: string
                sizeInBytes:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: true
                nodeId:
                  type: string
                  format: uuid
                canvasId:
                  type: string
                  format: uuid
                parts:
                  type: array
                  items:
                    type: object
                    properties:
                      partNumber:
                        type: integer
                        minimum: 0
                        exclusiveMinimum: true
                      etag:
                        type: string
                    required:
                      - partNumber
                      - etag
                width:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: true
                height:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: true
                node:
                  type: object
                  properties:
                    nodeType:
                      type: string
                    geometry:
                      type: object
                      properties:
                        x:
                          type: number
                        'y':
                          type: number
                        w:
                          type: number
                        h:
                          type: number
                      required:
                        - x
                        - 'y'
                        - w
                        - h
                    title:
                      type: string
                    createdByUserId:
                      type: string
                      format: uuid
                  required:
                    - nodeType
                    - geometry
                agentUpload:
                  type: boolean
                replaceActiveVersion:
                  type: boolean
              required:
                - uploadId
                - s3Bucket
                - s3Key
                - filename
                - contentType
                - sizeInBytes
                - parts
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  assetId:
                    type: string
                    format: uuid
                  s3Bucket:
                    type: string
                  s3Key:
                    type: string
                  url:
                    type: string
                  nodeVersionId:
                    type: string
                    format: uuid
                    nullable: true
                required:
                  - success
                  - assetId
                  - s3Bucket
                  - s3Key
                  - url
        '401':
          description: Missing, invalid, expired, or revoked API key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - statusCode
                  - message
        '403':
          description: The API key's user is not a member of the requested team.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - statusCode
                  - message
        '429':
          description: Rate limit reached — retry after the `Retry-After` header.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                  error:
                    type: string
                  message:
                    type: string
                  retryAfterSeconds:
                    type: integer
                required:
                  - statusCode
                  - message
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: 'A Melius API key (`mel_...`), sent as `Authorization: Bearer <key>`.'
    teamId:
      type: apiKey
      in: header
      name: x-team-id
      description: The team (workspace) to act on. Defaults to the key's team when omitted.

````