Skip to Content
API ReferenceContentGETGet content media

Get content media

GET/api/v1/content/{content_id}/media

Generates a short-lived signed Cloud CDN URL for video or audio playback, or redirects directly to the stream.

Path parameters

content_idstringrequired

Content or exercise video identifier.

Query parameters

qualitystringoptional(1080p | 720p | 540p | 360p)default: "720p"

Requested video rendition. Ignored for audio assets.

redirectbooleanoptionaldefault: false

When true, responds with HTTP 302 Found and a Location header pointing to the signed Cloud CDN URL (Cache-Control: private, no-store).

How signed media streaming works

Media assets live on Cloud CDN (https://media.bellacoach.ai) and require a cryptographic signature in query parameters (Expires, KeyName, Signature). Unsigned requests return 403 Forbidden.

Why call this endpoint?

  • Quality switching: Exercise steps inside workout bundles fetched via GET /api/v1/content/workouts/{workout_id} already come pre-signed at 720p, so initial playback requires zero extra requests. Call this endpoint with ?quality=1080p, 540p, or 360p when a user or adaptive player changes resolution.
  • Refreshing expired URLs: Every signed URL has a 2-hour TTL (7200 seconds), reported in expires_at. If a user leaves a session paused past expires_at and the player receives 403 Forbidden, call this endpoint to mint a fresh signed URL and resume playback.
  • Standalone exercise playback: Resolve a signed stream URL directly from any exercise video ID.

Delivery patterns

  • JSON discovery (redirect=false, recommended): Your backend calls this endpoint with $BELLA_API_KEY and returns the signed url, available_qualities, and expires_at to your client app.
  • Direct redirect (redirect=true): Responds with HTTP 302 Found (Location: https://media.bellacoach.ai/... and Cache-Control: private, no-store). Useful if your own backend exposes a pass-through media proxy route (e.g. GET /api/media/{content_id}?quality=540p) that redirects <video>, AVPlayer, or ExoPlayer directly to Cloud CDN.

Cloud CDN playback behaviour

  • Cloud CDN supports HTTP byte-range requests (Range / 206 Partial Content) for instant seeking and scrubbing on web and mobile players.
  • Pass the signed url verbatim (keeping Expires, KeyName, and Signature intact) directly to <video>, AVPlayer, or ExoPlayer.
  • Do not forward your Authorization: Bearer $BELLA_API_KEY header to media.bellacoach.ai.

Mobile bandwidth adaptation: Default to 720p on Wi-Fi, drop to 540p or 360p on cellular or low-data mode, and reserve 1080p for large-screen playback.

Response attributes (MediaDetail)

content_idstringoptional

Exercise video or media identifier.

media_typestringoptional(video | audio)

Asset media type.

qualitystringoptional

Selected rendition quality (e.g. 720p).

available_qualitiesstring[]optional

Renditions available for this asset (e.g. ["1080p", "720p", "540p", "360p"]).

duration_secondsinteger | nulloptional

Asset duration in seconds.

urlstringoptional

Short-lived signed Cloud CDN stream URL (https://media.bellacoach.ai/...).

expires_atstringoptional

ISO 8601 UTC timestamp when the signed URL expires (2-hour TTL).

Returns

HTTP Status Codes

200 OKMediaDetailoptional

Signed Cloud CDN stream URL and rendition metadata (redirect=false).

302 FoundRedirectoptional

Redirects directly to the signed Cloud CDN URL (redirect=true).

401 UnauthorizedErroroptional

The integration key is missing, invalid, or revoked.

404 Not FoundErroroptional

Content ID not found, or "media_not_found" for text-only articles.

422 Unprocessable EntityErroroptional

Requested quality is not available for this asset.

curl -X GET "https://api.bellacoach.ai/api/v1/content/kno_d3f2ee150f75624548a42cea/media?quality=720p" \ -H "Authorization: Bearer $BELLA_API_KEY" \ -H "Accept: application/json"

Response (200 OK)

{ "content_id": "kno_d3f2ee150f75624548a42cea", "media_type": "video", "quality": "720p", "available_qualities": ["1080p", "720p", "540p", "360p"], "duration_seconds": 25, "url": "https://media.bellacoach.ai/content/kno_d3f2ee150f75624548a42cea/720p.mp4?Expires=1794781295&KeyName=bella-media-key-v1&Signature=...", "expires_at": "2026-11-15T22:21:35Z" }

Next steps

Last updated on