Regenerate Dubbing passages and save the revision to My work
curl --request POST \
--url https://api.pyai.com/projects/{projectId}/dub/library/{id}/revisions \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--cookie pyai_session= \
--data '
{
"revision": 2,
"segment_ids": [
"<string>"
]
}
'import requests
url = "https://api.pyai.com/projects/{projectId}/dub/library/{id}/revisions"
payload = {
"revision": 2,
"segment_ids": ["<string>"]
}
headers = {
"cookie": "pyai_session=",
"Idempotency-Key": "<idempotency-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
cookie: 'pyai_session=',
'Idempotency-Key': '<idempotency-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({revision: 2, segment_ids: ['<string>']})
};
fetch('https://api.pyai.com/projects/{projectId}/dub/library/{id}/revisions', 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://api.pyai.com/projects/{projectId}/dub/library/{id}/revisions",
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([
'revision' => 2,
'segment_ids' => [
'<string>'
]
]),
CURLOPT_COOKIE => "pyai_session=",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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://api.pyai.com/projects/{projectId}/dub/library/{id}/revisions"
payload := strings.NewReader("{\n \"revision\": 2,\n \"segment_ids\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "pyai_session=")
req.Header.Add("Idempotency-Key", "<idempotency-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://api.pyai.com/projects/{projectId}/dub/library/{id}/revisions")
.header("cookie", "pyai_session=")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"revision\": 2,\n \"segment_ids\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/projects/{projectId}/dub/library/{id}/revisions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'pyai_session='
request["Idempotency-Key"] = '<idempotency-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"revision\": 2,\n \"segment_ids\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"job_id": "<string>",
"name": "<string>",
"created_at": 123,
"status": "queued",
"parent_job_id": "<string>"
}Console creations
Regenerate Dubbing passages and save the revision to My work
Requires a signed-in creator, trusted console Origin, and a parent job saved in this project. Accepts DubRevisionInput. The backend creates an idempotent revision and saves it to the project library before responding, so browser departure does not discard the accepted job. Retry with the same key after an interrupted response.
POST
/
projects
/
{projectId}
/
dub
/
library
/
{id}
/
revisions
Regenerate Dubbing passages and save the revision to My work
curl --request POST \
--url https://api.pyai.com/projects/{projectId}/dub/library/{id}/revisions \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--cookie pyai_session= \
--data '
{
"revision": 2,
"segment_ids": [
"<string>"
]
}
'import requests
url = "https://api.pyai.com/projects/{projectId}/dub/library/{id}/revisions"
payload = {
"revision": 2,
"segment_ids": ["<string>"]
}
headers = {
"cookie": "pyai_session=",
"Idempotency-Key": "<idempotency-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
cookie: 'pyai_session=',
'Idempotency-Key': '<idempotency-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({revision: 2, segment_ids: ['<string>']})
};
fetch('https://api.pyai.com/projects/{projectId}/dub/library/{id}/revisions', 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://api.pyai.com/projects/{projectId}/dub/library/{id}/revisions",
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([
'revision' => 2,
'segment_ids' => [
'<string>'
]
]),
CURLOPT_COOKIE => "pyai_session=",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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://api.pyai.com/projects/{projectId}/dub/library/{id}/revisions"
payload := strings.NewReader("{\n \"revision\": 2,\n \"segment_ids\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "pyai_session=")
req.Header.Add("Idempotency-Key", "<idempotency-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://api.pyai.com/projects/{projectId}/dub/library/{id}/revisions")
.header("cookie", "pyai_session=")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"revision\": 2,\n \"segment_ids\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/projects/{projectId}/dub/library/{id}/revisions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'pyai_session='
request["Idempotency-Key"] = '<idempotency-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"revision\": 2,\n \"segment_ids\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"job_id": "<string>",
"name": "<string>",
"created_at": 123,
"status": "queued",
"parent_job_id": "<string>"
}Authorizations
Console session cookie. PyAI-admin routes also require the configured platform-admin email allowlist.
Headers
Pattern:
^[A-Za-z0-9_-]{16,128}$Body
application/json