---
title: "Create Flow"
method: POST
path: "/flows"
tags: ["Apis", "Streaming"]
---

# Create Flow

`POST /flows`

Create a stream flow: a standing SRT endpoint, independent of any stream, that you can use as the source or a target of streams. In `listener` mode Camb.ai hosts an endpoint your encoder pushes to; in `caller` mode Camb.ai pulls from your upstream and re-serves it.

## Request body

- FlowCreateIn — Configuration for a new stream flow - a standing SRT endpoint you can use as the source or a target of any stream.
  - `label` string, required — Human-readable name for the flow. Must be unique within your team.
  - `mode` 'caller' | 'listener', required — `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.
  - `failover` boolean — Enable a second (backup) leg. Caller flows then require `backup_url`; listener flows get a backup push URL.
  - `primary_url` string, nullable — 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=...`.
  - `backup_url` string, nullable — SRT URL of the backup upstream. Caller mode with `failover` enabled only.
  - `passphrase` string, nullable — 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.

## Response `201`

The created flow, including its play and push URLs.

- FlowOut
  - `id` integer — Flow identifier.
  - `label` string
  - `mode` 'caller' | 'listener' — `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.
  - `failover` boolean
  - `active` boolean — Whether the flow's relay is currently online.
  - `team_id` integer
  - `key` string — Access key embedded in the flow's URLs.
  - `play_url` string — SRT URL the flow serves. Use it as `source_stream.url` or as a `target_streams[].url`, or play it directly.
  - `push_urls` PushUrl[] — SRT URLs to push into (listener mode). Empty for caller flows.
    - `role` 'primary' | 'backup' — Which leg of the flow this URL feeds.
    - `url` string — SRT URL to push to.
  - `passphrase` string, nullable — The flow's SRT encryption passphrase, when one is set.

## Other responses

- `403` — Your subscription does not include streaming.
- `422` — Validation Error

---

[API](https://skmtc.net/camb/apis/fastapi.md) · [All operations](https://skmtc.net/camb/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/camb/fastapi/versions/40ebeee64850/schema)
