Videos
Delete Video
Delete a video from your account.
DELETE https://api.dyntube.com/v1/videos/{id}
Headers
| Name | Type | Description |
|---|---|---|
| Authorization | String | Bearer YOUR_API_KEY |
Responses
- 200 OK – deletion scheduled
- 404 Not Found – invalid video id or already deleted
200: OK
C# Sample
csharp
using System;
using System.Net.Http;
using System.Net.Http.Headers;
namespace DeleteVideoExample
{
class Program
{
static async System.Threading.Tasks.Task Main(string[] args)
{
string videoId = "your_video_id";
string bearerToken = "your_bearer_token";
string url = $"https://api.dyntube.com/v1/videos/{videoId}";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", bearerToken);
var response = await client.DeleteAsync(url);
if (response.IsSuccessStatusCode)
{
Console.WriteLine("Video deleted successfully.");
}
else
{
Console.WriteLine($"Error deleting video. Status code: {response.StatusCode}");
}
}
}
}
}Node.js Sample
javascript
const axios = require('axios');
const videoId = 'your_video_id';
const bearerToken = 'your_bearer_token';
const url = `https://api.dyntube.com/v1/videos/${videoId}`;
const config = {
headers: {
Authorization: `Bearer ${bearerToken}`
}
};
axios.delete(url, config)
.then(response => {
console.log('Video deleted successfully.');
})
.catch(error => {
console.log(`Error deleting video. ${error}`);
});Python Sample
python
import requests
video_id = 'your_video_id'
bearer_token = 'your_bearer_token'
url = f'https://api.dyntube.com/v1/videos/{video_id}'
headers = {
'Authorization': f'Bearer {bearer_token}'
}
response = requests.delete(url, headers=headers)
if response.status_code == 200:
print('Video deleted successfully.')
else:
print(f'Error deleting video. Status code: {response.status_code}')PHP Sample
php
<?php
$video_id = 'your_video_id';
$bearer_token = 'your_bearer_token';
$url = "https://api.dyntube.com/v1/videos/{$video_id}";
$headers = array(
'Authorization: Bearer ' . $bearer_token
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
if ($response === false) {
echo "Error deleting video: " . curl_error($ch);
} else {
$httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($httpStatus == 200 || $httpStatus == 204) {
echo "Video deleted successfully.";
} else {
echo "Error deleting video. Status code: " . $httpStatus;
}
}
curl_close($ch);Related Pages
- Get video to verify the video ID before deleting.
- Get videos to list videos and confirm deletion.
- Delete a project when the project record itself should be retired.
Something missing or wrong here? Tell us and we will correct it. New to DynTube? Start with uploading and embedding.