Reset stream key
curl --request POST \
--url https://api.tenbyte.io/v1/livestream/streams/{streamId}/reset-key \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tenbyte.io/v1/livestream/streams/{streamId}/reset-key"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tenbyte.io/v1/livestream/streams/{streamId}/reset-key', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tenbyte.io/v1/livestream/streams/{streamId}/reset-key"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.tenbyte.io/v1/livestream/streams/{streamId}/reset-key")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.post("https://api.tenbyte.io/v1/livestream/streams/{streamId}/reset-key")
.header("Authorization", "Bearer <token>")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.tenbyte.io/v1/livestream/streams/{streamId}/reset-key");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tenbyte.io/v1/livestream/streams/{streamId}/reset-key",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"success": true,
"message": "<string>",
"data": {
"id": "<string>",
"organization_id": "<string>",
"name": "<string>",
"region": "<string>",
"stream_key": "<string>",
"ingest": {
"protocols": [],
"rtmp": "<string>",
"srt": "<string>",
"primary": {
"url": "<string>"
},
"backup": {
"url": "<string>"
}
},
"output_protocols": [],
"packaging": {
"hls": {
"playlist_size": 123,
"preserved_segments": 123,
"low_latency": true
},
"dash": {
"segment_format": "fmp4",
"window_s": 123,
"min_buffer_s": 123
}
},
"ladder": {
"video": [
{
"name": "<string>",
"width": 123,
"height": 123,
"fps": 123,
"gop": 123,
"bitrate_kbps": 123,
"max_bitrate_kbps": 123,
"buf_size_kbps": 123,
"crf": 123,
"preset": "<string>",
"profile": "<string>",
"level": "<string>",
"bframes": 123,
"ref_frames": 123,
"rc_lookahead": 123,
"audio": {
"codec": "aac",
"channels": 123,
"sample_rate_hz": 123,
"audio_bitrate_kbps": 123
}
}
],
"audio": [
{
"name": "<string>",
"codec": "aac",
"channels": 123,
"sample_rate_hz": 123,
"bitrate_kbps": 123
}
]
},
"playback": {
"hls": "<string>",
"dash": "<string>"
},
"recording": {
"enabled": true,
"library_id": "<string>",
"folder_id": "<string>",
"prefix": "<string>",
"s3_config": {}
},
"webhook_url": "<string>",
"meta": {},
"last_live_at": "2023-11-07T05:31:56Z",
"last_ended_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"code": "UNAUTHORIZED",
"message": "Missing authorization. Provide Authorization header or X-API-Key header."
}{
"success": false,
"code": "NOT_FOUND",
"message": "Resource not found."
}{
"success": false,
"code": "INTERNAL_ERROR",
"message": "cannot delete stream while live"
}Streams
Reset stream key
Old key invalid immediately. Disconnects active stream if live.
POST
/
streams
/
{streamId}
/
reset-key
Reset stream key
curl --request POST \
--url https://api.tenbyte.io/v1/livestream/streams/{streamId}/reset-key \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tenbyte.io/v1/livestream/streams/{streamId}/reset-key"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tenbyte.io/v1/livestream/streams/{streamId}/reset-key', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tenbyte.io/v1/livestream/streams/{streamId}/reset-key"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.tenbyte.io/v1/livestream/streams/{streamId}/reset-key")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.post("https://api.tenbyte.io/v1/livestream/streams/{streamId}/reset-key")
.header("Authorization", "Bearer <token>")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.tenbyte.io/v1/livestream/streams/{streamId}/reset-key");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tenbyte.io/v1/livestream/streams/{streamId}/reset-key",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"success": true,
"message": "<string>",
"data": {
"id": "<string>",
"organization_id": "<string>",
"name": "<string>",
"region": "<string>",
"stream_key": "<string>",
"ingest": {
"protocols": [],
"rtmp": "<string>",
"srt": "<string>",
"primary": {
"url": "<string>"
},
"backup": {
"url": "<string>"
}
},
"output_protocols": [],
"packaging": {
"hls": {
"playlist_size": 123,
"preserved_segments": 123,
"low_latency": true
},
"dash": {
"segment_format": "fmp4",
"window_s": 123,
"min_buffer_s": 123
}
},
"ladder": {
"video": [
{
"name": "<string>",
"width": 123,
"height": 123,
"fps": 123,
"gop": 123,
"bitrate_kbps": 123,
"max_bitrate_kbps": 123,
"buf_size_kbps": 123,
"crf": 123,
"preset": "<string>",
"profile": "<string>",
"level": "<string>",
"bframes": 123,
"ref_frames": 123,
"rc_lookahead": 123,
"audio": {
"codec": "aac",
"channels": 123,
"sample_rate_hz": 123,
"audio_bitrate_kbps": 123
}
}
],
"audio": [
{
"name": "<string>",
"codec": "aac",
"channels": 123,
"sample_rate_hz": 123,
"bitrate_kbps": 123
}
]
},
"playback": {
"hls": "<string>",
"dash": "<string>"
},
"recording": {
"enabled": true,
"library_id": "<string>",
"folder_id": "<string>",
"prefix": "<string>",
"s3_config": {}
},
"webhook_url": "<string>",
"meta": {},
"last_live_at": "2023-11-07T05:31:56Z",
"last_ended_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"code": "UNAUTHORIZED",
"message": "Missing authorization. Provide Authorization header or X-API-Key header."
}{
"success": false,
"code": "NOT_FOUND",
"message": "Resource not found."
}{
"success": false,
"code": "INTERNAL_ERROR",
"message": "cannot delete stream while live"
}⌘I