> 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/import-a-podcast.md).

# Import a podcast

Import a podcast from its RSS feed into Podigee, then follow, resume, or cancel the import.

Your assistant can move a podcast from another host to Podigee. It reads the RSS feed of the podcast, creates the episodes in Podigee, and encodes their audio. An import can run for an hour or longer, so it runs as an operation that you can follow, resume, or cancel.

To import in the browser instead, see [Import a podcast from another host](https://docs.podigee.com/documentation/create-and-publish/hosting-and-management/import-a-podcast-from-another-host.md).

## What you need

* A current Podigee plan, Launch included, or an older paid plan. An older trial, an older free plan, or a collaborator plan cannot import. Run `doctor` before you start: it says when the plan or the subscription blocks an import. See [Check your account, plan, and readiness](https://docs.podigee.com/documentation/start-here/ai-agents/work-safely/check-your-account-plan-and-readiness.md).
* A connection with the scopes `mcp:podcasts:write` and `mcp:media:write`. The scope table is in [Authorization and scopes](https://docs.podigee.com/documentation/start-here/ai-agents/mcp-reference/authorization-and-scopes.md).
* For an import into a new podcast: a connection to your own account. At sign-in, this is the account under **Your account**. For a member of an organization, it is the organization. A connection to an account under **Shared with you** gets the error that account-level access is necessary. Such a connection can import only into an existing podcast.
* The public address of the RSS feed, with `http` or `https`.

Every import has two steps: a preview with `dry_run: true`, then the same request with an idempotency key and the `confirm` value of the preview, after you said yes. The rules are in [Preview and confirm changes](https://docs.podigee.com/documentation/start-here/ai-agents/work-safely/preview-and-confirm-changes.md).

## Prepare the feed

1. Get the public address of the RSS feed from your current host.
2. Open the feed and check its title and its most recent episodes.
3. Check that the episodes that you want have an audio file.
4. Decide on the target: a new podcast, or an existing podcast in Podigee. For an existing podcast, get its podcast ID with `list_podcasts`.
5. Decide how many episodes to import and what to do with entries without audio. See [Limit or filter the episodes](#limit-or-filter-the-episodes).

Podigee refuses a feed address on a local, internal, or blocked network. Do not put a password or another secret into the feed address or into the conversation.

**Next step:** [Preview the import](#preview-the-import).

## Preview the import

Always preview the feed before you confirm an import.

1. The assistant calls `import_podcast` with `feed_url` and `dry_run: true`.
2. For an existing podcast, it adds `podcast_id` and `confirm_existing_podcast: true`.
3. It adds `episode_limit` and `skip_episodes_without_audio` when you want them.
4. Check that `feed.reachable` is `true`.
5. Read the feed title (`feed.title`), the number of episodes in the feed (`feed.total_episodes`), and the total duration in hours (`feed.total_duration_hours`).
6. Compare the number of episodes with `episode_limit` in the preview.
7. Check the target, the limit, and the filter in the preview.

```json
{
  "feed_url": "https://feeds.example.com/the-morning-mug.xml",
  "episode_limit": 50,
  "skip_episodes_without_audio": true,
  "dry_run": true
}
```

The preview reports the number of episodes in the feed. It does not promise the number that Podigee imports. Podigee keeps the preview of a feed for 5 minutes. A change to the feed in this time can show in a later preview only.

**Expected result:** the preview shows a reachable feed, its title, and its size, and the target and scope are correct.

**If the feed is not reachable:** `feed.reachable` is `false`, and `feed.error_type` and `feed.message` give the cause. Do not confirm the import. Correct the address or the access to the feed, then preview again.

## Limit or filter the episodes

| Parameter                     | Values            | Default | Effect                                                     |
| ----------------------------- | ----------------- | ------- | ---------------------------------------------------------- |
| `episode_limit`               | 1 to 1,000        | 1,000   | Imports at most this number of episodes.                   |
| `skip_episodes_without_audio` | `true` or `false` | `false` | `true` leaves out feed entries without a valid audio file. |

The limit is a maximum, not a promise. Entries that are not valid, that are duplicates, that have no audio, or that fail can make the final number smaller. Compare the imported episode IDs with your expectation after the import.

If the count differs, do not run the full feed again. Find the entries that are missing:

* After a failure, `error.skipped_episode_guids` and `error.failed_episode_guid` in the operation name the feed entries that were skipped or that failed.
* After a success, compare the GUIDs of the feed entries with the imported episodes.

Repair only those entries. A new import into the same podcast does not create the existing episodes again, because Podigee finds them by their GUID.

## Import into a new podcast

**What you need:** a preview without `podcast_id`, and a connection to your own account.

1. Check the preview: the feed title, the number of episodes, the duration, the limit, and the filter.
2. Say yes. The assistant sends the same request with an idempotency key and the `confirm` value.
3. The assistant keeps the returned `operation_id` and `podcast_import_id`.
4. The assistant follows the operation. See [Follow the import](#follow-the-import).
5. When the operation succeeds, the assistant reads the new podcast and some imported episodes.

**Expected result:** Podigee creates one podcast and imports the reviewed episodes into it.

**If a previous import of the same feed exists:** do not create another podcast from the same feed. Import into the existing podcast instead.

**If the answer is lost:** read the operation, or send the identical request again with the same idempotency key. Do not use a new key until you know what happened to the first request.

## Import into an existing podcast

**What you need:** the podcast ID, and access to that podcast.

1. Read the podcast with `get_podcast` and make sure it is the correct one.
2. Preview `import_podcast` with `feed_url`, `podcast_id`, and `confirm_existing_podcast: true`.
3. Check the feed title and the target podcast in the preview.
4. Say yes. The assistant sends the same request with an idempotency key and the `confirm` value.
5. The assistant follows the operation.
6. The assistant checks the imported episode IDs in the podcast.

Podigee compares the feed entries with the episodes of the podcast by their GUID (the unique ID of each feed entry). It does not import an episode again when an episode with the same GUID is already complete in the podcast. An episode with a different GUID does not match, for example an episode that you made in Podigee. When you are not sure, stop before the confirmation, check the episodes with `list_episodes`, and choose a smaller limit.

**Expected result:** Podigee adds the episodes to the existing podcast and creates no new podcast.

**If the target is refused:** make sure that the podcast belongs to the connected account and that you have access to it. Do not try another podcast ID that you did not check.

## Follow the import

The assistant reads the operation with `get_operation`.

| State              | Stage                               | Meaning                                                                                                         |
| ------------------ | ----------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| `queued`           | `queued`                            | The import waits to start.                                                                                      |
| `running`          | `analyzing` or `importing`          | Podigee reads the feed or creates the episodes. The progress shows how many episodes of the total are imported. |
| `waiting`          | `encoding`                          | Podigee encodes the audio of the imported episodes.                                                             |
| `succeeded`        | `finished`                          | The import is complete.                                                                                         |
| `failed_retryable` | `failed`                            | The import stopped and can continue.                                                                            |
| `failed_terminal`  | `failed` or `authorization_revoked` | The import ended and cannot continue.                                                                           |
| `cancelled`        | `cancelled`                         | The import was canceled.                                                                                        |

When the state is `succeeded`, the result has `podcast_id` and `imported_episode_ids`. Check two more fields before you call the import clean:

* `partial_failure: true` and `encoding_failures`: the encoding of some episodes failed. The podcast can still have playable episodes. Tell the person how many episodes failed and check them.
* When the state is `failed_terminal` with the error code `encoding_failed`, the encoding of every imported episode failed. The result still has `podcast_id` and `imported_episode_ids`, so you can find the episodes.

The general rules for operations are in [Follow and recover long-running operations](https://docs.podigee.com/documentation/start-here/ai-agents/work-safely/follow-and-recover-long-running-operations.md).

## Resume, cancel, or repair an import

### Resume an import that stopped

An import that was paused, or that stopped for a cause that can clear, has the state `failed_retryable`.

1. The assistant previews `resume_operation` with the `operation_id` and `dry_run: true`.
2. Say yes. The assistant sends the request with the `confirm` value.
3. The assistant follows the same operation again.

**Expected result:** the same operation continues from where it stopped. No second podcast or second copy of an episode is made.

**If the resume is refused:** "Operation is not retryable" means that the import cannot continue. Read `error.message`. For an encoding failure, see [Repair an import whose encoding failed](#repair-an-import-whose-encoding-failed). For the other refusals, 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#resume-an-operation).

### Cancel an import

1. The assistant previews `cancel_operation` with the `operation_id`.
2. Say yes. The assistant sends the request with the `confirm` value.
3. The assistant follows the operation until the state is `cancelled`.
4. The assistant checks which episodes were imported before the cancellation.

**Expected result:** the import stops, and the episodes that it already imported stay.

**If the cancellation is refused:** "Operation is already complete" means that the import ended before the cancellation. Read its result. For `operation_in_progress`, check the operation again later and do not start a new import.

### Repair an import whose encoding failed

Do not call `resume_operation` for an import in the state `failed_terminal`. The import has ended.

1. Check the podcast ID and the imported episode IDs in the result.
2. Preview a new import of the same feed into that podcast, with a new idempotency key. See [Import into an existing podcast](#import-into-an-existing-podcast).
3. Confirm the new import after you checked the target and the scope.
4. Follow the new operation and check its result.

The new import does not create the episodes again. Podigee finds them by their GUID and encodes the failed ones again.

**If the authorization changed:** connect again to the same account with the necessary scopes. Then get a new preview for the resume or the cancellation. Do not use an old `confirm` value.

## Next step

* [Distribute a podcast](https://docs.podigee.com/documentation/start-here/ai-agents/content-analytics-and-distribution/distribute-a-podcast.md) to move the directories to the new feed
* [Manage episodes](https://docs.podigee.com/documentation/start-here/ai-agents/podcasts-and-episodes/manage-episodes.md) to check the imported episodes
* [Import and operation tools](https://docs.podigee.com/documentation/start-here/ai-agents/mcp-tools/import-and-operations.md) for the parameters of `import_podcast`, `resume_operation`, and `cancel_operation`


---

# 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/import-a-podcast.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.
