curl --request PUT \
--url https://api.pyai.com/v1/trace/config \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "<string>",
"enabled": false,
"channels": [
"voice"
],
"rule_packs": {},
"guardrails": {
"mode": "warn",
"block_pii": {
"patterns": []
},
"mandatory_disclosures": [
{
"text": "<string>",
"required_within_seconds": 123
}
],
"blocked_phrases": [
"<string>"
],
"fail_open": true,
"inline_timeout_ms": 10
}
}
'import requests
url = "https://api.pyai.com/v1/trace/config"
payload = {
"agent_id": "<string>",
"enabled": False,
"channels": ["voice"],
"rule_packs": {},
"guardrails": {
"mode": "warn",
"block_pii": { "patterns": [] },
"mandatory_disclosures": [
{
"text": "<string>",
"required_within_seconds": 123
}
],
"blocked_phrases": ["<string>"],
"fail_open": True,
"inline_timeout_ms": 10
}
}
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({
agent_id: '<string>',
enabled: false,
channels: ['voice'],
rule_packs: {},
guardrails: {
mode: 'warn',
block_pii: {patterns: []},
mandatory_disclosures: [{text: '<string>', required_within_seconds: 123}],
blocked_phrases: ['<string>'],
fail_open: true,
inline_timeout_ms: 10
}
})
};
fetch('https://api.pyai.com/v1/trace/config', 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/trace/config",
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([
'agent_id' => '<string>',
'enabled' => false,
'channels' => [
'voice'
],
'rule_packs' => [
],
'guardrails' => [
'mode' => 'warn',
'block_pii' => [
'patterns' => [
]
],
'mandatory_disclosures' => [
[
'text' => '<string>',
'required_within_seconds' => 123
]
],
'blocked_phrases' => [
'<string>'
],
'fail_open' => true,
'inline_timeout_ms' => 10
]
]),
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/trace/config"
payload := strings.NewReader("{\n \"agent_id\": \"<string>\",\n \"enabled\": false,\n \"channels\": [\n \"voice\"\n ],\n \"rule_packs\": {},\n \"guardrails\": {\n \"mode\": \"warn\",\n \"block_pii\": {\n \"patterns\": []\n },\n \"mandatory_disclosures\": [\n {\n \"text\": \"<string>\",\n \"required_within_seconds\": 123\n }\n ],\n \"blocked_phrases\": [\n \"<string>\"\n ],\n \"fail_open\": true,\n \"inline_timeout_ms\": 10\n }\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/trace/config")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"<string>\",\n \"enabled\": false,\n \"channels\": [\n \"voice\"\n ],\n \"rule_packs\": {},\n \"guardrails\": {\n \"mode\": \"warn\",\n \"block_pii\": {\n \"patterns\": []\n },\n \"mandatory_disclosures\": [\n {\n \"text\": \"<string>\",\n \"required_within_seconds\": 123\n }\n ],\n \"blocked_phrases\": [\n \"<string>\"\n ],\n \"fail_open\": true,\n \"inline_timeout_ms\": 10\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/v1/trace/config")
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 \"agent_id\": \"<string>\",\n \"enabled\": false,\n \"channels\": [\n \"voice\"\n ],\n \"rule_packs\": {},\n \"guardrails\": {\n \"mode\": \"warn\",\n \"block_pii\": {\n \"patterns\": []\n },\n \"mandatory_disclosures\": [\n {\n \"text\": \"<string>\",\n \"required_within_seconds\": 123\n }\n ],\n \"blocked_phrases\": [\n \"<string>\"\n ],\n \"fail_open\": true,\n \"inline_timeout_ms\": 10\n }\n}"
response = http.request(request)
puts response.read_body{
"object": "trace.config",
"agent_id": "<string>",
"enabled": true,
"etag": "<string>",
"updated_at": 123,
"config": {
"agent_id": "<string>",
"enabled": false,
"channels": [
"voice"
],
"rule_packs": {},
"guardrails": {
"mode": "warn",
"block_pii": {
"patterns": []
},
"mandatory_disclosures": [
{
"text": "<string>",
"required_within_seconds": 123
}
],
"blocked_phrases": [
"<string>"
],
"fail_open": true,
"inline_timeout_ms": 10
}
}
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>"
}
}Set Trace config for an agent (or the org default)
Upsert the per-agent Trace config (spec §5.1). The body is the §5.1 object (optionally
wrapped as { agent_id, config }). Modes: warn (log only, never blocks) · modify
(redact PII / inject disclosures) · block · human_handoff. Always fail-open; the
deterministic inline gate runs models-side, the platform only distributes config.
Returns the stored config with its content ETag (the models-side pull pins this).
Requires the trace:configure scope.
curl --request PUT \
--url https://api.pyai.com/v1/trace/config \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "<string>",
"enabled": false,
"channels": [
"voice"
],
"rule_packs": {},
"guardrails": {
"mode": "warn",
"block_pii": {
"patterns": []
},
"mandatory_disclosures": [
{
"text": "<string>",
"required_within_seconds": 123
}
],
"blocked_phrases": [
"<string>"
],
"fail_open": true,
"inline_timeout_ms": 10
}
}
'import requests
url = "https://api.pyai.com/v1/trace/config"
payload = {
"agent_id": "<string>",
"enabled": False,
"channels": ["voice"],
"rule_packs": {},
"guardrails": {
"mode": "warn",
"block_pii": { "patterns": [] },
"mandatory_disclosures": [
{
"text": "<string>",
"required_within_seconds": 123
}
],
"blocked_phrases": ["<string>"],
"fail_open": True,
"inline_timeout_ms": 10
}
}
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({
agent_id: '<string>',
enabled: false,
channels: ['voice'],
rule_packs: {},
guardrails: {
mode: 'warn',
block_pii: {patterns: []},
mandatory_disclosures: [{text: '<string>', required_within_seconds: 123}],
blocked_phrases: ['<string>'],
fail_open: true,
inline_timeout_ms: 10
}
})
};
fetch('https://api.pyai.com/v1/trace/config', 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/trace/config",
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([
'agent_id' => '<string>',
'enabled' => false,
'channels' => [
'voice'
],
'rule_packs' => [
],
'guardrails' => [
'mode' => 'warn',
'block_pii' => [
'patterns' => [
]
],
'mandatory_disclosures' => [
[
'text' => '<string>',
'required_within_seconds' => 123
]
],
'blocked_phrases' => [
'<string>'
],
'fail_open' => true,
'inline_timeout_ms' => 10
]
]),
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/trace/config"
payload := strings.NewReader("{\n \"agent_id\": \"<string>\",\n \"enabled\": false,\n \"channels\": [\n \"voice\"\n ],\n \"rule_packs\": {},\n \"guardrails\": {\n \"mode\": \"warn\",\n \"block_pii\": {\n \"patterns\": []\n },\n \"mandatory_disclosures\": [\n {\n \"text\": \"<string>\",\n \"required_within_seconds\": 123\n }\n ],\n \"blocked_phrases\": [\n \"<string>\"\n ],\n \"fail_open\": true,\n \"inline_timeout_ms\": 10\n }\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/trace/config")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"<string>\",\n \"enabled\": false,\n \"channels\": [\n \"voice\"\n ],\n \"rule_packs\": {},\n \"guardrails\": {\n \"mode\": \"warn\",\n \"block_pii\": {\n \"patterns\": []\n },\n \"mandatory_disclosures\": [\n {\n \"text\": \"<string>\",\n \"required_within_seconds\": 123\n }\n ],\n \"blocked_phrases\": [\n \"<string>\"\n ],\n \"fail_open\": true,\n \"inline_timeout_ms\": 10\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/v1/trace/config")
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 \"agent_id\": \"<string>\",\n \"enabled\": false,\n \"channels\": [\n \"voice\"\n ],\n \"rule_packs\": {},\n \"guardrails\": {\n \"mode\": \"warn\",\n \"block_pii\": {\n \"patterns\": []\n },\n \"mandatory_disclosures\": [\n {\n \"text\": \"<string>\",\n \"required_within_seconds\": 123\n }\n ],\n \"blocked_phrases\": [\n \"<string>\"\n ],\n \"fail_open\": true,\n \"inline_timeout_ms\": 10\n }\n}"
response = http.request(request)
puts response.read_body{
"object": "trace.config",
"agent_id": "<string>",
"enabled": true,
"etag": "<string>",
"updated_at": 123,
"config": {
"agent_id": "<string>",
"enabled": false,
"channels": [
"voice"
],
"rule_packs": {},
"guardrails": {
"mode": "warn",
"block_pii": {
"patterns": []
},
"mandatory_disclosures": [
{
"text": "<string>",
"required_within_seconds": 123
}
],
"blocked_phrases": [
"<string>"
],
"fail_open": true,
"inline_timeout_ms": 10
}
}
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>"
}
}Authorizations
Use Authorization: Bearer pyai_live_... (or pyai_test_...).
Body
Per-agent Trace config (spec §5.1). May be wrapped as { agent_id, config } or sent raw.
Agent to configure; omit for the org-wide default.
voice, text Map of pack_id → { enabled, version }, e.g. { tcpa: { enabled: true } }.
Show child attributes
Show child attributes
Inline guardrails compiled into a synthesized rule pack (spec §5.1).
Show child attributes
Show child attributes
Response
Stored config
"trace.config"
warn, modify, block, human_handoff Content hash the models-side gate pins (version-pinned, ETag-cached pull).
Unix ms.
Per-agent Trace config (spec §5.1). May be wrapped as { agent_id, config } or sent raw.
Show child attributes
Show child attributes