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
The x-api-key is a custom header required for authenticating requests to our API. Include this header in your request with the appropriate API key value to securely access our endpoints. You can find your API key(s) in the 'API' section of our studio website.
Body
Configuration for a new stream flow - a standing SRT endpoint you can use as the source or a target of any stream.
Human-readable name for the flow. Must be unique within your team.
caller: Camb.ai connects out to your SRT endpoint (primary_url) and re-serves it. listener: Camb.ai hosts an SRT endpoint that your encoder pushes to.
caller, listener Enable a second (backup) leg. Caller flows then require backup_url; listener flows get a backup push URL.
SRT URL of your upstream (caller mode only; required there, forbidden for listeners). To dial an encrypted upstream, append its passphrase as a query parameter: srt://host:port?passphrase=....
SRT URL of the backup upstream. Caller mode with failover enabled only.
Optional SRT encryption passphrase for the flow's own endpoint (10-79 characters). When set, it is embedded in the returned play/push URLs and required to connect.
10 - 79Region 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.
Optional second SRT listener, pushed in parallel with egress_primary_url (which it requires). Same format and parameters.
Response
The created flow, including its play and push URLs.
Flow identifier.
caller: Camb.ai connects out to your SRT endpoint (primary_url) and re-serves it. listener: Camb.ai hosts an SRT endpoint that your encoder pushes to.
caller, listener Whether the flow's relay is currently online.
Region hosting the flow's SRT endpoint, as chosen at create. The flow's URLs carry this region's address.
Access key embedded in the flow's URLs.
SRT URL the flow serves. Use it as source_stream.url or as a target_streams[].url, or play it directly.
SRT URLs to push into (listener mode). Empty for caller flows.
The flow's SRT encryption passphrase, when one is set.
The primary egress destination as you set it, including any query parameters, or null.
The backup egress destination as you set it, or null.