---
title: "Import script text and generate a new episode (asynchronous)"
method: POST
path: "/v1/episodes/import"
tags: ["Episodes"]
---

# Import script text and generate a new episode (asynchronous)

`POST /v1/episodes/import`

## Request

- Base URL: `https://api.jellypod.com`
- URL: `https://api.jellypod.com/v1/episodes/import`
- Auth: HTTP bearer

## Headers

- `idempotency-key` string: Optional key for one logical generation command. Reuse the same key and input after a lost or uncertain response. After a proven rejection before work starts, follow recovery.idempotency_key. Omit it to start a new generation on every request.

## Request body

- ImportEpisodeInput: Fields for importing script or transcript text and generating a new episode asynchronously.
  - `podcast_id` string, uuid, required: Podcast that will own the imported generated episode.
  - `render` boolean: Render audio and video after generation only when explicitly requested. Defaults to false, leaving an editable draft. Generation uses credits; rendering is free.
  - `script` string, required: Script or transcript text. Bracketed speaker labels match saved Characters unless speaker_characters explicitly assigns their Character IDs.
  - `speaker_characters` object[]: Optional explicit assignments for a finished script: label as written in [brackets], and character_id from list_characters. Assignments override name matching; unmapped labels still match saved Character names.
    - `character_id` string, required
    - `label` string, required

## Response `202`

Imported episode queued for generation

- AcceptedEpisodeResponse: Acknowledgement for an asynchronously-generated episode.
  - `data` object, required
    - `created_at` string, required
    - `host_ids` string[], required
    - `id` string, required
    - `podcast_id` string, required
    - `status` 'generating', required
    - `updated_at` string, required
    - `workflow_run_id` string, required

## Other responses

- `400`: Validation failed or malformed request.
- `401`: Missing or invalid API key.
- `403`: Authenticated, but this API key does not have access to this resource.
- `404`: Resource not found.
- `415`: Request `Content-Type` is not supported for this endpoint.
- `422`: Request was well-formed but the resource is in a state that does not allow this operation (e.g. publishing an episode that has not finished rendering).
- `429`: Rate limit exceeded. Response includes `Retry-After`, `RateLimit`, and `RateLimit-Policy` headers (IETF draft).
- `500`: Internal server error.
- `502`: The API could not enqueue the downstream asynchronous workflow.

---

[API](https://skmtc.dev/jellypod/apis/jellypod-api.md) · [All operations](https://skmtc.dev/jellypod/apis/jellypod-api/llms.txt) · [OpenAPI document](https://skmtc.dev/jellypod/apis/jellypod-api/revisions/ba945de68cf7?raw)
