> For the complete documentation index, see [llms.txt](https://docs.podigee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.podigee.com/documentation/start-here/ai-agents/mcp-reference/media-upload-protocol.md).

# Media upload protocol

Opaque upload sessions, direct byte transfer, parts, completion, ownership, and secret handling.

## Control endpoints

| Method | Endpoint                                       |
| ------ | ---------------------------------------------- |
| `POST` | `/uploads`                                     |
| `GET`  | `/uploads/{upload_id}`                         |
| `POST` | `/uploads/{upload_id}/parts/{part_number}/url` |
| `POST` | `/uploads/{upload_id}/complete`                |
| `POST` | `/uploads/{upload_id}/abort`                   |

Use the same resource-bound bearer token as MCP. Upload controls require `mcp:media:write` and exact tenant ownership.

## Session creation

Send a safe base filename, exact byte size, matching supported media content type, and stable idempotency key. The response defines single or multipart mode, expected parts, part size, expiry, and public `upload_id`.

## Byte transfer

Request a short-lived URL for each part. Send HTTPS `PUT` with the exact returned `Content-Type` and `Content-Length`. Treat the URL as an opaque secret. Never parse or log it.

## Resume

Read the session and `completed_parts`. Only `pending` and `uploading` accept resumed bytes. Renew a part URL when it expires and transfer only missing parts.

## Complete or abort

Completion validates provider metadata, part order, sizes, and aggregate bytes. Abort removes incomplete data. Both operations are idempotent.

## Attachment

A completed upload must be attached during its 24-hour session lifetime. It belongs to the same actor and tenant and can attach to only one production. Podigee never returns a provider object URL as the public media reference.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.podigee.com/documentation/start-here/ai-agents/mcp-reference/media-upload-protocol.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
