Update a video
curl --request PATCH \
--url https://test-api.segmnt.cloud/v1/projects/{projectId}/videos/{videoId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Lesson 1 - Introduction"
}
'import requests
url = "https://test-api.segmnt.cloud/v1/projects/{projectId}/videos/{videoId}"
payload = { "title": "Lesson 1 - Introduction" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({title: 'Lesson 1 - Introduction'})
};
fetch('https://test-api.segmnt.cloud/v1/projects/{projectId}/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://test-api.segmnt.cloud/v1/projects/{projectId}/videos/{videoId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Lesson 1 - Introduction'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://test-api.segmnt.cloud/v1/projects/{projectId}/videos/{videoId}"
payload := strings.NewReader("{\n \"title\": \"Lesson 1 - Introduction\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://test-api.segmnt.cloud/v1/projects/{projectId}/videos/{videoId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Lesson 1 - Introduction\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://test-api.segmnt.cloud/v1/projects/{projectId}/videos/{videoId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Lesson 1 - Introduction\"\n}"
response = http.request(request)
puts response.read_body{
"id": "vid_9xR4tL",
"projectId": "<string>",
"title": "Lesson 1 - Introduction",
"status": "uploading",
"durationSeconds": 123,
"qualities": [
"360p"
],
"sizeBytes": 123,
"failure": {
"code": "unsupported_codec",
"message": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"readyAt": "2023-11-07T05:31:56Z"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}Videos
Update a video
PATCH
/
v1
/
projects
/
{projectId}
/
videos
/
{videoId}
Update a video
curl --request PATCH \
--url https://test-api.segmnt.cloud/v1/projects/{projectId}/videos/{videoId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Lesson 1 - Introduction"
}
'import requests
url = "https://test-api.segmnt.cloud/v1/projects/{projectId}/videos/{videoId}"
payload = { "title": "Lesson 1 - Introduction" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({title: 'Lesson 1 - Introduction'})
};
fetch('https://test-api.segmnt.cloud/v1/projects/{projectId}/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://test-api.segmnt.cloud/v1/projects/{projectId}/videos/{videoId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Lesson 1 - Introduction'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://test-api.segmnt.cloud/v1/projects/{projectId}/videos/{videoId}"
payload := strings.NewReader("{\n \"title\": \"Lesson 1 - Introduction\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://test-api.segmnt.cloud/v1/projects/{projectId}/videos/{videoId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Lesson 1 - Introduction\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://test-api.segmnt.cloud/v1/projects/{projectId}/videos/{videoId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Lesson 1 - Introduction\"\n}"
response = http.request(request)
puts response.read_body{
"id": "vid_9xR4tL",
"projectId": "<string>",
"title": "Lesson 1 - Introduction",
"status": "uploading",
"durationSeconds": 123,
"qualities": [
"360p"
],
"sizeBytes": 123,
"failure": {
"code": "unsupported_codec",
"message": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"readyAt": "2023-11-07T05:31:56Z"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}Authorizations
apiKeysession
Project API key. Server-side only.
Path Parameters
Pattern:
^prj_[A-Za-z0-9]+$Pattern:
^vid_[A-Za-z0-9]+$Body
application/json
Required string length:
1 - 200Example:
"Lesson 1 - Introduction"
Response
Video updated.
Example:
"vid_9xR4tL"
Required string length:
1 - 200Example:
"Lesson 1 - Introduction"
uploading: waiting for the parts and the complete call.processing: encoding to HLS.ready: can play.failed: encoding failed; seefailure.held: held by our team; does not play.
Available options:
uploading, processing, ready, failed, held Known after encoding.
Qualities that can play. Empty until ready.
1440p and 2160p are only on the Pro and Agency plans, and never above the source.
Available options:
360p, 720p, 1080p, 1440p, 2160p Size of the original file.
Set only when status is failed.
Show child attributes
Show child attributes