Authenticate using HTTP Basic Auth with your Mux token ID as the username and token secret as the password.
Create a direct upload by sending a POST request to the direct uploads endpoint, specifying a new_asset_settings object with playback_policy (e.g., public) in the JSON body.
From the response, capture the url field (the pre-signed upload URL) and the upload id.
PUT the video file bytes directly to the pre-signed URL — no Mux authentication headers are needed for this step.
Poll the upload status via the direct uploads endpoint using the upload id, or listen for the video.asset.ready webhook event.
Once the asset is ready, retrieve the asset's playback_ids array; use a playback ID with the Mux stream base URL to construct the HLS manifest URL for playback.
Known gotchas
The pre-signed upload URL is time-limited and single-use; initiate the upload promptly after receiving it.
Assets are not immediately playable after upload; they must complete the encoding process before the status becomes ready.
Mux credentials (token ID and secret) must never appear in client-side code; create direct upload URLs server-side and pass only the pre-signed URL to clients.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp