---
title: "Confirm an upload so it appears in the gallery"
method: POST
path: "/api/media/complete"
tags: ["Media"]
---

# Confirm an upload so it appears in the gallery

`POST /api/media/complete`

## Request

- Base URL: `https://api.dunsocial.com`
- URL: `https://api.dunsocial.com/api/media/complete`
- Auth: HTTP bearer

## Headers

- `X-Workspace-Id` string, required

## Request body

- CompleteUpload
  - `storageKey` string, required
  - `originalFilename` string, required
  - `mimeType` string, required
  - `fileSize` number, required
  - `width` number
  - `height` number
  - `duration` number: Video duration in milliseconds. Values under 1000 are treated as seconds and converted on write.
  - `altText` string

## Response `201`

Asset

- object
  - `success` true, required
  - `data` MediaAsset
    - `id` string, required
    - `originalFilename` string
    - `mimeType` string
    - `fileSize` number
    - `previewUrl` string
    - `altText` string, nullable

## Other responses

- `400`: Validation or business rule failed
- `401`: Missing or invalid bearer token
- `402`: Workspace is not on a paid plan
- `403`: Wrong workspace, missing scope, or role

---

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