Live streaming API
A live streaming API with the stream key behind its own permission
Create a stream for every class, customer or event from your own code, issue its stream key under a separate permission, and hand viewers signed playback URLs. The same live system as the dashboard, driven by a versioned REST API.
# 1 · Create a stream (scope live_streams:write)
POST /v2/live-streams
Authorization: Bearer <api-key>
Idempotency-Key: 6f1c2a90-weekly-briefing
{ "title": "Thursday product briefing" }
# 2 · Issue the stream key (scope live_ingest:write)
POST /v2/live-streams/{liveStreamId}/ingest:rotate-key
→ { "protocol": "rtmp", "ingestUrl": "…", "streamKey": "…" }
# the key is returned once; later reads show only a hint
# 3 · Hand viewers a playback source (scope live_streams:read)
GET /v2/live-streams/{liveStreamId}/playback
→ { "hlsEmbedUrl": "…", "hlsDirectUrl": "…", "webrtc": null }The basics
What is a live streaming API?
A live streaming API lets your software create and manage live streams instead of a person clicking through a dashboard. Your platform creates a stream when an event is booked, gives the presenter an ingest address and stream key, and gives viewers a playback URL, all without anyone copying values between screens.
DynTube’s live streaming API is part of its v2 management API, described by a generated OpenAPI 3.1 document. Streams created through it run on DynTube’s new live system and play through the same player and embed as streams created in the dashboard.
The resources
What can you control through the live streaming API?
Each item is an operation the published contract defines, named as the contract names it.
- Live streams/v2/live-streams
- List, create, read and update streams, and archive one when it is finished. Lists are paginated and can be filtered by status, project or search text.
- Ingest, with its own permissioningest · ingest:rotate-key
- Read the ingest address and protocol (RTMP, RTMPS or SRT) at any time. The stream key itself is issued or rotated only by a separate call that needs the narrower live_ingest:write scope, and it is returned once.
- Playbackplayback · embed
- Fetch signed HLS URLs for embeds and for direct or third-party players, or the embed code for the DynTube player. Where WebRTC playback has been enabled for your account by arrangement and the stream has it switched on, the response also carries a short-lived WebRTC source.
- Schedules/v2/live-stream-schedules
- Create one-time or recurring schedules that play a list of your videos as a live stream, with repeat, shuffle and loop options and an explicit time zone.
- Private linksprivate-links
- Create, rotate and revoke private links that give a chosen audience access to a stream without listing it publicly.
- Recordingcreate options
- Opt in to recording into a project you choose where your plan includes it.
Built for production code
How does the API keep automation safe?
The parts of the contract that matter once real events depend on your integration.
Scoped API keys
Send an API key as a bearer token. Scopes are enforced per route, so a key that only reads playback cannot create streams or see stream keys.
Idempotent writes
Create and action calls accept an Idempotency-Key header, so a retried request after a timeout replays the first result instead of creating a second stream.
Secrets returned once
The stream key is returned in full only by the rotate call; reads return a short hint. Treat the rotate response as a secret and keep it out of your own logs.
Quotas checked up front
A create that would exceed your plan’s live stream or WebRTC limit is refused with a clear error instead of failing at broadcast time.
One contract, one document
The OpenAPI 3.1 document is generated from the same contract registry the API enforces, so your generated client matches what the server accepts.
API reference
HLS always, WebRTC by arrangement
Playback always includes HLS. WebRTC appears only where it has been enabled for your account by arrangement and switched on for the stream, so your player code can treat it as an upgrade.
WebRTC live streaming
A first integration
How do you automate your first live event?
Five steps from an API key to a stream your platform created by itself.
- 01
Create two API keys
- 02
Create the stream when the event is booked
- 03
Issue the stream key to the presenter
- 04
Give viewers the playback source
- 05
Archive it afterwards
Questions
Live streaming API questions
Direct answers, each within the published contract.
Which ingest protocols does the live streaming API support?
The ingest endpoint reports one of three protocols: RTMP, RTMPS or SRT. Your encoder publishes to the ingest URL with the stream key issued by the rotate-key call. Publishing from a browser over WebRTC is not offered; WebRTC is used for viewer playback only.
How does authentication work?
Each request sends an API key as a bearer token in the Authorization header. Scopes are enforced per route: live_streams:read and live_streams:write for streams and playback, and the narrower live_ingest:write for issuing or rotating stream keys.
Can I get WebRTC playback URLs from the API?
Yes, where WebRTC playback has been enabled for your account by arrangement and the stream was created with it switched on. The playback response then includes a WebRTC source with a short-lived token. Otherwise that field is empty and you play the HLS URLs, which are always present.
Is there an older version of the API?
Yes. The v1 live streaming guides remain the written procedures for existing integrations and carry their own compatibility notice. New integrations should start from the v2 OpenAPI document.
Are there limits on how many streams I can create?
Yes. Live streams, WebRTC streams and schedules are plan limits, checked when you create them. Confirm the limits of your plan before building an integration that creates streams in bulk.
Let your platform create the stream
Start a trial, create an API key, and have your code create, broadcast to and archive one test stream.