Live streaming
Update a Live Stream
Update a Live Stream
PUT https://api.dyntube.com/v1/live-streams/{id}
Send the request body as application/json. The example below shows the expected payload.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization | String | Bearer YOUR_API_KEY |
| Content-Type | String | application/json |
Sample Request Body
Here is a sample JSON request to update a live stream.
json
{
"id": "6dWVR5343889MV3lQ",
"name": "My Stream Update",
"description": "",
"auth": false,
"encrypt": false,
"record": false,
"storageProjectId": "",
"platforms": [
{
"service": 4,
"address": "rtmp://syd03.contribute.live-video.net/app",
"streamKey": "1211212"
}
]
}Code Samples
C#
csharp
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
var streamId = "6dWVR5343889MV3lQ";
var payload = new
{
name = "My Stream Update",
description = "",
auth = false,
encrypt = false,
record = false,
storageProjectId = "",
platforms = new[] {
new { service = 4, address = "rtmp://syd03.contribute.live-video.net/app", streamKey = "1211212" }
}
};
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_API_KEY");
var res = await client.PutAsync(
$"https://api.dyntube.com/v1/live-streams/{streamId}",
new StringContent(JsonSerializer.Serialize(payload), Encoding.UTF8, "application/json"));
System.Console.WriteLine(res.StatusCode);Node.js
javascript
const axios = require('axios');
async function updateStream(id) {
const payload = {
name: 'My Stream Update',
description: '',
auth: false,
encrypt: false,
record: false,
storageProjectId: '',
platforms: [
{
service: 4,
address: 'rtmp://syd03.contribute.live-video.net/app',
streamKey: '1211212'
}
]
};
const res = await axios.put(`https://api.dyntube.com/v1/live-streams/${id}`, payload, {
headers: { Authorization: 'Bearer YOUR_API_KEY' }
});
console.log(res.status, res.data);
}
updateStream('6dWVR5343889MV3lQ').catch(err => console.error(err.response?.data || err.message));Python
python
import requests
stream_id = "6dWVR5343889MV3lQ"
payload = {
"name": "My Stream Update",
"description": "",
"auth": False,
"encrypt": False,
"record": False,
"storageProjectId": "",
"platforms": [
{
"service": 4,
"address": "rtmp://syd03.contribute.live-video.net/app",
"streamKey": "1211212"
}
]
}
res = requests.put(
f"https://api.dyntube.com/v1/live-streams/{stream_id}",
json=payload,
headers={"Authorization": "Bearer YOUR_API_KEY"}
)
print(res.status_code, res.text)PHP
php
<?php
$streamId = "6dWVR5343889MV3lQ";
$payload = [
"name" => "My Stream Update",
"description" => "",
"auth" => false,
"encrypt" => false,
"record" => false,
"storageProjectId" => "",
"platforms" => [[
"service" => 4,
"address" => "rtmp://syd03.contribute.live-video.net/app",
"streamKey" => "1211212"
]]
];
$ch = curl_init("https://api.dyntube.com/v1/live-streams/{$streamId}");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_API_KEY",
"Content-Type: application/json"
]
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo "Status: {$status}\n";
echo $response;Related Pages
- Get a live stream to fetch the current stream settings before updating.
- Get live streaming recording when recording is enabled.
- Service and regions for live streams for valid service and region values.
Something missing or wrong here? Tell us and we will correct it. New to DynTube? Start with uploading and embedding.