curl --request PUT \
--url https://api.pyai.com/v1/telephony/numbers/{id}/inbound-binding \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_version": 1,
"enabled": true,
"project_id": "<string>",
"agent_id": "<string>",
"agent_release_id": "<string>",
"agent_profile_sha256": "<string>",
"admission_mode": "platform",
"activate_carrier_route": false,
"rollback_carrier_route": false,
"carrier_operation_id": "<string>"
}
'import requests
url = "https://api.pyai.com/v1/telephony/numbers/{id}/inbound-binding"
payload = {
"expected_version": 1,
"enabled": True,
"project_id": "<string>",
"agent_id": "<string>",
"agent_release_id": "<string>",
"agent_profile_sha256": "<string>",
"admission_mode": "platform",
"activate_carrier_route": False,
"rollback_carrier_route": False,
"carrier_operation_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expected_version: 1,
enabled: true,
project_id: '<string>',
agent_id: '<string>',
agent_release_id: '<string>',
agent_profile_sha256: '<string>',
admission_mode: 'platform',
activate_carrier_route: false,
rollback_carrier_route: false,
carrier_operation_id: '<string>'
})
};
fetch('https://api.pyai.com/v1/telephony/numbers/{id}/inbound-binding', 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/numbers/{id}/inbound-binding",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'expected_version' => 1,
'enabled' => true,
'project_id' => '<string>',
'agent_id' => '<string>',
'agent_release_id' => '<string>',
'agent_profile_sha256' => '<string>',
'admission_mode' => 'platform',
'activate_carrier_route' => false,
'rollback_carrier_route' => false,
'carrier_operation_id' => '<string>'
]),
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/numbers/{id}/inbound-binding"
payload := strings.NewReader("{\n \"expected_version\": 1,\n \"enabled\": true,\n \"project_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"agent_release_id\": \"<string>\",\n \"agent_profile_sha256\": \"<string>\",\n \"admission_mode\": \"platform\",\n \"activate_carrier_route\": false,\n \"rollback_carrier_route\": false,\n \"carrier_operation_id\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.pyai.com/v1/telephony/numbers/{id}/inbound-binding")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expected_version\": 1,\n \"enabled\": true,\n \"project_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"agent_release_id\": \"<string>\",\n \"agent_profile_sha256\": \"<string>\",\n \"admission_mode\": \"platform\",\n \"activate_carrier_route\": false,\n \"rollback_carrier_route\": false,\n \"carrier_operation_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/v1/telephony/numbers/{id}/inbound-binding")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expected_version\": 1,\n \"enabled\": true,\n \"project_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"agent_release_id\": \"<string>\",\n \"agent_profile_sha256\": \"<string>\",\n \"admission_mode\": \"platform\",\n \"activate_carrier_route\": false,\n \"rollback_carrier_route\": false,\n \"carrier_operation_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"object": "telephony.inbound_binding",
"number_id": "<string>",
"version": 1,
"enabled": true,
"project_id": "<string>",
"agent_id": "<string>",
"agent_release_id": "<string>",
"agent_profile_sha256": "<string>",
"admission_mode": "client",
"carrier_operation": {
"id": "<string>",
"phase": "pending",
"revision": 2,
"request_sha256": "<string>",
"prior_route_sha256": "<string>",
"desired_route_sha256": "<string>",
"expected_version": 1,
"desired_binding": {
"project_id": "<string>",
"agent_id": "<string>",
"agent_release_id": "<string>",
"agent_profile_sha256": "<string>",
"admission_mode": "client"
},
"rollback_expected_version": 1
}
}{
"object": "telephony.inbound_binding",
"number_id": "<string>",
"version": 1,
"enabled": true,
"project_id": "<string>",
"agent_id": "<string>",
"agent_release_id": "<string>",
"agent_profile_sha256": "<string>",
"admission_mode": "client",
"carrier_operation": {
"id": "<string>",
"phase": "pending",
"revision": 2,
"request_sha256": "<string>",
"prior_route_sha256": "<string>",
"desired_route_sha256": "<string>",
"expected_version": 1,
"desired_binding": {
"project_id": "<string>",
"agent_id": "<string>",
"agent_release_id": "<string>",
"agent_profile_sha256": "<string>",
"admission_mode": "client"
},
"rollback_expected_version": 1
}
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}Set an explicit managed inbound binding
Compare-and-swap the number binding with expected_version (initially 0). Enable with project_id, agent_id, agent_release_id and agent_profile_sha256: SHA-256 of recursively key-sorted JSON for the full public Agent GET resource (array order retained). The profile must have no greeting variants. admission_mode=client waits up to 12 seconds before answer; platform accepts with a 120-second cap. Ordinary connected-number binding only reads already canonical carrier routing. Explicit activate_carrier_route=true with a stable carrier_operation_id captures encrypted prior routing before changing only this verified-owned carrier number’s voice/status callbacks. Pending/unknown operations return 202, block new admissions and must be resumed with the same original request; GET exposes the immutable desired binding and original expected_version. Roll back with enabled=false, rollback_carrier_route=true, the same operation ID and current expected_version; routing is restored only if it still matches the operation’s captured desired or prior hash. External drift is held unknown without overwrite. Existing admitted calls retain frozen authority. No number acquisition occurs.
curl --request PUT \
--url https://api.pyai.com/v1/telephony/numbers/{id}/inbound-binding \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_version": 1,
"enabled": true,
"project_id": "<string>",
"agent_id": "<string>",
"agent_release_id": "<string>",
"agent_profile_sha256": "<string>",
"admission_mode": "platform",
"activate_carrier_route": false,
"rollback_carrier_route": false,
"carrier_operation_id": "<string>"
}
'import requests
url = "https://api.pyai.com/v1/telephony/numbers/{id}/inbound-binding"
payload = {
"expected_version": 1,
"enabled": True,
"project_id": "<string>",
"agent_id": "<string>",
"agent_release_id": "<string>",
"agent_profile_sha256": "<string>",
"admission_mode": "platform",
"activate_carrier_route": False,
"rollback_carrier_route": False,
"carrier_operation_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expected_version: 1,
enabled: true,
project_id: '<string>',
agent_id: '<string>',
agent_release_id: '<string>',
agent_profile_sha256: '<string>',
admission_mode: 'platform',
activate_carrier_route: false,
rollback_carrier_route: false,
carrier_operation_id: '<string>'
})
};
fetch('https://api.pyai.com/v1/telephony/numbers/{id}/inbound-binding', 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/numbers/{id}/inbound-binding",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'expected_version' => 1,
'enabled' => true,
'project_id' => '<string>',
'agent_id' => '<string>',
'agent_release_id' => '<string>',
'agent_profile_sha256' => '<string>',
'admission_mode' => 'platform',
'activate_carrier_route' => false,
'rollback_carrier_route' => false,
'carrier_operation_id' => '<string>'
]),
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/numbers/{id}/inbound-binding"
payload := strings.NewReader("{\n \"expected_version\": 1,\n \"enabled\": true,\n \"project_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"agent_release_id\": \"<string>\",\n \"agent_profile_sha256\": \"<string>\",\n \"admission_mode\": \"platform\",\n \"activate_carrier_route\": false,\n \"rollback_carrier_route\": false,\n \"carrier_operation_id\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.pyai.com/v1/telephony/numbers/{id}/inbound-binding")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expected_version\": 1,\n \"enabled\": true,\n \"project_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"agent_release_id\": \"<string>\",\n \"agent_profile_sha256\": \"<string>\",\n \"admission_mode\": \"platform\",\n \"activate_carrier_route\": false,\n \"rollback_carrier_route\": false,\n \"carrier_operation_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/v1/telephony/numbers/{id}/inbound-binding")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expected_version\": 1,\n \"enabled\": true,\n \"project_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"agent_release_id\": \"<string>\",\n \"agent_profile_sha256\": \"<string>\",\n \"admission_mode\": \"platform\",\n \"activate_carrier_route\": false,\n \"rollback_carrier_route\": false,\n \"carrier_operation_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"object": "telephony.inbound_binding",
"number_id": "<string>",
"version": 1,
"enabled": true,
"project_id": "<string>",
"agent_id": "<string>",
"agent_release_id": "<string>",
"agent_profile_sha256": "<string>",
"admission_mode": "client",
"carrier_operation": {
"id": "<string>",
"phase": "pending",
"revision": 2,
"request_sha256": "<string>",
"prior_route_sha256": "<string>",
"desired_route_sha256": "<string>",
"expected_version": 1,
"desired_binding": {
"project_id": "<string>",
"agent_id": "<string>",
"agent_release_id": "<string>",
"agent_profile_sha256": "<string>",
"admission_mode": "client"
},
"rollback_expected_version": 1
}
}{
"object": "telephony.inbound_binding",
"number_id": "<string>",
"version": 1,
"enabled": true,
"project_id": "<string>",
"agent_id": "<string>",
"agent_release_id": "<string>",
"agent_profile_sha256": "<string>",
"admission_mode": "client",
"carrier_operation": {
"id": "<string>",
"phase": "pending",
"revision": 2,
"request_sha256": "<string>",
"prior_route_sha256": "<string>",
"desired_route_sha256": "<string>",
"expected_version": 1,
"desired_binding": {
"project_id": "<string>",
"agent_id": "<string>",
"agent_release_id": "<string>",
"agent_profile_sha256": "<string>",
"admission_mode": "client"
},
"rollback_expected_version": 1
}
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}Authorizations
Use Authorization: Bearer pyai_live_... (or pyai_test_...).
Path Parameters
Body
x >= 0200^[0-9a-f]{64}$platform, client 8 - 128^[A-Za-z0-9:_-]+$Response
Saved binding
"telephony.inbound_binding"x >= 0^[0-9a-f]{64}$client, platform Show child attributes
Show child attributes