Overview
This endpoint permanently deletes an episode from a season. This action cannot be undone.
Deleting an episode is permanent and cannot be reversed. Make sure you want to delete the episode before proceeding.
Path Parameters
The unique identifier of the series
The unique identifier of the season
The unique identifier of the episode to delete
Request Example
curl -X DELETE "https://your-domain.com/api/series/abc123/seasons/def456/chapters/ghi789" \
-H "Accept: application/json"
Response
Indicates whether the deletion was successful
Success Response Example
{
"success" : true ,
"message" : "Episode deleted successfully"
}
What Gets Deleted
When you delete an episode, the following data is removed:
Episode Metadata Title, description, and all episode information
Episode Reference The episode’s association with the season
Thumbnail Images Episode thumbnail references (actual files remain in CDN)
Content References References to video content (videos remain in MediaStream)
Deleting an episode removes only the episode record. The actual video files in MediaStream and images in the CDN are not deleted and can be reused in other episodes.
Before Deleting
Consider these factors before deleting an episode:
Active viewers will lose access to the episode
Episode links will become invalid
Navigation order may change in the season
Users who bookmarked the episode will see errors
Episode metadata is permanently deleted
Analytics and view history may be affected
Comments or ratings (if implemented) will be lost
Cannot undo this operation
Instead of deleting, consider:
Unpublishing the episode (if feature available)
Moving the episode to a different season
Updating the episode with corrected content
Marking as “coming soon” or “unavailable”
Error Responses
The specified episode, season, or series does not exist. {
"error" : "Episode not found"
}
Invalid or missing API authentication. {
"error" : "Unauthorized access"
}
Insufficient permissions to delete the episode. {
"error" : "You do not have permission to delete this episode"
}
500 Internal Server Error
Server error while deleting the episode. {
"error" : "Failed to delete episode"
}
Best Practices
Always implement a confirmation dialog in your UI: if ( confirm ( 'Are you sure you want to delete this episode? This action cannot be undone.' )) {
await deleteEpisode ( showId , seasonId , chapterId );
}
Before deleting, consider:
Exporting episode metadata for records
Documenting the video IDs for future reference
Saving analytics data if needed
Creating a backup of episode information
After deleting an episode:
Update season episode counts in your UI
Refresh episode lists to reflect changes
Update any cached data
Check for broken links or references
Maintain logs of deletions:
Who deleted the episode
When it was deleted
What episode was deleted (title, ID)
Reason for deletion (if available)
Example: Delete with Confirmation
async function deleteEpisodeWithConfirmation ( showId , seasonId , chapterId ) {
// Fetch episode details first
const episode = await fetch (
`/api/series/ ${ showId } /seasons/ ${ seasonId } /chapters/ ${ chapterId } `
). then ( res => res . json ());
// Show confirmation with episode details
const confirmed = confirm (
`Delete " ${ episode . title } "? \n\n ` +
`This will permanently remove the episode from your season. \n ` +
`This action cannot be undone.`
);
if ( ! confirmed ) {
return { cancelled: true };
}
// Proceed with deletion
const response = await fetch (
`/api/series/ ${ showId } /seasons/ ${ seasonId } /chapters/ ${ chapterId } ` ,
{ method: 'DELETE' }
);
return response . json ();
}
Notes
This operation is irreversible. Once an episode is deleted, it cannot be recovered through the API. You would need to recreate it manually with all its metadata.
If you need to temporarily remove an episode from public view, consider implementing a “published” status field instead of deleting it entirely.
After successful deletion, update your UI to remove the episode from lists and redirect users who may be viewing the deleted episode’s page.