Overview
Updates the details of an existing season. You can modify the title, description, and other metadata. This endpoint allows partial updates, so you only need to include the fields you want to change.
Endpoint
PUT /api/series/{showId}/seasons/{seasonId}
While the standard HTTP method for this endpoint is PUT, the backend implementation uses POST for compatibility with the MediaStream API service.
Path Parameters
The unique identifier of the series that contains the season. This is the MongoDB ObjectId of the parent series.
The unique identifier of the season to update. This is the MongoDB ObjectId of the season.
Body Parameters
The new title for the season. If omitted, the current title remains unchanged.
The new description for the season. If omitted, the current description remains unchanged.
You can send any fields you want to update. Fields not included in the request will retain their current values.
Response
Unique identifier for the updated season (MongoDB ObjectId)
The updated title of the season
The updated description of the season
Array of image objects associated with the season Unique identifier for the image
Relative path to the image file
Base path for constructing the full CDN URL
Example Request
Update Title and Description
curl -X PUT "https://your-domain.com/api/series/507f1f77bcf86cd799439011/seasons/507f191e810c19729de860ea" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"title": "Season 1: The Beginning",
"description": "An updated description with more details about the season"
}'
Update Only Title
curl -X PUT "https://your-domain.com/api/series/507f1f77bcf86cd799439011/seasons/507f191e810c19729de860ea" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"title": "Season 1: The Beginning"
}'
Example Response
{
"_id" : "507f191e810c19729de860ea" ,
"title" : "Season 1: The Beginning" ,
"description" : "An updated description with more details about the season" ,
"images" : [
{
"_id" : "507f191e810c19729de860eb" ,
"path" : "/seasons/season1-cover.jpg" ,
"basePath" : "/images/seasons/507f191e810c19729de860ea/season1-cover.jpg"
}
]
}
Error Responses
Error object returned when the request fails
404 Not Found
Returned when the series or season does not exist:
{
"error" : {
"message" : "Season not found" ,
"status" : 404
}
}
400 Bad Request
Returned when the request data is invalid:
{
"error" : {
"message" : "Invalid request data" ,
"status" : 400
}
}
500 Internal Server Error
Returned when there’s a server-side error:
{
"error" : {
"message" : "Failed to update season" ,
"status" : 500
}
}
Implementation Notes
The endpoint is implemented in app/Http/Controllers/Api/SeasonController.php in the update method
Laravel’s resource controller maps PUT requests to this method
The implementation forwards the request as a POST to the MediaStream API for compatibility
All request data from $request->all() is passed to the MediaStream service
Both showId and seasonId are required in the URL path
Controller Implementation
From app/Http/Controllers/Api/SeasonController.php:
public function update ( Request $request )
{
$showId = $request -> route ( 'showId' );
$seasonId = $request -> route ( 'seasonId' );
$response = MediastreamService :: request (
'/show/' . $showId . '/season/' . $seasonId ,
'post' ,
$request -> all ()
);
return $response -> json ();
}
Frontend Integration
To update a season from the frontend, you can use the edit link shown in the season template:
< Link
: href = " `series/ ${ props ?. showId } /season/ ${ props ?. seasonId } ` "
class = "flex w-8 aspect-square hover:bg-content-3 items-center justify-center" >
<Icon name="Pencil" size="24"></Icon>
</ Link >
See resources/js/components/template/series/season-template.vue for the complete implementation.
Get Season Retrieve current season details
Delete Season Remove the season
List Seasons View all seasons
Create Season Add a new season