curl --request GET \
--url https://api.pyai.com/v1/amd/calls/{call_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pyai.com/v1/amd/calls/{call_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pyai.com/v1/amd/calls/{call_id}', 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/amd/calls/{call_id}",
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.pyai.com/v1/amd/calls/{call_id}"
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.pyai.com/v1/amd/calls/{call_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/v1/amd/calls/{call_id}")
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{
"object": "amd.call",
"call_id": "<string>",
"session_label": "<string>",
"status": "completed",
"answered_by": "human",
"answered_by_twilio": "<string>",
"confidence": 0.5,
"decision_ms": 123,
"created_at": 123,
"engine_version": "<string>",
"rule_id": "<string>",
"decision_timeout_ms": 8000,
"decision_elapsed_ms": 1,
"speech_ms": 1,
"silence_ms": 1,
"speech_elapsed_ms": 1,
"thresholds": {},
"reason": "<string>",
"aggressiveness": 123,
"custom_parameters": {
"lead_id": "lead-42",
"campaign_id": "campaign-7"
},
"started_at": 123,
"meta": {},
"error": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "invalid_request_error",
"param": "<string>"
}
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}Get an AMD decision
The full decision for one call: answered_by, answered_by_twilio, confidence, decision_ms, and the word-level reason. Requires amd:read.
curl --request GET \
--url https://api.pyai.com/v1/amd/calls/{call_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pyai.com/v1/amd/calls/{call_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pyai.com/v1/amd/calls/{call_id}', 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/amd/calls/{call_id}",
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.pyai.com/v1/amd/calls/{call_id}"
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.pyai.com/v1/amd/calls/{call_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/v1/amd/calls/{call_id}")
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{
"object": "amd.call",
"call_id": "<string>",
"session_label": "<string>",
"status": "completed",
"answered_by": "human",
"answered_by_twilio": "<string>",
"confidence": 0.5,
"decision_ms": 123,
"created_at": 123,
"engine_version": "<string>",
"rule_id": "<string>",
"decision_timeout_ms": 8000,
"decision_elapsed_ms": 1,
"speech_ms": 1,
"silence_ms": 1,
"speech_elapsed_ms": 1,
"thresholds": {},
"reason": "<string>",
"aggressiveness": 123,
"custom_parameters": {
"lead_id": "lead-42",
"campaign_id": "campaign-7"
},
"started_at": 123,
"meta": {},
"error": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "invalid_request_error",
"param": "<string>"
}
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}Authorizations
Use Authorization: Bearer pyai_live_... (or pyai_test_...).
Path Parameters
Response
AMD decision detail
Optional structured evidence on new AMD decisions; older records may omit it.
"amd.call"
The opaque tag passed on the connect URL / TwiML, if any.
completed, failed PyAI's richer answered-by vocabulary. machine means an automated answer without an established subtype; it does not establish voicemail readiness or authorize hanging up. screening = an iPhone/Google call-screening assistant; sit_invalid = a dead/disconnected number.
human, machine, voicemail, live_voicemail, screening, ivr, music, human_gatekeeper, sit_invalid, fax, silence, unknown Twilio's exact AnsweredBy enum (human | machine_start | machine_end_beep | machine_end_silence | machine_end_other | fax | unknown), so a Twilio drop-in keeps its routing logic unchanged.
0 <= x <= 1Processed inbound audio through the decision, in ms; not elapsed time from carrier answer.
Unix ms when the decision was written.
Decision-policy identity.
Stable decision rule identifier.
Requested elapsed decision budget. Present when explicitly configured on the stream.
1000 <= x <= 15000Elapsed milliseconds from accepted authenticated start to result preparation; excludes webhook transport. Present when decision_timeout_ms was requested.
x >= 0Cumulative voiced audio excluding pauses; null if untracked.
x >= 0Current contiguous silence in ms.
x >= 0Audio since speech onset including pauses; null without onset.
x >= 0Effective decision thresholds and rule flags.
Show child attributes
Show child attributes
Human-readable evidence, e.g. "machine phrase: 'please leave a message' at 1.2s".
Operating point used for this call.
Customer correlation parameters, excluding reserved controls and credentials. Names match [A-Za-z0-9][A-Za-z0-9_.-]{0,63}. Each value is bounded to 1024 UTF-8 bytes, and all names plus values to 8192 UTF-8 bytes; character limits alone do not express these byte limits. Nested fields never override AMD result fields.
Show child attributes
Show child attributes
{
"lead_id": "lead-42",
"campaign_id": "campaign-7"
}
Unix ms when the call was answered.
Present when status is failed.