Decide a pending inbound admission
curl --request POST \
--url https://api.pyai.com/v1/telephony/calls/{id}/admission \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"client_reference": "<string>",
"max_duration_seconds": 315
}
'import requests
url = "https://api.pyai.com/v1/telephony/calls/{id}/admission"
payload = {
"client_reference": "<string>",
"max_duration_seconds": 315
}
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({client_reference: '<string>', max_duration_seconds: 315})
};
fetch('https://api.pyai.com/v1/telephony/calls/{id}/admission', 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/telephony/calls/{id}/admission",
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([
'client_reference' => '<string>',
'max_duration_seconds' => 315
]),
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/telephony/calls/{id}/admission"
payload := strings.NewReader("{\n \"client_reference\": \"<string>\",\n \"max_duration_seconds\": 315\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/telephony/calls/{id}/admission")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"client_reference\": \"<string>\",\n \"max_duration_seconds\": 315\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/v1/telephony/calls/{id}/admission")
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 \"client_reference\": \"<string>\",\n \"max_duration_seconds\": 315\n}"
response = http.request(request)
puts response.read_body{
"version": 123,
"project_id": "<string>",
"direction": "inbound",
"from": "<string>",
"destination_number_id": "<string>",
"admission_mode": "client",
"admission_status": "pending",
"admission_expires_at": 123,
"max_duration_seconds": 123,
"client_reference": "<string>",
"agent_release_id": "<string>",
"stop_requested": true,
"object": "telephony.call",
"id": "tcall_...",
"from_number_id": "<string>",
"to": "+14155550123",
"agent_id": "<string>",
"call_type": "human",
"user_id": "<string>",
"use_case": "transactional",
"routing_profile": "quality_first",
"status": "queued",
"attempt_count": 1,
"max_attempts": 2,
"failure_reason": "network_unavailable",
"created_at": 123,
"updated_at": 123,
"answered_at": 123,
"ended_at": 123,
"artifacts": {
"status": "pending",
"omni_call_id": "<string>",
"recording": {
"status": "<string>",
"reason": "<string>",
"resource": "<string>"
},
"transcript": {
"status": "<string>",
"text": "<string>",
"resource": "<string>"
},
"ai_usage": {
"status": "pending",
"meter": "agents.minutes",
"units": 123,
"billable_units": 123
},
"usage": {
"status": "pending",
"meter": "telephony.minutes",
"units": 123,
"billable": true
}
}
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}Telephony
Decide a pending inbound admission
Accept or reject an inbound call before it is answered. Requires telephony:manage in the owning project. Persist your exact decision before sending; an exact retry returns the saved decision. A changed decision, reference, duration or expired admission returns 409. No call is originated. The original deadline is never extended.
POST
/
v1
/
telephony
/
calls
/
{id}
/
admission
Decide a pending inbound admission
curl --request POST \
--url https://api.pyai.com/v1/telephony/calls/{id}/admission \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"client_reference": "<string>",
"max_duration_seconds": 315
}
'import requests
url = "https://api.pyai.com/v1/telephony/calls/{id}/admission"
payload = {
"client_reference": "<string>",
"max_duration_seconds": 315
}
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({client_reference: '<string>', max_duration_seconds: 315})
};
fetch('https://api.pyai.com/v1/telephony/calls/{id}/admission', 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/telephony/calls/{id}/admission",
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([
'client_reference' => '<string>',
'max_duration_seconds' => 315
]),
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/telephony/calls/{id}/admission"
payload := strings.NewReader("{\n \"client_reference\": \"<string>\",\n \"max_duration_seconds\": 315\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/telephony/calls/{id}/admission")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"client_reference\": \"<string>\",\n \"max_duration_seconds\": 315\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/v1/telephony/calls/{id}/admission")
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 \"client_reference\": \"<string>\",\n \"max_duration_seconds\": 315\n}"
response = http.request(request)
puts response.read_body{
"version": 123,
"project_id": "<string>",
"direction": "inbound",
"from": "<string>",
"destination_number_id": "<string>",
"admission_mode": "client",
"admission_status": "pending",
"admission_expires_at": 123,
"max_duration_seconds": 123,
"client_reference": "<string>",
"agent_release_id": "<string>",
"stop_requested": true,
"object": "telephony.call",
"id": "tcall_...",
"from_number_id": "<string>",
"to": "+14155550123",
"agent_id": "<string>",
"call_type": "human",
"user_id": "<string>",
"use_case": "transactional",
"routing_profile": "quality_first",
"status": "queued",
"attempt_count": 1,
"max_attempts": 2,
"failure_reason": "network_unavailable",
"created_at": 123,
"updated_at": 123,
"answered_at": 123,
"ended_at": 123,
"artifacts": {
"status": "pending",
"omni_call_id": "<string>",
"recording": {
"status": "<string>",
"reason": "<string>",
"resource": "<string>"
},
"transcript": {
"status": "<string>",
"text": "<string>",
"resource": "<string>"
},
"ai_usage": {
"status": "pending",
"meter": "agents.minutes",
"units": 123,
"billable_units": 123
},
"usage": {
"status": "pending",
"meter": "telephony.minutes",
"units": 123,
"billable": true
}
}
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<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
Response
Saved call decision
Available options:
inbound, outbound Available options:
client, platform, null Available options:
pending, accept, reject, expired, null Original pre-answer admission deadline, Unix ms.
Example:
"telephony.call"
Example:
"tcall_..."
Example:
"+14155550123"
Available options:
human Available options:
transactional, support, sales, collections, survey Available options:
quality_first, balanced, cost_optimized Available options:
queued, dispatching, ringing, in_progress, completed, failed, canceled, dispatch_unknown Required range:
0 <= x <= 3Required range:
1 <= x <= 3Available options:
network_unavailable, congestion, timeout, no_answer, busy, rejected, invalid_number, identity_blocked, compliance_blocked, unknown, null Unix ms.
Unix ms.
Unix ms.
Unix ms.
Post-call artifact and billing readiness. Included on the single-call detail response; pending until the media edge finalizes the call.
Show child attributes
Show child attributes