Skip to main content
PUT
/
api
/
series
/
{showId}
/
seasons
/
{seasonId}
/
chapters
/
{chapterId}
Update Episode
curl --request PUT \
  --url https://api.example.com/api/series/{showId}/seasons/{seasonId}/chapters/{chapterId} \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "<string>",
  "description": "<string>",
  "content": [
    {}
  ],
  "images": [
    {}
  ]
}
'
{
  "_id": "<string>",
  "title": "<string>",
  "description": "<string>",
  "content": [
    {}
  ],
  "images": [
    {}
  ],
  "updatedAt": "<string>"
}

Overview

This endpoint updates an existing episode’s information, including its title, description, video content, and thumbnail images.

Path Parameters

showId
string
required
The unique identifier of the series
seasonId
string
required
The unique identifier of the season
chapterId
string
required
The unique identifier of the episode to update

Body Parameters

title
string
Updated episode title
description
string
Updated episode description
content
array
Updated video content array. Must contain valid MediaStream video IDs.
[
  {
    "value": {
      "_id": "5f8a3d2b1c9d440000123456"
    }
  }
]
images
array
Updated array of thumbnail images
You only need to include the fields you want to update. Omitted fields will remain unchanged.

Request Example

curl -X PUT "https://your-domain.com/api/series/abc123/seasons/def456/chapters/ghi789" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "title": "Episode 1: A New Beginning",
    "description": "Updated description with more details about the episode content"
  }'
The MediaStream API uses POST method for updates. The Laravel controller automatically handles this conversion from PUT to POST.

Response

_id
string
The episode identifier (unchanged)
title
string
Updated episode title
description
string
Updated episode description
content
array
Updated video content array
images
array
Updated thumbnail images
updatedAt
string
ISO 8601 timestamp of the update

Success Response Example

{
  "_id": "64a7f2b1c8d4e12345abcdef",
  "title": "Episode 1: A New Beginning",
  "description": "Updated description with more details about the episode content",
  "content": [
    {
      "value": {
        "_id": "5f8a3d2b1c9d440000123456"
      }
    }
  ],
  "images": [
    {
      "_id": "img123",
      "path": "/images/episode1.jpg",
      "basePath": "/images/episodes/pilot"
    }
  ],
  "createdAt": "2024-03-01T10:30:00Z",
  "updatedAt": "2024-03-05T16:45:00Z"
}

Common Update Scenarios

Change the episode title to something more descriptive:
{
  "title": "Episode 1: The Journey Begins"
}
Enhance the episode description with more details:
{
  "description": "In this exciting first episode, our heroes embark on an adventure that will change their lives forever. Watch as they discover hidden secrets and face unexpected challenges."
}
Update the video content with a new upload:
{
  "content": [
    {
      "value": {
        "_id": "new-video-id-from-mediastream"
      }
    }
  ]
}
Update several fields at once:
{
  "title": "Episode 1: Revised Edition",
  "description": "Remastered version with enhanced quality",
  "content": [
    {
      "value": {
        "_id": "remastered-video-id"
      }
    }
  ]
}

Error Responses

The specified episode, season, or series does not exist.
{
  "error": "Episode not found"
}
Invalid data format or validation error.
{
  "error": "Validation failed",
  "details": {
    "content": "Invalid video ID format"
  }
}
Invalid or missing API authentication.
{
  "error": "Unauthorized access"
}
Server error while updating the episode.
{
  "error": "Failed to update episode"
}

Notes

When updating video content, ensure the new video ID is valid and the video has been successfully uploaded to MediaStream. Invalid video IDs will cause playback failures.
It’s best practice to update only the fields that have changed rather than sending the entire episode object. This reduces bandwidth and processing time.
Updates are reflected immediately in the UI. Users viewing the episode list or detail page will see the changes after refreshing.

Build docs developers (and LLMs) love