Overview
This endpoint creates a new episode within a specific season of a series. Episodes contain video content, metadata, and can be played back using the MediaStream player.
Path Parameters
The unique identifier of the series
The unique identifier of the season
Body Parameters
The episode title (e.g., “Episode 1: Pilot”, “Introduction to Laravel”)
A description of what happens in this episode
The video content associated with this episode. Must contain video IDs from MediaStream. [
{
"value" : {
"_id" : "5f8a3d2b1c9d440000123456"
}
}
]
Optional array of thumbnail images for the episode
Request Example
curl -X POST "https://your-domain.com/api/series/abc123/seasons/def456/chapters" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"title": "Episode 1: Getting Started",
"description": "An introduction to the series and what to expect",
"content": [
{
"value": {
"_id": "5f8a3d2b1c9d440000123456"
}
}
]
}'
Response
Unique identifier for the newly created episode
Success Response Example
{
"_id" : "64a7f2b1c8d4e12345abcdef" ,
"title" : "Episode 1: Getting Started" ,
"description" : "An introduction to the series and what to expect" ,
"content" : [
{
"value" : {
"_id" : "5f8a3d2b1c9d440000123456"
}
}
],
"images" : [],
"createdAt" : "2024-03-05T10:30:00Z" ,
"updatedAt" : "2024-03-05T10:30:00Z"
}
Error Responses
Missing required fields or invalid data format. {
"error" : "Validation failed" ,
"details" : {
"title" : "The title field is required" ,
"content" : "The content field is required"
}
}
The specified series or season does not exist. {
"error" : "Season not found"
}
Invalid or missing API authentication. {
"error" : "Unauthorized access"
}
500 Internal Server Error
Server error while creating the episode. {
"error" : "Failed to create episode"
}
Notes
Before creating an episode, ensure that:
The parent series and season exist
Video content has been uploaded to MediaStream
You have valid video IDs from MediaStream
The content field must contain valid MediaStream video IDs. Invalid or non-existent video IDs will cause playback errors.
You can create episodes without images initially and add them later using the update endpoint.