Save SIP Config
curl --request PUT \
--url https://api.usetuner.ai/api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/sip-config \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sip_url": "<string>",
"sip_username": "<string>",
"sip_password": "<string>"
}
'import requests
url = "https://api.usetuner.ai/api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/sip-config"
payload = {
"sip_url": "<string>",
"sip_username": "<string>",
"sip_password": "<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({sip_url: '<string>', sip_username: '<string>', sip_password: '<string>'})
};
fetch('https://api.usetuner.ai/api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/sip-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.usetuner.ai/api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/sip-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([
'sip_url' => '<string>',
'sip_username' => '<string>',
'sip_password' => '<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.usetuner.ai/api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/sip-config"
payload := strings.NewReader("{\n \"sip_url\": \"<string>\",\n \"sip_username\": \"<string>\",\n \"sip_password\": \"<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.usetuner.ai/api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/sip-config")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sip_url\": \"<string>\",\n \"sip_username\": \"<string>\",\n \"sip_password\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usetuner.ai/api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/sip-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 \"sip_url\": \"<string>\",\n \"sip_username\": \"<string>\",\n \"sip_password\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"settings_id": 123,
"workspace_id": 123,
"sip_url": "<string>",
"sip_username": "<string>",
"sip_password": "<string>",
"is_sip_verified": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": "Not authenticated"
}{
"detail": "User does not have access to workspace 42"
}{
"detail": "Agent with ID 17 not found"
}{
"detail": "SIP verification failed: SIP verification timed out after 10s — endpoint did not answer"
}{
"detail": "SIP probe timed out"
}Agent Settings
Save SIP Config
Save the SIP trunk configuration for an agent.
Tuner connects to the trunk to verify the details before saving. The configuration is only stored if the check succeeds, so a successful response means the trunk is reachable.
PUT
/
api
/
v1
/
workspaces
/
{workspace_id}
/
agents
/
{agent_id}
/
settings
/
sip-config
Save SIP Config
curl --request PUT \
--url https://api.usetuner.ai/api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/sip-config \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sip_url": "<string>",
"sip_username": "<string>",
"sip_password": "<string>"
}
'import requests
url = "https://api.usetuner.ai/api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/sip-config"
payload = {
"sip_url": "<string>",
"sip_username": "<string>",
"sip_password": "<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({sip_url: '<string>', sip_username: '<string>', sip_password: '<string>'})
};
fetch('https://api.usetuner.ai/api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/sip-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.usetuner.ai/api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/sip-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([
'sip_url' => '<string>',
'sip_username' => '<string>',
'sip_password' => '<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.usetuner.ai/api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/sip-config"
payload := strings.NewReader("{\n \"sip_url\": \"<string>\",\n \"sip_username\": \"<string>\",\n \"sip_password\": \"<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.usetuner.ai/api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/sip-config")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sip_url\": \"<string>\",\n \"sip_username\": \"<string>\",\n \"sip_password\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usetuner.ai/api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/sip-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 \"sip_url\": \"<string>\",\n \"sip_username\": \"<string>\",\n \"sip_password\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"settings_id": 123,
"workspace_id": 123,
"sip_url": "<string>",
"sip_username": "<string>",
"sip_password": "<string>",
"is_sip_verified": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": "Not authenticated"
}{
"detail": "User does not have access to workspace 42"
}{
"detail": "Agent with ID 17 not found"
}{
"detail": "SIP verification failed: SIP verification timed out after 10s — endpoint did not answer"
}{
"detail": "SIP probe timed out"
}Authorizations
Use Tuner API key (tr_api_...) or user session token. Find your API key in Workspace Settings > API Keys.
Path Parameters
Tuner's internal numeric ID for the agent.
Workspace ID. Find this in Workspace > General Settings.
Body
application/json
⌘I