Create an SRT Flow
Create a stream flow: a standing SRT endpoint you can use as the source or a target of your streams.
Overview
A flow is a standing SRT endpoint hosted by Camb.ai, independent of any stream. Create one once, and use its URLs as the source or a target of any number of streams, with no need to expose your own SRT infrastructure. Flows come in two modes:Listener
push_urls (primary/backup) and a play_url anyone with the key can
pull from.Caller
primary_url) and re-serves it
on a stable play_url, with optional failover to a backup_url.Using a flow with streams
The returnedplay_url is a normal SRT URL:
- As a stream source - set it as
source_stream.urlwhen creating a stream. Your encoder pushes to the flow’spush_urls; the stream ingests from the flow. - As a stream target - set it as a
target_streams[].urlwith"type": 1to deliver your processed output to the flow, then distribute the flow’splay_urlto viewers or downstream systems.
Egress: push the flow to your own SRT listeners
In either mode a flow can also push its feed to SRT listeners you run, for example a CDN or playout ingest. Setegress_primary_url, and optionally
egress_backup_url, to srt://host:port URLs. Camb.ai dials each one as an
SRT caller, sends it the full feed, and reconnects if it drops. The two
destinations run in parallel. The flow keeps its play_url.
Your listener’s SRT settings go in the URL as query parameters, for example
srt://cdn.example.com:6000?passphrase=...&streamid=...&latency=200.
passphrase (10–79 bytes), streamid, latency (milliseconds; 200 when
omitted) and the other standard SRT caller options are supported, each at most
once. The flow’s own passphrase does not apply to these URLs.
Regions
A flow’s SRT endpoint is hosted in one region. Pick one from List Flow Regions and pass it asregion; without it the
flow is hosted in us-central1. Choose the region closest to your encoder or
viewers.
The region is fixed for the life of the flow: its play_url and push_urls
carry that region’s address, which you configure in encoders and firewall
allowlists. To move a flow, create a new one in the other region and repoint
your encoders and streams at its URLs.
Example: listener flow for a stadium encoder
Validation rules
labelmust be unique within your team.callermode requiresprimary_url;listenermode must not set URLs.backup_urlrequiresfailover: true(and is required for caller flows with failover).egress_primary_urlandegress_backup_urlmust besrt://host:portURLs with no path, no credentials before the host, and only supported SRT query parameters.egress_backup_urlrequiresegress_primary_url.- Egress is not yet available in every region. If the flow’s region does not
support it, the request returns
422. regionmust be one of List Flow Regions; any other value is rejected with422, naming the regions that are available.
Errors
403- Your subscription does not include streaming.422- Validation error (see the rules above).
Related endpoints
Authorizations
Body
Configuration for a new stream flow - a standing SRT endpoint you can use as the source or a target of any stream.
Region to host the flow's SRT endpoint in, one of GET /flows/regions. Defaults to us-central1. Fixed for the life of the flow, because its URLs carry that region's address: to move a flow, create a new one.
Optional SRT listener of yours that Camb.ai pushes the flow to, in either mode, alongside the flow's play_url: srt://host:port. Camb.ai dials it as an SRT caller and reconnects if it drops. Your listener's own SRT settings go in the URL as query parameters, e.g. srt://cdn.example.com:6000?passphrase=...&streamid=...&latency=200. Supported: passphrase (10-79 bytes), streamid (up to 512 bytes), latency/rcvlatency/peerlatency (integer milliseconds; 200 when omitted) and the other standard SRT caller options (congestion, enforcedencryption, fc, inputbw, iptos, ipttl, kmpreannounce, kmrefreshrate, linger, lossmaxttl, maxbw, messageapi, minversion, mss, nakreport, oheadbw, packetfilter, payloadsize, pbkeylen, peeridletimeo, rcvbuf, sndbuf, snddropdelay, tlpktdrop, tsbpdmode), each at most once. Any other parameter, a path, or credentials in the host part are rejected with 422. The flow's own passphrase does not apply here.
Response
The created flow, including its play and push URLs.