Home / Docs

API reference

The MegaVal API is organised around REST. All requests use HTTPS and return JSON, except delivery endpoints, which stream the media itself. Base URL: https://content.megaval244.online

Authentication

Pass your key as a bearer token on every request: Authorization: Bearer $MEGAVAL_KEY. Keys are created and rotated from the dashboard. Sandbox endpoints (/v1/health, /v1/regions) do not require a key.

POST/v1/assets

Upload a source file as multipart form data. Returns an asset id and a processing status. Transcoding starts automatically. Maximum source size is 20 GB.

GET/video/download

Stream a delivered asset. Query parameters: id (required) and fmt (one of 360p, 720p, 1080p, 2160p). Responses are cached at the edge; the x-cache header reports HIT or MISS, and x-edge names the responding location.

Signed URLs

Generate a time-limited link with POST /v1/sign. You can scope a link by expiry, client IP or referrer so private media never leaks. Signatures use HMAC-SHA256 over the canonical path and expiry timestamp.

GET/v1/health

Lightweight liveness probe used by load balancers. Returns { "status": "ok" } and the responding region. No authentication required.

Errors

The API uses conventional HTTP status codes. 400 indicates a malformed request (usually a missing query parameter), 401 a bad or absent key, 404 an unknown asset and 429 a rate limit. Error bodies contain a code and a human-readable message.