API Documentation

Build powerful video workflows with the ContentHosting API.

Quick Start

  1. Sign up at contenthosting.org/signup
  2. Create a subdomain and generate an API key in your Dashboard
  3. Use your API key to upload videos, generate embeds, and manage content

Authentication

All API requests require a Bearer token. Include your API key in the Authorization header:

curl -H "Authorization: Bearer ch_your_api_key_here" \
     https://contenthosting.org/api/v2/videos

API keys are scoped to a specific subdomain. Generate, rotate, or revoke keys in your Dashboard → Subdomains.

Base URL

https://contenthosting.org/api/v2

Videos

GET /videos — List Videos

curl -H "Authorization: Bearer ch_..." \
     "https://contenthosting.org/api/v2/videos?limit=20&offset=0"

GET /videos/:id — Get Video

curl -H "Authorization: Bearer ch_..." \
     https://contenthosting.org/api/v2/videos/abc123

POST /videos/presign — Get Upload URL

curl -X POST -H "Authorization: Bearer ch_..." \
     -H "Content-Type: application/json" \
     -d '{"filename":"video.mp4","mimeType":"video/mp4","fileSize":104857600}' \
     https://contenthosting.org/api/v2/videos/presign

POST /videos/complete — Confirm Upload

curl -X POST -H "Authorization: Bearer ch_..." \
     -H "Content-Type: application/json" \
     -d '{"videoId":"abc123"}' \
     https://contenthosting.org/api/v2/videos/complete

DELETE /videos/:id — Delete Video

curl -X DELETE -H "Authorization: Bearer ch_..." \
     https://contenthosting.org/api/v2/videos/abc123

Embed Player

Embed videos using an iframe with any of our supported player types:

PlayerURL Format
ch/player/ch?video={videoId}
plyr/player/plyr?video={videoId}
jwplayer/player/jwplayer?video={videoId}
videojs/player/videojs?video={videoId}
fluidplayer/player/fluidplayer?video={videoId}
hls/player/hls?video={videoId}
dash/player/dash?video={videoId}
custom/player/custom?video={videoId}

Embed Code Example

<iframe
  src="https://contenthosting.org/player/ch?video=abc123"
  width="100%"
  height="360"
  style="border:0"
  allow="autoplay; fullscreen"
></iframe>

Rate Limits

API keys are limited to 120 requests per minute. Exceeding this returns HTTP 429. Sign-in is limited to 10 attempts per 5 minutes per email.

More Resources