---
title: "Complete a direct upload"
method: POST
path: "/files/upload/complete"
tags: ["Files"]
---

# Complete a direct upload

`POST /files/upload/complete`

## Request

- Base URL: `https://api.livereacting.com/v1/external`
- URL: `https://api.livereacting.com/v1/external/files/upload/complete`
- Auth: HTTP bearer

Finish an upload after every part is in storage. The API checks that all parts are present and
add up to the size you declared, then adds the file to your media library and returns it.
A video then goes through the same checks, thumbnail and encoding as a Studio upload.

If a part is missing or has the wrong size, the response is `UPLOAD_INCOMPLETE` and the upload stays
open: re-send the part and call this endpoint again.

Calling it again after a success (for example after a lost response) returns the same file, so a
retry is safe. A retry that arrives while the first call is still checking the file (this takes up
to about 30 seconds for a video) answers `409 UPLOAD_PROCESSING`: call again in 30 seconds. If the
first call was interrupted, keep calling: after about five minutes a retry finishes the upload.
If the check fails (`UPLOAD_INVALID`), the stored object is deleted: upload the file again.
If this call answers `FILE_TOO_LARGE` or `STORAGE_LIMIT_EXCEEDED`, this upload cannot be completed:
free space or upgrade, then start a new upload.

## Request body

- CompleteUploadRequest
  - `uploadToken` string, required: The `uploadToken` from `POST /files/upload`.

## Response `201`

The file is in the media library

- File: A media file in the user's library
  - `id` string: Unique file identifier
  - `name` string, nullable: File name
  - `type` 'video' | 'image' | 'audio', nullable: File type
  - `folderId` string, nullable: ID of the folder containing this file. Only present if the file is in a folder.
  - `createdAt` string, date-time, nullable: File creation timestamp
  - `issues` object: Compatibility issues detected for video files. Only present for video type files. Thresholds are plan-tier-aware.
    - `errors` string[]: Critical issues that will prevent successful streaming (e.g. bitrate_too_high, resolution_too_high, fps_exceeds_limit, unsupported_video_codec).
    - `warnings` string[]: Non-critical issues that may affect quality (e.g. high_bitrate, high_resolution).
  - `encoding` object: Encoding status. Only present when encoding is in progress.
    - `status` 'in_queue' | 'in_progress': Current encoding status
    - `progress` integer: Encoding progress percentage
  - `resolution` string: Video resolution (e.g., "1920x1080"). Only present when include=metadata is requested.
  - `frameRate` number: Video frame rate in fps. Only present when include=metadata is requested.
  - `bitrateMbps` number: Video bitrate in Mbps. Only present when include=metadata is requested.
  - `durationSec` number: File duration in seconds. Only present when include=metadata is requested.
  - `sizeBytes` integer: File size in bytes. Only present when include=metadata is requested.
  - `videoCodec` string: Video codec name. Only present when include=metadata is requested.
  - `audioCodec` string: Audio codec name. Only present when include=metadata is requested.

## Other responses

- `400`: The upload is not complete or the file is not usable
- `401`: Authentication failed
- `404`: Unknown or expired upload, one discarded after `UPLOAD_INVALID` or a limit refusal, or a token from another account
- `409`: The first completion is still checking the file
- `429`: Rate limit exceeded

---

[API](https://skmtc.dev/livereacting/apis/livereacting-api.md) · [All operations](https://skmtc.dev/livereacting/apis/livereacting-api/llms.txt) · [OpenAPI document](https://skmtc.dev/livereacting/apis/livereacting-api/revisions/17a9f1677fbf?raw)
