Change a re-broadcast target
Code Mode: praxis.media.streams.outputs.update
HTTP: PATCH /media/v1/streams/{stream_id}/outputs/{output_id}
Change the address or the key of an output, for example after the target gave you a new key or an errored output was refused for a bad one; send at least one of url and stream_key. An output that is running starts over with the new values: its connection is closed and opened again, and its status goes through starting again. Use streams.outputs.delete to stop sending to a target for good. Example: {“stream_key”:“live_new456”}.
签名
praxis.media.streams.outputs.update(args:{path:{/** e.g. "mst_zpnqd7a2kxwg3vhr5tj4bfm6ec" */ stream_id:string;/** e.g. "mso_zpnqd7a2kxwg3vhr5tj4bfm6ec" */ output_id:string};body:{/** The new RTMP address with its application. e.g. "rtmp://live.example.com/app" */ url?:string;/** The new stream key; stored and never returned. e.g. "live_new456" */ stream_key?:string}}):Promise<{/** The output id (mso_ and 26 lowercase base32 characters); stable and never reused. e.g. "mso_zpnqd7a2kxwg3vhr5tj4bfm6ec" */ id:string;/** Always media.stream.output. e.g. "media.stream.output" */ object:"media.stream.output";/** The target's RTMP address with its application, rtmp:// or rtmps://; the stream key is not part of it. e.g. "rtmps://live.example.com:443/app" */ url:string;/** Always true: the key is write-only and never returned; send a new stream_key with streams.outputs.update to change it. e.g. true */ stream_key_set:true;/** idle means the stream is not live; starting means connecting, or waiting to try again (1 s, then longer up to 60 s); broadcasting means the target accepted the e.g. "broadcasting" */ status:"idle"|"starting"|"broadcasting"|"errored";/** Why the last connection failed, while the output is errored or starting again after a failure; null in every other status. */ error:(({/** OUTPUT_CONNECT_FAILED: the target could not be reached or refused the connection; OUTPUT_TARGET_UNREACHABLE_FROM_PLATFORM: the target is on the Cloudflare netwo e.g. "OUTPUT_PUBLISH_REJECTED" */ code:"OUTPUT_CONNECT_FAILED"|"OUTPUT_TARGET_UNREACHABLE_FROM_PLATFORM"|"OUTPUT_PUBLISH_REJECTED"|"OUTPUT_CONNECTION_LOST"|"OUTPUT_TARGET_FORBIDDEN"|"OUTPUT_UNSUPPORTED_MEDIA";/** A sentence saying what the target answered. e.g. "the target refused the stream: NetStream.Publish.BadName" */ message:string}))|null;/** When the output was created, RFC 3339 UTC. e.g. "2026-11-28T12:00:00.000Z" */ created_at:string;/** When the output last changed (a setting or its status), RFC 3339 UTC. e.g. "2026-11-28T12:05:00.000Z" */ updated_at:string}>;参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| stream_id | path | string | 是 | The stream’s id, the id field returned by streams.create or streams.list (mst_ followed by 26 lowercase base32 characters); a stream of another organization answers 404. |
| output_id | path | string | 是 | The output’s id, the id field returned by streams.outputs.create or streams.outputs.list (mso_ followed by 26 lowercase base32 characters); an output of another stream or organization answers 404. |
请求体
| 必填 | 内容类型 | 说明 |
|---|---|---|
| 是 | application/json |
响应
| 状态码 | 内容类型 | 说明 |
|---|---|---|
| 200 | application/json | The output after the change. |
| 400 | application/json | The patch is empty, carries an unknown field or an invalid value (the error names the field). Correct it and send again. |
| 404 | application/json | No such stream or output in your organization, or Media Streams is not released for it. |