---
title: "Complete a resumable media upload"
description: "PubNio API media.completeUpload: complete a resumable media upload. Request fields, examples in five clients, errors, and idempotency."
---

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

# Complete a resumable media upload

Complete a resumable media upload with [`POST /api/v1/media/uploads/{mediaId}/complete`](https://pubnio.com/api/v1/docs#tag/media/POST/api/v1/media/uploads/{mediaId}/complete). Requires an API key with the `read` scope or a signed-in workspace member.

## Request

| Parameter     | In    | Type | Required |
| ------------- | ----- | ---- | -------- |
| `mediaId`     | path  | UUID | Yes      |
| `workspaceId` | query | UUID | Yes      |

## Response

- HTTP 200: `MediaIntake` with `mediaId`, `status`, `asset`, `issue`, `upload`, `idempotencyKey`, `retryAfterSeconds`.
  - `status`: `awaiting_upload`, `processing`, `ready`, `failed`

The [OpenAPI document](https://pubnio.com/api/v1/openapi) has each field's type.

## Examples

### TypeScript

```ts
const asset = await workspace.media.upload(file);
```

The SDK's `media.upload()` runs this step itself for a file too large for one request.

### Python

```python
intake = workspace.media.complete_upload(media_id)
```

### cURL

```sh
curl -X POST "https://pubnio.com/api/v1/media/uploads/$MEDIA_ID/complete?workspaceId=$WORKSPACE_ID" \
  -H "Authorization: Bearer $PUBNIO_API_KEY"
```

### CLI

```sh
pnio media upload ./launch.mp4
```

### MCP execute

Hosted MCP's `execute` tool cannot carry this operation's binary body or response.

## Errors

- [`media-upload-conflict`](https://pubnio.com/docs/problems/media-upload-conflict/): HTTP 409, Media upload conflict

It also declares the problems [most operations](https://pubnio.com/docs/reference/#shared-problems) declare.

## Idempotency

No key, so a retried `POST` is not deduplicated. Read the current state before you retry.

## Limits

- It is one step of a resumable upload. Agents usually call `media.upload`, `media.import`, or `media.uploadInline` instead.

## Related

- [Media operations](https://pubnio.com/docs/reference/#media)
- [Publishing](https://pubnio.com/docs/publishing/)

Source: https://pubnio.com/docs/reference/media-complete-upload/index.mdx
