Video API — REST Endpoints for Programmatic Video Management

Video API

AVCaption ships a REST API for programmatic video management. Available on Enterprise tier; preview access for Premium on request.

Authentication

Two methods:

Bearer token (JWT) — issued on login, sent as Authorization: Bearer <token> header. Used by your authenticated dashboard sessions.

API key — generated in your settings page. Format avc_<64-hex-chars>. Send as X-API-Key: <key> header or ?api_key=<key> query param. Useful for server-to-server.

Endpoints

GET    /api/v1/videos               List videos (paginated, ?page=1)
GET    /api/v1/videos/:id           Video metadata + embed token
POST   /api/v1/upload               Direct upload (small files)
POST   /api/v1/upload/init          Begin chunked upload session
POST   /api/v1/upload/chunk         Upload one chunk
POST   /api/v1/upload/complete      Finalize chunked upload
PUT    /api/v1/videos/:id           Update title, allowed_domains
DELETE /api/v1/videos/:id           Delete video
GET    /api/v1/stats                Account stats: total videos, views, storage used
GET    /api/v1/embed/:token         Public embed metadata (no auth needed for public videos)
POST   /api/v1/videos/:id/subtitles Upload subtitle track (Enterprise)
GET    /api/v1/presets              List player presets (Enterprise)
POST   /api/v1/presets              Create player preset (Enterprise)

Chunked upload pattern

# Step 1: init
curl -X POST https://dashboard.avcaption.com/api/v1/upload/init \
  -H "X-API-Key: avc_..." \
  -d '{"filename":"course-lesson-1.mp4","size":1234567890,"title":"Lesson 1"}'
# Returns: {"upload_id":"abc123","chunk_size":5242880}

# Step 2: upload chunks (parallel possible)
curl -X POST https://dashboard.avcaption.com/api/v1/upload/chunk \
  -H "X-API-Key: avc_..." \
  -H "X-Upload-ID: abc123" \
  -H "X-Chunk-Index: 0" \
  --data-binary @chunk-0.bin
# ...repeat for each chunk

# Step 3: complete
curl -X POST https://dashboard.avcaption.com/api/v1/upload/complete \
  -H "X-API-Key: avc_..." \
  -d '{"upload_id":"abc123"}'
# Returns: {"video_id":"...","embed_token":"...","status":"processing"}

Webhook events (Enterprise)

Subscribe to events at any HTTPS endpoint:

  • video.uploaded — chunked upload complete
  • video.encoded — encoding finished, ready to play
  • video.failed — encoding failed (with error details)
  • view.threshold — viewer count crossed configured threshold
  • subtitle.translated — AI translation complete

Webhook payload signed with HMAC-SHA256.

Rate limits

  • Read endpoints (list, get): 300 req/min per API key
  • Write endpoints (update, delete): 60 req/min
  • Upload endpoints: 60 req/min on init/complete; chunks themselves are not rate limited
  • Stats: 60 req/min

Limits scale automatically for Enterprise customers; contact sales for custom rates.

Error format

{
  "error": "human readable error message",
  "code": "machine_readable_error_code",
  "request_id": "x-request-id-for-support-tickets"
}

Get started

REST API is included in Enterprise. Generate your API key in dashboard Settings → API Keys. Open an Enterprise account and run a single chunked-upload call against a real source file before you script the bulk migration. Common API-driven deployments: LMS video hosting, agency client video, digital products.

Frequently asked questions

What can I build with the AVCaption Video API? +
Anything that needs programmatic video management: ingest pipelines from your own backend, automated migrations from another platform, per-user upload quotas, custom dashboards, server-side embed token rotation, webhook-driven post-processing. The REST API mirrors the dashboard, plus chunked upload and signed webhook events.
Is the API rate limited? +
Yes. Default limits are generous for production use (60 req/min on most endpoints, higher on read endpoints). Hard limits enforce abuse protection. Enterprise customers can request lifted limits.
Does the API support resumable uploads? +
Yes. Upload init returns an upload session ID; chunks are POSTed individually with retry-on-failure. Sessions persist 24 hours, so a network drop doesn't lose progress.
Does the API issue per-session embed tokens? +
Yes. POST /api/v1/embed-token with a video_id, viewer_id, and expires_in returns a fresh token. Use this on each authenticated session in your own application so leaked iframe URLs expire within the chosen window. Required pattern for paid courses, gated tutorials, and any membership content.
← content.back_to_index