Skip to main content
PUT
/
api
/
series
/
{showId}
/
seasons
/
{seasonId}
Update Season
curl --request PUT \
  --url https://api.example.com/api/series/{showId}/seasons/{seasonId} \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "<string>",
  "description": "<string>"
}
'
{
  "_id": "<string>",
  "title": "<string>",
  "description": "<string>",
  "images": [
    {
      "_id": "<string>",
      "path": "<string>",
      "basePath": "<string>"
    }
  ],
  "error": {
    "message": "<string>",
    "status": 123
  }
}

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

showId
string
required
The unique identifier of the series that contains the season. This is the MongoDB ObjectId of the parent series.
seasonId
string
required
The unique identifier of the season to update. This is the MongoDB ObjectId of the season.

Body Parameters

title
string
The new title for the season. If omitted, the current title remains unchanged.
description
string
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

_id
string
Unique identifier for the updated season (MongoDB ObjectId)
title
string
The updated title of the season
description
string
The updated description of the season
images
array
Array of image objects associated with the season
_id
string
Unique identifier for the image
path
string
Relative path to the image file
basePath
string
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
Error object returned when the request fails
message
string
Description of the error
status
number
HTTP status code

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

Build docs developers (and LLMs) love