> 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/media-and-publishing/upload-media-and-cover-images.md).

# Upload media and cover images

Send a recording or a cover image from your computer to Podigee, and continue an upload.

This page tells you how a recording (audio or video) or a cover image goes from your computer to Podigee when you work with an assistant. It also tells you how to continue an interrupted upload, and it gives the upload states and limits.

To publish a recording after the upload, see [Encode and publish episodes](https://docs.podigee.com/documentation/start-here/ai-agents/media-and-publishing/encode-and-publish-episodes.md).

## How a file reaches Podigee

The file does not go through the conversation. The Model Context Protocol (MCP) connection only controls the upload. The file goes directly from your computer to Podigee storage with an HTTPS `PUT` request.

1. The assistant calls `create_upload` with the file name and the exact file size.
2. Podigee returns an `upload_id`, a short-lived upload address, and a `curl` command that sends the file.
3. The assistant runs the command on your computer.
4. A second call uses the `upload_id`: `publish_episode` or `create_production` for a recording, or `update_podcast`, `update_episode`, `create_podcast`, or `create_episode` for a cover image. This call checks the file and closes the upload.

Podigee does not get a recording or a cover from a link. A link to a file is not an upload. You do not install a Podigee program.

The upload address is a temporary secret. Do not paste it into a chat, a log, a ticket, or a document. Use the `upload_id` in all later calls. The protocol details are in [Media upload protocol](https://docs.podigee.com/documentation/start-here/ai-agents/mcp-reference/media-upload-protocol.md).

## Choose the way that fits your assistant

| Where your assistant runs                                                                            | How the file gets to Podigee                                                                                                                                                                                                                                                                       |
| ---------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| A chat app, for example ChatGPT or the Claude app                                                    | The assistant cannot read your files or run commands on your computer, so it cannot send a file. It gives you the link of the **New episode** page of the show, where you choose the file. It gets the link from `find_in_podigee`. For a cover, it gives you the page of the show or the episode. |
| An app on your computer that can run commands, for example Claude Code, Codex, Cursor, or Gemini CLI | The assistant sends the file itself with `create_upload` and `curl`. Follow the sections below.                                                                                                                                                                                                    |
| Your own script, without an assistant                                                                | Use the Podigee REST API with an API key. See [Publish an episode from your own system](https://docs.podigee.com/api-reference/rest-api/publish-an-episode-from-your-own-system).                                                                                                                  |

The steps on the **New episode** page are in [Upload audio or video](https://docs.podigee.com/documentation/create-and-publish/production/episodes/upload-audio-or-video.md).

Everything else that an assistant does, for example metadata, scheduling, analytics, imports, and listeners, needs no upload.

## What you need

* A connection with the scope `mcp:media:write` for `create_upload` and `get_upload`.
* The scope `mcp:podcasts:write` for the call that uses the upload. `publish_episode` needs `mcp:podcasts:write` and `mcp:media:write`. A connection with `mcp:media:write` only can send the file but stops at `publish_episode`. To add a scope, see [Choose the account and permissions](https://docs.podigee.com/documentation/start-here/ai-agents/connect-and-authorize/choose-the-account-and-permissions.md).
* The path of the file on your computer.
* Permission for the assistant to run `curl` with network access. macOS, Windows, and most Linux systems include `curl`.
* For a file larger than 5 GB: the command also uses `dd` to cut the file into parts. macOS and Linux include `dd`. On Windows, run the assistant in Windows Subsystem for Linux (WSL) or Git Bash for such a file.

## Prepare the file

The file must meet these rules:

| File            | Accepted endings                                                                                | Size                                         |
| --------------- | ----------------------------------------------------------------------------------------------- | -------------------------------------------- |
| Audio recording | `.mp3`, `.m4a`, `.opus`, `.ogg`                                                                 | 1 byte to 20 GiB                             |
| Video recording | `.mp4`, `.m4v`, `.m4p`, `.mov`, `.qt`, `.mkv`, `.mk3d`, `.avi`, `.ogv`, `.ogg`, `.ogm`, `.webm` | 1 byte to 20 GiB                             |
| Cover image     | `.png`, `.jpg`, `.jpeg`                                                                         | Up to 2 MB, square, 1400 to 3000 pixels wide |

20 GiB is 21,474,836,480 bytes.

1. Make sure that the file is complete and that it plays or opens on your computer.
2. Use a plain file name with an ending. Do not use a path, a slash, a backslash, or a control character. Keep the name at 255 bytes or fewer.
3. Read the exact size in bytes, for example with `wc -c < FILE`. Do not estimate the size. The upload address is signed for this size.
4. Leave out `content_type`. The file ending sets it. If you send `content_type`, it must match the ending.
5. Choose an idempotency key for the upload: a unique text of up to 128 characters. If the assistant sends the same request again with the same key, Podigee returns the same upload. The key rules are in [Preview and confirm changes](https://docs.podigee.com/documentation/start-here/ai-agents/work-safely/preview-and-confirm-changes.md).

If Podigee refuses the file, do not change only the ending or the content type. Export the file in an accepted format, then start a new upload for the new file.

## Upload a recording

Before you start, read [What you need](#what-you-need) and [Prepare the file](#prepare-the-file).

1. Tell the assistant which file to upload and for which show. Ask it to tell you what it will create.
2. The assistant reads the exact size of the file.
3. The assistant calls `create_upload` with the file name, the size, and an idempotency key.
4. Podigee returns the `upload_id` and `next_part`. `next_part` contains the upload address and the command.
5. The assistant runs the command with the path of the file. The command prints `HTTP 200`.
6. For a file in more than one part, the assistant calls `get_upload` for the address of the next part. Then it runs the new command. It continues until no part is missing.
7. The assistant calls `publish_episode` with `"media": { "source": "upload", "upload_id": "..." }`. Podigee checks the file and closes the upload.

A file of up to 5 GB (5,000,000,000 bytes) goes in one request. A larger file goes in parts of 5 GB. The largest file has five parts.

**Expected result:** each command printed `HTTP 200`. `publish_episode` accepts the upload, and the upload state changes to `completed`.

**If the upload fails:**

* The command prints a status other than `HTTP 200`: nothing was stored. The most frequent cause is a size that differs from the file. Start a new upload with the exact size and a new idempotency key.
* The address expired: call `get_upload`. It returns a new address for the missing part. An address is valid for 15 minutes.
* `publish_episode` says that the file is not in storage: send the file again with the command from `get_upload`, then repeat the request. If the command printed `HTTP 200` before, do not send the file again. Report the problem to Podigee Support.
* The error says that the file in storage has a different size or type: start a new upload with the exact size.
* The error code is `upload_quota_exceeded`: the account has reached an upload quota. See [Upload limits and lifetimes](#upload-limits-and-lifetimes).
* The error code is `storage_forbidden`: Podigee storage refused the request. This does not clear on retry. Do not retry. Contact Podigee Support.
* The error code is `insufficient_scope`: the connection does not have the scope that the tool needs. See [Choose the account and permissions](https://docs.podigee.com/documentation/start-here/ai-agents/connect-and-authorize/choose-the-account-and-permissions.md).
* The publication fails or stops after the upload: follow the `recovery` action of the operation. Do not upload a new file and do not convert the file to another format unless the action is `replace_recording`. See [Follow and recover long-running operations](https://docs.podigee.com/documentation/start-here/ai-agents/work-safely/follow-and-recover-long-running-operations.md).

Other error codes are in [Limits, errors, and recovery](https://docs.podigee.com/documentation/start-here/ai-agents/mcp-reference/limits-errors-and-recovery.md).

**Next step:** [Encode and publish episodes](https://docs.podigee.com/documentation/start-here/ai-agents/media-and-publishing/encode-and-publish-episodes.md).

## Set a cover from an image file

Use this section when the cover is an image file on your computer and your assistant runs there. An assistant in a chat app gives you the page of the show or the episode instead, where you choose the cover.

**What you need:** a PNG or JPEG file that is square, 1400 to 3000 pixels wide, and up to 2 MB. The connection needs `mcp:media:write` and `mcp:podcasts:write`.

1. Ask the assistant to use the file as the cover. Name the show, or the episode for an episode cover.
2. The assistant reads the exact size of the file.
3. The assistant calls `create_upload` with the file name, the size, and an idempotency key.
4. The assistant runs the command in `next_part` with the path of the file. The command prints `HTTP 200`.
5. The assistant calls `update_podcast` for a show cover, or `update_episode` for an episode cover. It sends `"attributes": { "cover_image_upload_id": "..." }` and `"dry_run": true`.
6. Podigee checks the image and returns a preview. The preview changes nothing.
7. Confirm the preview. The assistant sends the same request with an idempotency key and the `confirm` value of the preview.

```json
{
  "podcast_id": 42,
  "attributes": {
    "cover_image_upload_id": "00000000-0000-4000-8000-000000000000"
  },
  "dry_run": true
}
```

`create_podcast` and `create_episode` accept the same field, so a new show or a new episode draft can start with its cover. `create_episode` has no confirmation step: its preview checks the image, and the same call with `idempotency_key` and without `dry_run` creates the draft.

Send `cover_image_upload_id` or `cover_image` (an image address), not both.

**Expected result:** the show or the episode has the new cover. The answer of the tool contains `cover_image_url`. An episode cover goes into the audio file the next time Podigee processes the episode. You can use one image upload for more than one cover during its 24-hour lifetime, for example for a show and for one of its episodes.

**If you cannot set the cover:**

* The preview refuses the image: the error names the rule that the image breaks (format, square shape, minimum size, or maximum size) and the size that Podigee measured. Correct the image, then start a new upload for the new file.
* The command prints a status other than `HTTP 200`: start a new upload with the exact size.
* The error says that the upload is not usable: the upload expired or belongs to a different account. Start a new upload and send the file again.
* The error says that the upload is a recording: use it with `publish_episode`. Start a separate upload for the cover image.
* Do not send an image upload to `publish_episode`. It is not a recording.

**Next step:** to check the other settings of the show, see [Manage podcasts](https://docs.podigee.com/documentation/start-here/ai-agents/podcasts-and-episodes/manage-podcasts.md).

## Continue an interrupted upload

Continue the existing upload. Do not start a new upload for the same file.

**What you need:** the `upload_id`, the same local file with the same size and content, and a connection to the same Podigee user and account.

1. Call `get_upload` with the `upload_id`.
2. Make sure that `byte_size` and `content_type` match the local file.
3. Continue only when the state is `pending` or `uploading`.
4. Read `completed_parts` and `part_count`.
5. Run the command in `next_part` for the missing part. `get_upload` returns a new address each time.
6. Repeat until `get_upload` returns no `next_part`.
7. Call `publish_episode` with the `upload_id`. Podigee checks the file and closes the upload.

A file of up to 5 GB has one part. An interrupted transfer of that part starts again from the first byte.

**Expected result:** only the missing parts are sent, and the original upload completes.

**If the upload cannot continue:**

* The state is `initializing`, `completing`, or `aborting`: wait a few seconds, then call `get_upload` again.
* The state is `completed`: use the upload. Do not send the file again.
* The state is `aborted`, `expired`, or `failed`: start a new upload for the file.

**Next step:** [Encode and publish episodes](https://docs.podigee.com/documentation/start-here/ai-agents/media-and-publishing/encode-and-publish-episodes.md).

## Upload states

| State          | Meaning                               | What to do                                     |
| -------------- | ------------------------------------- | ---------------------------------------------- |
| `initializing` | Podigee prepares the upload.          | Wait. Do not send the file yet.                |
| `pending`      | The upload is ready for the file.     | Send the file or its first part.               |
| `uploading`    | Some parts are in storage.            | Send the missing parts.                        |
| `completing`   | Podigee checks the file.              | Wait.                                          |
| `aborting`     | Podigee removes an expired upload.    | Wait.                                          |
| `completed`    | The file is in Podigee.               | Use the `upload_id` before the upload expires. |
| `aborted`      | Podigee removed the upload.           | Start a new upload.                            |
| `expired`      | The upload was not used in time.      | Start a new upload if you still need the file. |
| `failed`       | Podigee could not prepare the upload. | Start a new upload.                            |

Only `pending` and `uploading` accept file data.

## Upload limits and lifetimes

| Limit                                                     | Value                                                   |
| --------------------------------------------------------- | ------------------------------------------------------- |
| Maximum recording size                                    | 20 GiB, which is five parts                             |
| Maximum cover image size                                  | 2 MB                                                    |
| Part size                                                 | 5 GB. A file of up to 5 GB is one part and one request. |
| Open uploads for each account                             | 10                                                      |
| Declared size of all open uploads for each account        | 40 GiB                                                  |
| Declared size of new uploads for each account in 24 hours | 100 GiB                                                 |
| Parts of new uploads for each account in 24 hours         | 20,000                                                  |
| Lifetime of an upload address                             | 15 minutes                                              |
| Lifetime of an upload                                     | 24 hours                                                |

An upload belongs to the Podigee user and account of the connection that started it. Use it during its lifetime. A recording upload can belong to only one episode. Podigee removes an upload that is not attached to an episode after 24 hours.

When an account reaches a quota, `create_upload` returns `upload_quota_exceeded`. Use or finish the open uploads first, or wait until older uploads are outside the 24-hour period. Use the values that the server returns. Do not hard-code them in a script.

## Next step

* [Encode and publish episodes](https://docs.podigee.com/documentation/start-here/ai-agents/media-and-publishing/encode-and-publish-episodes.md)
* [Media upload protocol](https://docs.podigee.com/documentation/start-here/ai-agents/mcp-reference/media-upload-protocol.md) for the details of parts and addresses
* [Media and publishing tools](https://docs.podigee.com/documentation/start-here/ai-agents/mcp-tools/media-and-publishing.md) for the parameters of `create_upload` and `get_upload`


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.podigee.com/documentation/start-here/ai-agents/media-and-publishing/upload-media-and-cover-images.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
