Correct transcript speaker roles
curl --request POST \
--url https://api.pyai.com/v1/recap/calls/{call_id}/transcript/roles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"corrections": [
{
"index": 1
}
]
}
'import requests
url = "https://api.pyai.com/v1/recap/calls/{call_id}/transcript/roles"
payload = { "corrections": [{ "index": 1 }] }
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({corrections: [{index: 1}]})
};
fetch('https://api.pyai.com/v1/recap/calls/{call_id}/transcript/roles', 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/v1/recap/calls/{call_id}/transcript/roles",
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([
'corrections' => [
[
'index' => 1
]
]
]),
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/v1/recap/calls/{call_id}/transcript/roles"
payload := strings.NewReader("{\n \"corrections\": [\n {\n \"index\": 1\n }\n ]\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/v1/recap/calls/{call_id}/transcript/roles")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"corrections\": [\n {\n \"index\": 1\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/v1/recap/calls/{call_id}/transcript/roles")
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 \"corrections\": [\n {\n \"index\": 1\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"object": "recap.call",
"call_id": "<string>",
"pack_id": "<string>",
"status": "pending",
"call_duration_s": 123,
"created_at": 123,
"completed_at": 123,
"source": "<string>",
"headline": "<string>",
"customer_name": "<string>",
"call_direction": "inbound",
"record": {
"format": "recap.record.v1",
"tldr": "<string>",
"summary": "<string>",
"action_items": [
{
"task": "<string>",
"owner": "<string>",
"due": "<string>"
}
],
"disposition": "<string>",
"next_steps": "<string>",
"talk_ratio": {
"agent": 0.5,
"customer": 0.5
},
"signals": [
{
"kind": "<string>",
"text": "<string>",
"at_s": 1
}
],
"fields": {},
"rep": {},
"manager": {},
"ops": {}
},
"transcript": {
"format": "utterances.v1",
"utterances": [
{
"speaker_role": "agent",
"text": "<string>",
"offset_s": 1,
"duration_s": 1,
"role_source": "keyword",
"role_confidence": 0.5
}
]
},
"processing": {
"stage": "<string>",
"elapsed_s": 1,
"utterance_count": 1,
"coverage_gaps": 1,
"polish_available": true
},
"error": "<string>",
"crm_write_status": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "invalid_request_error",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "invalid_request_error",
"param": "<string>"
}
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}Recap
Correct transcript speaker roles
Tenant-scoped correction of Recap speaker roles. Requires recap:read and the Recap add-on. Marks each edited utterance as a customer correction; does not rename upstream carriers.
POST
/
v1
/
recap
/
calls
/
{call_id}
/
transcript
/
roles
Correct transcript speaker roles
curl --request POST \
--url https://api.pyai.com/v1/recap/calls/{call_id}/transcript/roles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"corrections": [
{
"index": 1
}
]
}
'import requests
url = "https://api.pyai.com/v1/recap/calls/{call_id}/transcript/roles"
payload = { "corrections": [{ "index": 1 }] }
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({corrections: [{index: 1}]})
};
fetch('https://api.pyai.com/v1/recap/calls/{call_id}/transcript/roles', 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/v1/recap/calls/{call_id}/transcript/roles",
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([
'corrections' => [
[
'index' => 1
]
]
]),
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/v1/recap/calls/{call_id}/transcript/roles"
payload := strings.NewReader("{\n \"corrections\": [\n {\n \"index\": 1\n }\n ]\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/v1/recap/calls/{call_id}/transcript/roles")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"corrections\": [\n {\n \"index\": 1\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/v1/recap/calls/{call_id}/transcript/roles")
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 \"corrections\": [\n {\n \"index\": 1\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"object": "recap.call",
"call_id": "<string>",
"pack_id": "<string>",
"status": "pending",
"call_duration_s": 123,
"created_at": 123,
"completed_at": 123,
"source": "<string>",
"headline": "<string>",
"customer_name": "<string>",
"call_direction": "inbound",
"record": {
"format": "recap.record.v1",
"tldr": "<string>",
"summary": "<string>",
"action_items": [
{
"task": "<string>",
"owner": "<string>",
"due": "<string>"
}
],
"disposition": "<string>",
"next_steps": "<string>",
"talk_ratio": {
"agent": 0.5,
"customer": 0.5
},
"signals": [
{
"kind": "<string>",
"text": "<string>",
"at_s": 1
}
],
"fields": {},
"rep": {},
"manager": {},
"ops": {}
},
"transcript": {
"format": "utterances.v1",
"utterances": [
{
"speaker_role": "agent",
"text": "<string>",
"offset_s": 1,
"duration_s": 1,
"role_source": "keyword",
"role_confidence": 0.5
}
]
},
"processing": {
"stage": "<string>",
"elapsed_s": 1,
"utterance_count": 1,
"coverage_gaps": 1,
"polish_available": true
},
"error": "<string>",
"crm_write_status": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "invalid_request_error",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "invalid_request_error",
"param": "<string>"
}
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}Authorizations
apiKeyxApiKey
Use Authorization: Bearer pyai_live_... (or pyai_test_...).
Path Parameters
Body
application/json
Minimum array length:
1Show child attributes
Show child attributes
Response
Updated recap detail
Example:
"recap.call"
Available options:
pending, processing, complete, failed Call origin, for example external.
Best available summary headline for list and tracking views.
Available options:
inbound, outbound Typed Recap intelligence when status is complete (recap.record.v1).
Show child attributes
Show child attributes
Full speaker-labelled transcript retained from the Recap trigger.
Show child attributes
Show child attributes
Customer-safe processing diagnostics for this Recap.
Show child attributes
Show child attributes
⌘I