> 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/transfer-media-encode-and-publish/complete-or-abort-an-upload.md).

# Complete or abort an upload

Validate a finished transfer or cleanly remove an incomplete upload session.

Complete a session only after every expected byte is present. Abort it when the transfer should not continue.

## Before you start

* Keep the opaque upload ID.
* Inspect the current session state and expiry.
* Confirm whether the original file and transfer are still needed.

## Complete an upload

1. Inspect the upload session.
2. Confirm that every expected part has been transferred.
3. Call `complete_upload` with the upload ID.
4. Wait while the state is `completing`.
5. Confirm that the final state is `completed`.
6. Keep the upload ID for production or publishing.

Podigee checks provider metadata for single uploads. For multipart uploads, it validates part numbers, order, sizes, and total bytes before completion.

## Abort an upload

1. Confirm that the upload is incomplete and no longer needed.
2. Call `abort_upload` with the upload ID.
3. Wait while the state is `aborting`.
4. Confirm that the final state is `aborted`.

Completion and abort calls are idempotent.

## Expected result

A valid transfer becomes `completed`, or an unwanted incomplete transfer becomes `aborted` and its temporary uploaded data is removed.

## If completion fails

Inspect the session and compare completed parts with the expected plan. Transfer any missing or incorrect part again with a fresh URL, then retry completion for the same session.

## Next step

[Create an episode production from uploaded media](/documentation/start-here/ai-agents/transfer-media-encode-and-publish/create-an-episode-production-from-uploaded-media.md).


---

# 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/transfer-media-encode-and-publish/complete-or-abort-an-upload.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.
