Restreams

Create and start a restream

POST
https://api.tunio.ai/v1/stream/{stream_id}/restreams

Restreams the station to an external platform and starts it right away: the station's audio over a looped video background. Needs the platform's server URL and stream key (YouTube Studio, Twitch Creator Dashboard, Kick dashboard, Facebook Live Producer, VK Video Live, Rutube Studio, Telegram "stream with other apps"). The response's id is the restream ID the other restream operations take. Check its state with GET /v1/stream/{stream_id}/restreams a minute later: a wrong key shows as error_code target_rejected.

路径参数

名称类型说明
stream_idRequiredstringStream UUID

请求体

Restream settings; stream_key is required

名称类型说明
background_idstring
UUID of a looped video background from GET /v1/restream-backgrounds; omit for none. A UUID that does not exist or is not available to the account gives 400 error_background_not_found. Returned as video_source. On update, omitting it keeps the saved background; a background cannot be removed.
platformRequiredstring
Target platform; custom is any RTMP/RTMPS server. Required, also on update.
resolutionstring
Background resolution: 720, 1080, 2k or 4k, one the background offers (default 1080). A value above the plan's max_resolution is sent at max_resolution. On update, omitting it keeps the saved one.
server_urlRequiredstring
The platform's RTMP/RTMPS ingest URL. Required, also on update. Returned as url.
stream_keystring
The platform's stream key. Required to create; omit on update to keep the saved one.
请求示例
01{
02 "background_id": "string",
03 "platform": "youtube",
04 "resolution": "1080",
05 "server_url": "rtmp://a.rtmp.youtube.com/live2",
06 "stream_key": "string"
07}

响应

名称类型说明
idinteger
ID of the new restream (id in the list): pass it as restream_id to change, start, stop or delete it.
stream_idstring
Internal ID of the restream run (stream_uuid in the list); not the restream ID.
successboolean
Always true.
名称类型说明
messagestring
Error code or human-readable error details.
successboolean
Always false for error payloads.
名称类型说明
messagestring
Error code or human-readable error details.
successboolean
Always false for error payloads.
名称类型说明
messagestring
Error code or human-readable error details.
successboolean
Always false for error payloads.
名称类型说明
messagestring
Error code or human-readable error details.
successboolean
Always false for error payloads.
名称类型说明
messagestring
Error code or human-readable error details.
successboolean
Always false for error payloads.
名称类型说明
messagestring
Error code or human-readable error details.
successboolean
Always false for error payloads.