POST /v2/courses/{course_id}/podcasts/generate
Generate podcast episodes
For each chapter in a course, this endpoint writes a podcast-style script, runs it through TTS, uploads the audio, and stores an episode record. It returns immediately — TTS happens in the background — and you list the resulting episodes via GET /v2/courses/{course_id}/podcasts.
Calling it twice is safe: chapters that already have a ready episode are skipped, and only the gaps get filled.
Request
Headers
| Header | Required | Notes |
|---|---|---|
X-API-Key | yes | |
X-External-User-Id | yes (or X-User-Id) | Must own the course |
Content-Type | yes | application/json (body may be empty {}) |
Path parameters
course_id string (UUID) required The course whose chapters become episodes. |
Query parameters
tts_provider enum default openai One of openai, elevenlabs. Defaults to your tenant’s configured provider. |
Returns
{
"message": "Started generating podcasts for 5 chapters.",
"course_id": "8fa640c0-22e6-436b-becd-bf2cfc86741a",
"total_chapters": 5,
"ready": 0,
"failed": 0,
"status": "generating"
}
status is one of:
generating— TTS is running in the background.resuming— Some chapters already had episodes; only the missing ones are being generated.already_complete— Every chapter already has areadyepisode; this call was a no-op.
Poll GET /v2/courses/{course_id}/podcasts every few seconds, or subscribe to the (upcoming) podcast.episode_ready webhook. TTS at typical chapter length is ~10–25s per chapter, parallelized.
Errors
- 404 — Course not found.
- 409 — Course is still generating; wait for the course itself before requesting podcasts.
- 422 — Unknown
tts_provider.