curl --request POST \
--url https://video.bunnycdn.com/library/{libraryId}/videos/{videoId} \
--header 'AccessKey: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"collectionId": "<string>",
"chapters": [
{
"title": "<string>",
"start": 123,
"end": 123
}
],
"moments": [
{
"label": "<string>",
"timestamp": 123
}
],
"metaTags": [
{
"property": "<string>",
"value": "<string>"
}
]
}
'import requests
url = "https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}"
payload = {
"title": "<string>",
"collectionId": "<string>",
"chapters": [
{
"title": "<string>",
"start": 123,
"end": 123
}
],
"moments": [
{
"label": "<string>",
"timestamp": 123
}
],
"metaTags": [
{
"property": "<string>",
"value": "<string>"
}
]
}
headers = {
"AccessKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {AccessKey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
collectionId: '<string>',
chapters: [{title: '<string>', start: 123, end: 123}],
moments: [{label: '<string>', timestamp: 123}],
metaTags: [{property: '<string>', value: '<string>'}]
})
};
fetch('https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'collectionId' => '<string>',
'chapters' => [
[
'title' => '<string>',
'start' => 123,
'end' => 123
]
],
'moments' => [
[
'label' => '<string>',
'timestamp' => 123
]
],
'metaTags' => [
[
'property' => '<string>',
'value' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"AccessKey: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"collectionId\": \"<string>\",\n \"chapters\": [\n {\n \"title\": \"<string>\",\n \"start\": 123,\n \"end\": 123\n }\n ],\n \"moments\": [\n {\n \"label\": \"<string>\",\n \"timestamp\": 123\n }\n ],\n \"metaTags\": [\n {\n \"property\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("AccessKey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}")
.header("AccessKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"collectionId\": \"<string>\",\n \"chapters\": [\n {\n \"title\": \"<string>\",\n \"start\": 123,\n \"end\": 123\n }\n ],\n \"moments\": [\n {\n \"label\": \"<string>\",\n \"timestamp\": 123\n }\n ],\n \"metaTags\": [\n {\n \"property\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["AccessKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"collectionId\": \"<string>\",\n \"chapters\": [\n {\n \"title\": \"<string>\",\n \"start\": 123,\n \"end\": 123\n }\n ],\n \"moments\": [\n {\n \"label\": \"<string>\",\n \"timestamp\": 123\n }\n ],\n \"metaTags\": [\n {\n \"property\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"statusCode": 123
}{
"success": true,
"message": "<string>",
"statusCode": 123
}{
"success": true,
"message": "<string>",
"statusCode": 123
}{
"success": true,
"message": "<string>",
"statusCode": 123
}{
"success": true,
"message": "<string>",
"statusCode": 123
}Update Video
curl --request POST \
--url https://video.bunnycdn.com/library/{libraryId}/videos/{videoId} \
--header 'AccessKey: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"collectionId": "<string>",
"chapters": [
{
"title": "<string>",
"start": 123,
"end": 123
}
],
"moments": [
{
"label": "<string>",
"timestamp": 123
}
],
"metaTags": [
{
"property": "<string>",
"value": "<string>"
}
]
}
'import requests
url = "https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}"
payload = {
"title": "<string>",
"collectionId": "<string>",
"chapters": [
{
"title": "<string>",
"start": 123,
"end": 123
}
],
"moments": [
{
"label": "<string>",
"timestamp": 123
}
],
"metaTags": [
{
"property": "<string>",
"value": "<string>"
}
]
}
headers = {
"AccessKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {AccessKey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
collectionId: '<string>',
chapters: [{title: '<string>', start: 123, end: 123}],
moments: [{label: '<string>', timestamp: 123}],
metaTags: [{property: '<string>', value: '<string>'}]
})
};
fetch('https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'collectionId' => '<string>',
'chapters' => [
[
'title' => '<string>',
'start' => 123,
'end' => 123
]
],
'moments' => [
[
'label' => '<string>',
'timestamp' => 123
]
],
'metaTags' => [
[
'property' => '<string>',
'value' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"AccessKey: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"collectionId\": \"<string>\",\n \"chapters\": [\n {\n \"title\": \"<string>\",\n \"start\": 123,\n \"end\": 123\n }\n ],\n \"moments\": [\n {\n \"label\": \"<string>\",\n \"timestamp\": 123\n }\n ],\n \"metaTags\": [\n {\n \"property\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("AccessKey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}")
.header("AccessKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"collectionId\": \"<string>\",\n \"chapters\": [\n {\n \"title\": \"<string>\",\n \"start\": 123,\n \"end\": 123\n }\n ],\n \"moments\": [\n {\n \"label\": \"<string>\",\n \"timestamp\": 123\n }\n ],\n \"metaTags\": [\n {\n \"property\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["AccessKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"collectionId\": \"<string>\",\n \"chapters\": [\n {\n \"title\": \"<string>\",\n \"start\": 123,\n \"end\": 123\n }\n ],\n \"moments\": [\n {\n \"label\": \"<string>\",\n \"timestamp\": 123\n }\n ],\n \"metaTags\": [\n {\n \"property\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"statusCode": 123
}{
"success": true,
"message": "<string>",
"statusCode": 123
}{
"success": true,
"message": "<string>",
"statusCode": 123
}{
"success": true,
"message": "<string>",
"statusCode": 123
}{
"success": true,
"message": "<string>",
"statusCode": 123
}Authorizations
AccessKey based authentication
Path Parameters
The ID of the video library.
The GUID of the video.
Body
The title of the video
The ID of the collection where the video belongs. Omit/null to leave the current collection unchanged; send an empty string to remove the video from its collection.
The list of chapters available for the video, up to 200. Omit/null to leave existing chapters unchanged; providing a list, including an empty one, fully replaces all existing chapters.
Show child attributes
Show child attributes
The list of moments available for the video, up to 200. Omit/null to leave existing moments unchanged; providing a list, including an empty one, fully replaces all existing moments.
Show child attributes
Show child attributes
The meta tags added to the video, up to 50. Omit/null to leave existing tags unchanged; providing a list, including an empty one, fully replaces all existing tags. Setting a tag with Property "description" also updates the video's Description field.
Show child attributes
Show child attributes
Response
The video was successfully updated
Was this page helpful?