---
title: "create_episode"
description: "Create an episode"
canonical: "https://poddub.com/docs/agents/tools/create_episode"
last-updated: "2026-10-29"
---

# create_episode

Create an episode

Starts an episode from one or more sources of one team, with a format, a length and a language, and comes back at once while poddub writes the script. Any member can use it in their own team, once they have accepted the provider list in the app. It never skips that consent or the organization's allowance, and it never waits for the script: follow the episode with [`get_episode`](/docs/agents/tools/get_episode).

## What the server says

The description an agent is given, word for word. This tool makes changes.

> Start an episode from one or more sources of one team, each named once. It returns at once in `scripting`; call get_episode every 20 to 30 seconds until it is in `review`. Refused with consent_required until you have accepted the provider list in the app, with minutes_exhausted or attempts_exhausted when the allowance is spent, and with generation_paused while poddub's operator has paused generation (nothing is charged; try again later). language defaults to the show's.

## Input

| Field           | Type         | Required | What it takes                                 |
| --------------- | ------------ | -------- | --------------------------------------------- |
| `teamId`        | text         | yes      | not empty                                     |
| `sourceIds`     | list of text | yes      | at least 1                                    |
| `targetMinutes` | number       | yes      | one of `5`, `10`, `15`                        |
| `format`        | text         | yes      | one of `dialogue`, `narrator`                 |
| `language`      | text         | no       | matches `^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$` |

## Refusals

A refusal comes back as the tool's result, marked as an error, with the code and what explains it.

| Code                       | What it means                                                                                                                                         |
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `consent_required`         | The key's person has not accepted the current list of providers poddub works with, or withdrew it. Only that person can accept it, in the app.        |
| `team_not_found`           | The team is not one of the person's own teams.                                                                                                        |
| `team_archived`            | The team is archived and takes no new work.                                                                                                           |
| `source_not_found`         | A source named is not one the person can see, is in another team, or was deleted.                                                                     |
| `source_not_usable`        | A source cannot be made into an episode yet, such as an uploaded file that has not been processed.                                                    |
| `generation_paused`        | poddub's operator has paused generation for now. Nothing was counted or charged. Try again later; reading, editing by hand and publishing still work. |
| `plan_required`            | The organization has no plan. An owner chooses one in the app.                                                                                        |
| `minutes_exhausted`        | The minutes left in this period are fewer than the episode needs. The refusal carries the allowance and when it resets.                               |
| `attempts_exhausted`       | The period's script generations are spent. The refusal carries the allowance and when it resets.                                                      |
| `episode_sources_too_many` | More sources than the plan allows in one episode.                                                                                                     |
| `episode_sources_too_long` | More text across the sources than the plan allows in one episode.                                                                                     |

Every tool can also answer `rate_limited` and `not_a_member`: see [Limits](/docs/agents/limits) and [Keys](/docs/agents/keys).
