Save transcripts and finalize a call archive
curl --request POST \
--url https://api.pyai.com/auth/interpretation-recordings/{recording_id}/complete \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"duration_ms": 300000,
"events": [
{}
],
"room_id": "<string>",
"audio_pending": true,
"audio_failed": true
}
'import requests
url = "https://api.pyai.com/auth/interpretation-recordings/{recording_id}/complete"
payload = {
"duration_ms": 300000,
"events": [{}],
"room_id": "<string>",
"audio_pending": True,
"audio_failed": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
duration_ms: 300000,
events: [{}],
room_id: '<string>',
audio_pending: true,
audio_failed: true
})
};
fetch('https://api.pyai.com/auth/interpretation-recordings/{recording_id}/complete', 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/auth/interpretation-recordings/{recording_id}/complete",
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([
'duration_ms' => 300000,
'events' => [
[
]
],
'room_id' => '<string>',
'audio_pending' => true,
'audio_failed' => true
]),
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://api.pyai.com/auth/interpretation-recordings/{recording_id}/complete"
payload := strings.NewReader("{\n \"duration_ms\": 300000,\n \"events\": [\n {}\n ],\n \"room_id\": \"<string>\",\n \"audio_pending\": true,\n \"audio_failed\": true\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.pyai.com/auth/interpretation-recordings/{recording_id}/complete")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"duration_ms\": 300000,\n \"events\": [\n {}\n ],\n \"room_id\": \"<string>\",\n \"audio_pending\": true,\n \"audio_failed\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/auth/interpretation-recordings/{recording_id}/complete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"duration_ms\": 300000,\n \"events\": [\n {}\n ],\n \"room_id\": \"<string>\",\n \"audio_pending\": true,\n \"audio_failed\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "recording"
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "invalid_request_error",
"param": "<string>"
}
}Interpretation
Save transcripts and finalize a call archive
Use the archive’s write-only upload_capability. First save events with audio_pending:true before uploading audio. Then omit audio_pending to finalize after both party files exist; transcript-only archives need no audio. Mark audio_failed:true after a failed capture so it cannot appear complete. Existing ready artifacts remain immutable. This does not close or bill the translation session.
POST
/
auth
/
interpretation-recordings
/
{recording_id}
/
complete
Save transcripts and finalize a call archive
curl --request POST \
--url https://api.pyai.com/auth/interpretation-recordings/{recording_id}/complete \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"duration_ms": 300000,
"events": [
{}
],
"room_id": "<string>",
"audio_pending": true,
"audio_failed": true
}
'import requests
url = "https://api.pyai.com/auth/interpretation-recordings/{recording_id}/complete"
payload = {
"duration_ms": 300000,
"events": [{}],
"room_id": "<string>",
"audio_pending": True,
"audio_failed": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
duration_ms: 300000,
events: [{}],
room_id: '<string>',
audio_pending: true,
audio_failed: true
})
};
fetch('https://api.pyai.com/auth/interpretation-recordings/{recording_id}/complete', 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/auth/interpretation-recordings/{recording_id}/complete",
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([
'duration_ms' => 300000,
'events' => [
[
]
],
'room_id' => '<string>',
'audio_pending' => true,
'audio_failed' => true
]),
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://api.pyai.com/auth/interpretation-recordings/{recording_id}/complete"
payload := strings.NewReader("{\n \"duration_ms\": 300000,\n \"events\": [\n {}\n ],\n \"room_id\": \"<string>\",\n \"audio_pending\": true,\n \"audio_failed\": true\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.pyai.com/auth/interpretation-recordings/{recording_id}/complete")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"duration_ms\": 300000,\n \"events\": [\n {}\n ],\n \"room_id\": \"<string>\",\n \"audio_pending\": true,\n \"audio_failed\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/auth/interpretation-recordings/{recording_id}/complete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"duration_ms\": 300000,\n \"events\": [\n {}\n ],\n \"room_id\": \"<string>\",\n \"audio_pending\": true,\n \"audio_failed\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "recording"
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "invalid_request_error",
"param": "<string>"
}
}Authorizations
Short-lived write-only upload_capability returned by POST /v1/audio/interpretations/recordings. Never use it for reads.
Path Parameters
Body
application/json