curl -X PUT https://api.{cluster}.{platform}.voiger.io/v1/admin/settings \
-H "Cookie: sid=$VOIGER_SESSION" \
-H "x-workspace-code: your-workspace-code" \
-H "x-csrf-token: $CSRF_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"settings": [
{
"name": "country",
"value": "CA",
"category": "general"
},
{
"name": "timezone",
"value": "America/Toronto",
"category": "general"
},
{
"name": "end_acw",
"value": true,
"category": "general"
},
{
"name": "clean_calls_inbound",
"value": 45,
"category": "kpis"
},
{
"name": "sla",
"value": {
"formula": "speed_of_answer",
"call_answered_threshold": 30,
"threshold_ignore_abandoned_calls": 5,
"percentage_answered_call": 80
},
"category": "kpis"
},
{
"name": "record_all_calls",
"value": true,
"category": "permissions"
}
]
}'
const res = await fetch("https://api.{cluster}.{platform}.voiger.io/v1/admin/settings", {
method: "PUT",
credentials: "include",
headers: { "x-workspace-code": "your-workspace-code" },
headers: { "Content-Type": "application/json", "x-csrf-token": csrf },
body: JSON.stringify({
"settings": [
{
"name": "country",
"value": "CA",
"category": "general"
},
{
"name": "timezone",
"value": "America/Toronto",
"category": "general"
},
{
"name": "end_acw",
"value": true,
"category": "general"
},
{
"name": "clean_calls_inbound",
"value": 45,
"category": "kpis"
},
{
"name": "sla",
"value": {
"formula": "speed_of_answer",
"call_answered_threshold": 30,
"threshold_ignore_abandoned_calls": 5,
"percentage_answered_call": 80
},
"category": "kpis"
},
{
"name": "record_all_calls",
"value": true,
"category": "permissions"
}
]
}),
})
const data = await res.json()
json · 200
{
"settings": [
{
"name": "country",
"value": "CA",
"category": "general"
},
{
"name": "end_acw",
"value": true,
"category": "general"
},
{
"name": "timezone",
"value": "America/Toronto",
"category": "general"
},
{
"name": "clean_calls_inbound",
"value": 45,
"category": "kpis"
},
{
"name": "sla",
"value": {
"formula": "speed_of_answer",
"call_answered_threshold": 30,
"threshold_ignore_abandoned_calls": 5,
"percentage_answered_call": 80
},
"category": "kpis"
},
{
"name": "record_all_calls",
"value": true,
"category": "permissions"
}
]
}