Get a call's transcript
A call’s transcript: the conversation and everything the agent did, in order.
Entries are the turns the agent and the customer spoke, the flows it entered and the blocks it chose, the
variables it stored, the knowledge it retrieved, the actions the flow ran, and events on the line such as
transfers. Each entry sets the one object its type names. A call in progress has a partial transcript.
Actions include recorded details for API requests, code, transfers, texts, emails, and more. Request details
may contain template placeholders. Credentials Phonely recognizes are replaced with ***: by their name (such
as api_key or password) or their format (such as a Stripe or OpenAI key). This is best effort: a secret under
a name and in a format that don’t say so can show, so keep credentials in a block’s headers: every header value
except plain ones such as Content-Type is always masked.
curl --request GET \
--url https://api.us.phonely.ai/v1/calls/{id}/transcript \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.us.phonely.ai/v1/calls/{id}/transcript"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.us.phonely.ai/v1/calls/{id}/transcript', 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.us.phonely.ai/v1/calls/{id}/transcript",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.us.phonely.ai/v1/calls/{id}/transcript"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.us.phonely.ai/v1/calls/{id}/transcript")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.us.phonely.ai/v1/calls/{id}/transcript")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"call_id": "<string>",
"entries": [
{
"action": {
"code": {
"error": "<string>",
"input": "<unknown>",
"logs": "<string>",
"output": "<unknown>"
},
"duration_seconds": 123,
"email": {
"bcc": [
"<string>"
],
"body": "<string>",
"body_format": "<string>",
"cc": [
"<string>"
],
"from_email": "<string>",
"from_name": "<string>",
"reply_to": "<string>",
"subject": "<string>",
"to": [
"<string>"
]
},
"filter": {
"cases": [
{
"conditions": [
"<string>"
],
"is_matched": true,
"logic_operator": "<string>",
"number": 123
}
],
"is_matched": true,
"matched_case": 123
},
"flow_transfer": {
"flow_id": "<string>",
"flow_name": "<string>"
},
"http": {
"is_timed_out": false,
"method": "<string>",
"request_body": "<unknown>",
"request_headers": {},
"response_body": "<unknown>",
"status_code": 123,
"url": "<string>"
},
"name": "<string>",
"notification": {
"email_to": [
"<string>"
],
"emails_sent": 123,
"sms_sent": 123,
"sms_to": [
"<string>"
]
},
"redial": {
"delay_seconds": 123,
"reason": "<string>",
"type": "<string>"
},
"sms": {
"from": "<string>",
"message": "<string>",
"message_id": "<string>",
"to": "<string>"
},
"stage": "<string>",
"status": "<string>",
"transfer": {
"destination": "<string>",
"mode": "<string>",
"result": "<string>"
},
"type": "<string>",
"variables": [
{
"name": "<string>",
"value": "<unknown>"
}
],
"webhook": {
"data": "<unknown>",
"is_received": true
}
},
"agent": {
"instructions": "<string>",
"possible_blocks": [
{
"name": "<string>"
}
],
"response_type": "<string>",
"text": "<string>"
},
"block": {
"id": "<string>",
"name": "<string>",
"reason": "<string>",
"type": "<string>",
"variables_used": [
{
"name": "<string>",
"value": "<unknown>"
}
]
},
"customer": {
"is_endpoint_detected": true,
"is_interruption": true,
"text": "<string>"
},
"event": {
"recording_offset_seconds": 123,
"type": "<string>"
},
"flow": {
"id": "<string>",
"name": "<string>",
"type": "<string>",
"version_id": "<string>",
"version_name": "<string>",
"version_number": 123
},
"knowledge": {
"context": "<string>",
"sources": [
{
"id": "<string>",
"name": "<string>"
}
]
},
"started_at": "2023-11-07T05:31:56Z",
"type": "<string>",
"variables": {
"captured": [
{
"name": "<string>",
"value": "<unknown>"
}
]
}
}
],
"object": "call_transcript",
"text": "<string>"
}{
"error": {
"code": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"request_id": "<string>"
}
}Response
Successful Response
A call's transcript: the conversation and everything the agent did, in order.
curl --request GET \
--url https://api.us.phonely.ai/v1/calls/{id}/transcript \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.us.phonely.ai/v1/calls/{id}/transcript"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.us.phonely.ai/v1/calls/{id}/transcript', 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.us.phonely.ai/v1/calls/{id}/transcript",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.us.phonely.ai/v1/calls/{id}/transcript"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.us.phonely.ai/v1/calls/{id}/transcript")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.us.phonely.ai/v1/calls/{id}/transcript")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"call_id": "<string>",
"entries": [
{
"action": {
"code": {
"error": "<string>",
"input": "<unknown>",
"logs": "<string>",
"output": "<unknown>"
},
"duration_seconds": 123,
"email": {
"bcc": [
"<string>"
],
"body": "<string>",
"body_format": "<string>",
"cc": [
"<string>"
],
"from_email": "<string>",
"from_name": "<string>",
"reply_to": "<string>",
"subject": "<string>",
"to": [
"<string>"
]
},
"filter": {
"cases": [
{
"conditions": [
"<string>"
],
"is_matched": true,
"logic_operator": "<string>",
"number": 123
}
],
"is_matched": true,
"matched_case": 123
},
"flow_transfer": {
"flow_id": "<string>",
"flow_name": "<string>"
},
"http": {
"is_timed_out": false,
"method": "<string>",
"request_body": "<unknown>",
"request_headers": {},
"response_body": "<unknown>",
"status_code": 123,
"url": "<string>"
},
"name": "<string>",
"notification": {
"email_to": [
"<string>"
],
"emails_sent": 123,
"sms_sent": 123,
"sms_to": [
"<string>"
]
},
"redial": {
"delay_seconds": 123,
"reason": "<string>",
"type": "<string>"
},
"sms": {
"from": "<string>",
"message": "<string>",
"message_id": "<string>",
"to": "<string>"
},
"stage": "<string>",
"status": "<string>",
"transfer": {
"destination": "<string>",
"mode": "<string>",
"result": "<string>"
},
"type": "<string>",
"variables": [
{
"name": "<string>",
"value": "<unknown>"
}
],
"webhook": {
"data": "<unknown>",
"is_received": true
}
},
"agent": {
"instructions": "<string>",
"possible_blocks": [
{
"name": "<string>"
}
],
"response_type": "<string>",
"text": "<string>"
},
"block": {
"id": "<string>",
"name": "<string>",
"reason": "<string>",
"type": "<string>",
"variables_used": [
{
"name": "<string>",
"value": "<unknown>"
}
]
},
"customer": {
"is_endpoint_detected": true,
"is_interruption": true,
"text": "<string>"
},
"event": {
"recording_offset_seconds": 123,
"type": "<string>"
},
"flow": {
"id": "<string>",
"name": "<string>",
"type": "<string>",
"version_id": "<string>",
"version_name": "<string>",
"version_number": 123
},
"knowledge": {
"context": "<string>",
"sources": [
{
"id": "<string>",
"name": "<string>"
}
]
},
"started_at": "2023-11-07T05:31:56Z",
"type": "<string>",
"variables": {
"captured": [
{
"name": "<string>",
"value": "<unknown>"
}
]
}
}
],
"object": "call_transcript",
"text": "<string>"
}{
"error": {
"code": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"request_id": "<string>"
}
}
