Skip to main content
POST
/
api
/
series
Create Series
curl --request POST \
  --url https://api.example.com/api/series \
  --header 'Content-Type: application/json' \
  --header 'X-API-Token: <x-api-token>' \
  --data '
{
  "title": "<string>",
  "type": "<string>",
  "description": "<string>",
  "images": [
    {}
  ],
  "metadata": {}
}
'
{
  "200": {},
  "400": {},
  "401": {},
  "422": {},
  "500": {},
  "_id": "<string>",
  "title": "<string>",
  "type": "<string>",
  "description": "<string>",
  "created_at": "<string>"
}

Overview

This endpoint creates a new series (TV show) in the MediaStream platform. The series must have at minimum a title and type specified.

Authentication

This endpoint requires MediaStream API authentication using the X-API-Token header.
X-API-Token
string
required
Your MediaStream API authentication token
Accept
string
default:"application/json"
Content type for the response
Content-Type
string
default:"application/json"
Content type of the request body

Request Body

title
string
required
The title of the series. This is the primary name that will be displayed.
type
string
required
The type of content. Must be "tvshow" for series.
description
string
A detailed description of the series content
images
array
Array of image objects to associate with the series
metadata
object
Additional metadata for the series (structure depends on MediaStream platform)

Response

The response structure depends on the MediaStream platform API. Typically returns the created series object.
_id
string
Unique identifier for the newly created series
title
string
The title of the series
type
string
Type of content (“tvshow”)
description
string
Description of the series
created_at
string
Timestamp when the series was created

Example Request

curl -X POST "https://your-domain.com/api/series" \
  -H "X-API-Token: your_api_token" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "title": "Breaking Bad",
    "type": "tvshow",
    "description": "A high school chemistry teacher turned methamphetamine producer"
  }'

Example Response

{
  "_id": "507f1f77bcf86cd799439011",
  "title": "Breaking Bad",
  "type": "tvshow",
  "description": "A high school chemistry teacher turned methamphetamine producer",
  "images": [],
  "seasons": [],
  "created_at": "2024-03-05T10:30:00Z",
  "updated_at": "2024-03-05T10:30:00Z"
}

Response Status Codes

200
Success
Series successfully created
400
Bad Request
Invalid request data or missing required fields
401
Unauthorized
Invalid or missing API token
422
Unprocessable Entity
Validation error - the request data doesn’t meet requirements
500
Internal Server Error
An error occurred while creating the series in MediaStream

Validation Rules

Based on the web controller implementation:
  • title: Required, must be a string, maximum 255 characters
  • type: Required, must be “tvshow”

Notes

  • The endpoint proxies requests to the MediaStream platform API at /show
  • All request data is forwarded to the MediaStream platform
  • The series type is currently limited to “tvshow” in the application
  • After creating a series, you can add seasons and episodes using their respective endpoints

Build docs developers (and LLMs) love