My TV Channel Content API
Get video in, and follow it through transcoding to ready.
Get video in, and follow it through transcoding to ready.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/my-tv-channel-com:my-tv-channel-com-content-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: My TV Channel — Agent Content API
version: 1.0.0
summary: Create and run 24/7 linear HLS TV channels programmatically.
description: 'Create and run 24/7 linear TV channels — the kind that just play, with no menu to browse.
Import videos, and the service transcodes them, builds a continuous schedule, and streams
the result at `https://{handle}.my-tv-channel.com` and in the iOS, iPadOS, tvOS, macOS,
Android, Fire TV and Roku apps.
## Before you start
- **Every response uses the same envelope:** `{"success": true, "data": ...}` or
`{"success": false, "error": "...", "code": N}`. There is exactly one exception, and it
is called out on the operation: `GET /channels/schedule.php` returns `data` as a bare
**array**.
- **Authentication is an API key**, `Authorization: Bearer mytv_sk_...`, created by a
signed-in human at or in the app under
Profile → Agent Access. An active subscription on any tier is required, and the key
inherits the owner''s tier limits. **An agent cannot mint its own key, by design** — if
you do not have one, ask the owner for one.
- **Rate limit:** 1,000 requests/hour per key. Exceeding it returns `429` with
`Retry-After`; honour it rather than spinning.
- **Start with `GET /users/status.php`.** It returns the tier, the real quota numbers for
this account, every channel, and for each one exactly what it still needs before it can
go live. Agents that skip this step guess, and guessing is expensive.
## The two things that catch everyone
1. **Weights only reach the air when the schedule is generated.** A channel builds its
schedule the instant it crosses the launch threshold, from the weights present at that
moment. Weights set afterwards are stored faithfully, reported back correctly, and do
not change what is broadcasting. Either set each asset''s weight as soon as it reports
`ready`, or call `POST /schedule/regenerate.php` when you are done.
2. **You cannot upload a local file over MCP**, because tool arguments are JSON and there
is no multipart channel. `POST /assets/import-url.php` is therefore the ingestion path
for an agent. `POST /assets/upload.php` exists for clients that can post multipart.
## Going live
A channel launches **automatically** once it has ≥ 4 ready assets **and** ≥ 15 minutes of
content with weight > 0. Transcoding is the slow step. Poll `GET /assets/status.php` for
`summary.meetsLaunchRequirements`, then `GET /channels/get.php` until `scheduleStatus` is
`active`, then report the watch URL to the owner.'
contact:
name: My TV Channel
url: https://my-tv-channel.com/agents/
license:
name: Proprietary
url: https://my-tv-channel.com/terms.html
servers:
- url: https://my-tv-channel.com/api/mytvchannel
description: Production (canonical host)
- url: https://my-tv-channel.com/api/mytvchannel
description: Production (legacy host, still live — prefer the canonical one)
security:
- bearerAuth: []
tags:
- name: Content
description: Get video in, and follow it through transcoding to ready.
paths:
/assets/upload.php:
post:
operationId: uploadAsset
tags:
- Content
summary: Upload a video file (multipart)
description: 'Posts a video file directly. **An MCP client cannot call this** — tool arguments are
JSON and there is no multipart channel. Use `POST /assets/import-url.php` instead, or
have the owner upload through the app.
Accepted: MP4, MOV, M4V, MPEG, AVI. Duration is charged against the rolling 7-day
upload quota. The asset lands in `pending` and follows
`pending → transcoding → ready`.'
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
required:
- file
- channel_id
properties:
file:
type: string
format: binary
channel_id:
type: integer
title:
type: string
responses:
'200':
description: Accepted for transcoding
content:
application/json:
schema:
$ref: '#/components/schemas/ApiSuccess'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/QuotaExceeded'
'413':
description: Body too large. If you see an HTML error page rather than the JSON envelope here, it came from the web server rather than the application.
/assets/import-url.php:
post:
operationId: importVideoFromUrl
tags:
- Content
summary: Import a video from a public URL
description: '**The main way an agent adds content.** The server fetches the file, so you do not
download it yourself.
The URL must be a **direct, public, unauthenticated** media link — `mp4`, `mov`,
`m4v`, `mpeg`, `mpg`, `avi`, or a **finite** `.m3u8` (VOD, not a live stream). Not a
web page, not something behind a login.
- Rejected with `400` immediately if it cannot be probed as video, so you get a clear
error rather than a silent failure later.
- Quota is charged on the video''s duration, checked at submit **and** re-verified
against the real file after download — a source that misreports duration fails then.
- Maximum 20 queued imports at a time (`429` beyond that).
- Submitting the same URL to the same channel twice returns the original asset with
`duplicate: true` instead of importing again, so retries are safe.
Returns immediately; the asset starts at `downloading`, then
`pending → transcoding → ready`. **Set `weight` here** rather than after the fact —
see the note on the schedule endpoints.'
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- channel_id
- url
properties:
channel_id:
type: integer
description: '`channelId` is also accepted.'
url:
type: string
format: uri
title:
type: string
tags:
type: array
items:
type: string
weight:
$ref: '#/components/schemas/Weight'
responses:
'200':
description: Import queued (or an existing asset, if this URL was already imported)
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/ApiSuccess'
- type: object
properties:
data:
$ref: '#/components/schemas/Asset'
'400':
description: Not a direct media URL, or it could not be probed as video
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/QuotaExceeded'
'429':
description: More than 20 imports are already queued
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
/assets/import-youtube.php:
post:
operationId: importYouTubeVideo
tags:
- Content
summary: Import a YouTube video the owner proves they own
description: 'Imports a YouTube video, but **only one the owner can prove they uploaded** — and you
cannot perform that proof for them:
1. Get the owner''s tag from `GET /users/device.php`
(`MyTVChannelApp#`).
2. Ask them to paste that exact string into the video''s **description or tags on
YouTube**. Only the uploader can edit those; that is the proof.
3. Retry the import.
If the tag is missing you get `403` whose message **already contains the exact string
to paste — relay it verbatim**, do not paraphrase or reformat it.
Public, finished videos only: no live streams, no private or age-restricted videos, no
playlists or channel URLs. Capped at 10 imports per day. Same quota as upload.
Never try to import a video the owner did not upload. The check exists because a
channel built from other people''s videos is a copyright problem for the owner.'
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- channel_id
- url
properties:
channel_id:
type: integer
url:
type: string
format: uri
title:
type: string
tags:
type: array
items:
type: string
weight:
$ref: '#/components/schemas/Weight'
responses:
'200':
description: Import queued
content:
application/json:
schema:
$ref: '#/components/schemas/ApiSuccess'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
description: Ownership not proved, or quota exceeded. When ownership is the cause, the `error` string contains the exact tag for the owner to publish — pass it through unchanged.
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
/assets/my.php:
get:
operationId: listAssets
tags:
- Content
summary: List the videos on a channel
parameters:
- name: channel_id
in: query
required: true
schema:
type: integer
responses:
'200':
description: Assets
content:
application/json:
schema:
$ref: '#/components/schemas/ApiSuccess'
'401':
$ref: '#/components/responses/Unauthorized'
/assets/status.php:
get:
operationId: getTranscodeStatus
tags:
- Content
summary: Poll transcoding, and find out when the channel can launch
description: 'Each asset reports `uploadStatus` (`downloading → pending → transcoding → ready`) and
transcode progress. The `summary` object reports `meetsLaunchRequirements`, which is
what you actually want.
Poll every 30–60 seconds. Transcoding takes roughly real-time ÷ 4, depending on load
on the encoding farm. Give exactly one of `channel_id` or `asset_id`.'
parameters:
- name: channel_id
in: query
required: false
schema:
type: integer
- name: asset_id
in: query
required: false
schema:
type: integer
responses:
'200':
description: Transcode status and launch-requirement summary
content:
application/json:
schema:
$ref: '#/components/schemas/ApiSuccess'
'401':
$ref: '#/components/responses/Unauthorized'
/assets/update.php:
put:
operationId: setAssetWeight
tags:
- Content
summary: Set a video's weight, title or tags
description: '**The asset id goes in the BODY as `asset_id`** — `?id=N` is also accepted, but the
body form is canonical. This is the opposite of `PUT /channels/update.php`, where the
id goes in the query string.
`weight` (0–10, default 5) controls how often the video plays. `0` removes it from
scheduling entirely without deleting it.
**Set the weight as soon as the asset reports `ready`, not after all imports finish.**
The channel auto-launches the instant it crosses the launch threshold and builds its
schedule from the weights that exist at that moment. On a measured run, a channel went
live 16 seconds after the final transcode and weights set 20 seconds later had zero
effect — a weight-3 asset got identical airtime to a weight-9 one. If the channel is
already live, follow this with `POST /schedule/regenerate.php`.
For an ordered mini-series, tag assets `seqXX01`, `seqXX02`, … (XX = any two letters).
They always play in order, and only the `01` episode enters the random draw.'
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- asset_id
properties:
asset_id:
type: integer
weight:
$ref: '#/components/schemas/Weight'
title:
type: string
tags:
type: array
items:
type: string
responses:
'200':
description: Updated
content:
application/json:
schema:
$ref: '#/components/schemas/ApiSuccess'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
/assets/delete.php:
post:
operationId: deleteAsset
tags:
- Content
summary: Remove a video (soft delete)
description: 'Stops the asset being scheduled, cancels any running transcode, and auto-regenerates
the schedule. **Soft delete** — the file survives a grace period. Idempotent.
Deletes are reversible by design, so prefer cleaning up after yourself to leaving
debris. Never delete content you did not create in this session unless the owner asked.'
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- asset_id
properties:
asset_id:
type: integer
responses:
'200':
description: Deleted
content:
application/json:
schema:
$ref: '#/components/schemas/ApiSuccess'
'401':
$ref: '#/components/responses/Unauthorized'
/assets/retry.php:
post:
operationId: retryTranscode
tags:
- Content
summary: Re-queue a failed transcode
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- asset_id
properties:
asset_id:
type: integer
responses:
'200':
description: Re-queued
content:
application/json:
schema:
$ref: '#/components/schemas/ApiSuccess'
'401':
$ref: '#/components/responses/Unauthorized'
components:
schemas:
ApiError:
type: object
required:
- success
- error
properties:
success:
type: boolean
const: false
error:
type: string
description: Human-readable. For the YouTube ownership failure this string contains the exact tag the owner must publish — relay it verbatim.
code:
type: integer
Weight:
type: integer
minimum: 0
maximum: 10
default: 5
description: How often the video plays, relative to the others. `0` excludes it from scheduling without deleting it. Do not set everything to 10 — the *differences* between weights are what shape a channel.
Asset:
type: object
properties:
id:
type: integer
channelId:
type: integer
title:
type: string
uploadStatus:
type: string
enum:
- downloading
- pending
- transcoding
- ready
- error
durationSeconds:
type: number
weight:
$ref: '#/components/schemas/Weight'
tags:
type: array
items:
type: string
duplicate:
type: boolean
description: Present and true when this URL had already been imported to this channel, in which case the original asset is returned rather than a new import being started.
ApiSuccess:
type: object
required:
- success
properties:
success:
type: boolean
const: true
message:
type: string
data: {}
responses:
QuotaExceeded:
description: Weekly quota exceeded. The message reports the remaining allowance. Tell the owner a plan upgrade is needed rather than retrying into repeated 403s.
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
BadRequest:
description: Malformed request or a rejected value
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
Unauthorized:
description: Missing, malformed or revoked API key
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
securitySchemes:
bearerAuth:
type: http
scheme: bearer
description: 'An API key, `Authorization: Bearer mytv_sk_...`. Created by a signed-in human at
<https://my-tv-channel.com/agent-keys/> or in the app under Profile → Agent Access.
Requires an active subscription on any tier; the key inherits the owner''s tier limits.
Key management — creating and revoking — is deliberately impossible with an API key,
so an agent holding one cannot escalate to issuing more. **Never ask the owner for
their Apple password or app login.** The key is all you need.
'
externalDocs:
description: Agent guide, with a worked path from nothing to a broadcasting channel. Read this if the spec alone leaves you unsure what order to call things in.
url: https://my-tv-channel.com/api/mytvchannel/docs/AGENTS.md