Configure outbound compliance policy
curl --request PUT \
--url https://api.pyai.com/v1/telephony/compliance/policy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"allowed_countries": [
"<string>"
],
"calling_window_start_hour": 8,
"calling_window_end_hour": 21,
"max_calls_per_24_hours": 100,
"max_calls_per_destination_24_hours": 3,
"max_attempts": 2,
"require_cnam_for_sales": true
}
'import requests
url = "https://api.pyai.com/v1/telephony/compliance/policy"
payload = {
"allowed_countries": ["<string>"],
"calling_window_start_hour": 8,
"calling_window_end_hour": 21,
"max_calls_per_24_hours": 100,
"max_calls_per_destination_24_hours": 3,
"max_attempts": 2,
"require_cnam_for_sales": True
}
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({
allowed_countries: ['<string>'],
calling_window_start_hour: 8,
calling_window_end_hour: 21,
max_calls_per_24_hours: 100,
max_calls_per_destination_24_hours: 3,
max_attempts: 2,
require_cnam_for_sales: true
})
};
fetch('https://api.pyai.com/v1/telephony/compliance/policy', 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/compliance/policy",
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([
'allowed_countries' => [
'<string>'
],
'calling_window_start_hour' => 8,
'calling_window_end_hour' => 21,
'max_calls_per_24_hours' => 100,
'max_calls_per_destination_24_hours' => 3,
'max_attempts' => 2,
'require_cnam_for_sales' => true
]),
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/compliance/policy"
payload := strings.NewReader("{\n \"allowed_countries\": [\n \"<string>\"\n ],\n \"calling_window_start_hour\": 8,\n \"calling_window_end_hour\": 21,\n \"max_calls_per_24_hours\": 100,\n \"max_calls_per_destination_24_hours\": 3,\n \"max_attempts\": 2,\n \"require_cnam_for_sales\": true\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/compliance/policy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"allowed_countries\": [\n \"<string>\"\n ],\n \"calling_window_start_hour\": 8,\n \"calling_window_end_hour\": 21,\n \"max_calls_per_24_hours\": 100,\n \"max_calls_per_destination_24_hours\": 3,\n \"max_attempts\": 2,\n \"require_cnam_for_sales\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/v1/telephony/compliance/policy")
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 \"allowed_countries\": [\n \"<string>\"\n ],\n \"calling_window_start_hour\": 8,\n \"calling_window_end_hour\": 21,\n \"max_calls_per_24_hours\": 100,\n \"max_calls_per_destination_24_hours\": 3,\n \"max_attempts\": 2,\n \"require_cnam_for_sales\": true\n}"
response = http.request(request)
puts response.read_body{
"allowed_countries": [
"<string>"
],
"calling_window_start_hour": 8,
"calling_window_end_hour": 21,
"max_calls_per_24_hours": 100,
"max_calls_per_destination_24_hours": 3,
"max_attempts": 2,
"require_cnam_for_sales": true,
"object": "telephony.compliance_policy",
"version": 123,
"updated_at": 123,
"guidance": {
"consent": "<string>",
"quiet_hours": "<string>",
"dnc": "<string>"
}
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>"
}
}Telephony
Configure outbound compliance policy
Set bounded calling windows, countries, velocity limits, and at most two pre-answer attempts. Strong defaults apply to omitted fields.
PUT
/
v1
/
telephony
/
compliance
/
policy
Configure outbound compliance policy
curl --request PUT \
--url https://api.pyai.com/v1/telephony/compliance/policy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"allowed_countries": [
"<string>"
],
"calling_window_start_hour": 8,
"calling_window_end_hour": 21,
"max_calls_per_24_hours": 100,
"max_calls_per_destination_24_hours": 3,
"max_attempts": 2,
"require_cnam_for_sales": true
}
'import requests
url = "https://api.pyai.com/v1/telephony/compliance/policy"
payload = {
"allowed_countries": ["<string>"],
"calling_window_start_hour": 8,
"calling_window_end_hour": 21,
"max_calls_per_24_hours": 100,
"max_calls_per_destination_24_hours": 3,
"max_attempts": 2,
"require_cnam_for_sales": True
}
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({
allowed_countries: ['<string>'],
calling_window_start_hour: 8,
calling_window_end_hour: 21,
max_calls_per_24_hours: 100,
max_calls_per_destination_24_hours: 3,
max_attempts: 2,
require_cnam_for_sales: true
})
};
fetch('https://api.pyai.com/v1/telephony/compliance/policy', 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/compliance/policy",
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([
'allowed_countries' => [
'<string>'
],
'calling_window_start_hour' => 8,
'calling_window_end_hour' => 21,
'max_calls_per_24_hours' => 100,
'max_calls_per_destination_24_hours' => 3,
'max_attempts' => 2,
'require_cnam_for_sales' => true
]),
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/compliance/policy"
payload := strings.NewReader("{\n \"allowed_countries\": [\n \"<string>\"\n ],\n \"calling_window_start_hour\": 8,\n \"calling_window_end_hour\": 21,\n \"max_calls_per_24_hours\": 100,\n \"max_calls_per_destination_24_hours\": 3,\n \"max_attempts\": 2,\n \"require_cnam_for_sales\": true\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/compliance/policy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"allowed_countries\": [\n \"<string>\"\n ],\n \"calling_window_start_hour\": 8,\n \"calling_window_end_hour\": 21,\n \"max_calls_per_24_hours\": 100,\n \"max_calls_per_destination_24_hours\": 3,\n \"max_attempts\": 2,\n \"require_cnam_for_sales\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/v1/telephony/compliance/policy")
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 \"allowed_countries\": [\n \"<string>\"\n ],\n \"calling_window_start_hour\": 8,\n \"calling_window_end_hour\": 21,\n \"max_calls_per_24_hours\": 100,\n \"max_calls_per_destination_24_hours\": 3,\n \"max_attempts\": 2,\n \"require_cnam_for_sales\": true\n}"
response = http.request(request)
puts response.read_body{
"allowed_countries": [
"<string>"
],
"calling_window_start_hour": 8,
"calling_window_end_hour": 21,
"max_calls_per_24_hours": 100,
"max_calls_per_destination_24_hours": 3,
"max_attempts": 2,
"require_cnam_for_sales": true,
"object": "telephony.compliance_policy",
"version": 123,
"updated_at": 123,
"guidance": {
"consent": "<string>",
"quiet_hours": "<string>",
"dnc": "<string>"
}
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>"
}
}Authorizations
apiKeyxApiKey
Use Authorization: Bearer pyai_live_... (or pyai_test_...).
Body
application/json
Available options:
active, suspended Pattern:
^[A-Z]{2}$Required range:
0 <= x <= 23Required range:
1 <= x <= 24Required range:
1 <= x <= 10000Required range:
1 <= x <= 20Required range:
1 <= x <= 2Response
Updated policy
Available options:
active, suspended Pattern:
^[A-Z]{2}$Required range:
0 <= x <= 23Required range:
1 <= x <= 24Required range:
1 <= x <= 10000Required range:
1 <= x <= 20Required range:
1 <= x <= 2Example:
"telephony.compliance_policy"
Show child attributes
Show child attributes
⌘I