Save Outbound Config
curl --request PUT \
--url https://api.usetuner.ai/api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/outbound-config \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"trigger_url": "<string>",
"headers": [
{
"key": "<string>",
"value": "<string>"
}
],
"body_template_json": "<string>",
"vapi_phone_number_id": "<string>"
}
'import requests
url = "https://api.usetuner.ai/api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/outbound-config"
payload = {
"trigger_url": "<string>",
"headers": [
{
"key": "<string>",
"value": "<string>"
}
],
"body_template_json": "<string>",
"vapi_phone_number_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({
trigger_url: '<string>',
headers: [{key: '<string>', value: '<string>'}],
body_template_json: '<string>',
vapi_phone_number_id: '<string>'
})
};
fetch('https://api.usetuner.ai/api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/outbound-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/outbound-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([
'trigger_url' => '<string>',
'headers' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'body_template_json' => '<string>',
'vapi_phone_number_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.usetuner.ai/api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/outbound-config"
payload := strings.NewReader("{\n \"trigger_url\": \"<string>\",\n \"headers\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"body_template_json\": \"<string>\",\n \"vapi_phone_number_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.usetuner.ai/api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/outbound-config")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"trigger_url\": \"<string>\",\n \"headers\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"body_template_json\": \"<string>\",\n \"vapi_phone_number_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usetuner.ai/api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/outbound-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 \"trigger_url\": \"<string>\",\n \"headers\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"body_template_json\": \"<string>\",\n \"vapi_phone_number_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"agent_settings_id": 123,
"trigger_url": "<string>",
"headers": [
{
"key": "<string>",
"value": "<string>"
}
],
"body_template_json": "<string>",
"vapi_phone_number_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": "VAPI phone number not found"
}{
"detail": "Not authenticated"
}{
"detail": "User does not have access to workspace 42"
}{
"detail": "Agent with ID 17 not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"detail": "Trigger URL probe timed out"
}Agent Settings
Save Outbound Config
Save the outbound calling configuration for an agent.
Tuner sends a request to the trigger_url to verify it’s reachable before
saving. The configuration is only stored if that check succeeds.
PUT
/
api
/
v1
/
workspaces
/
{workspace_id}
/
agents
/
{agent_id}
/
settings
/
outbound-config
Save Outbound Config
curl --request PUT \
--url https://api.usetuner.ai/api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/outbound-config \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"trigger_url": "<string>",
"headers": [
{
"key": "<string>",
"value": "<string>"
}
],
"body_template_json": "<string>",
"vapi_phone_number_id": "<string>"
}
'import requests
url = "https://api.usetuner.ai/api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/outbound-config"
payload = {
"trigger_url": "<string>",
"headers": [
{
"key": "<string>",
"value": "<string>"
}
],
"body_template_json": "<string>",
"vapi_phone_number_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({
trigger_url: '<string>',
headers: [{key: '<string>', value: '<string>'}],
body_template_json: '<string>',
vapi_phone_number_id: '<string>'
})
};
fetch('https://api.usetuner.ai/api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/outbound-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/outbound-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([
'trigger_url' => '<string>',
'headers' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'body_template_json' => '<string>',
'vapi_phone_number_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.usetuner.ai/api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/outbound-config"
payload := strings.NewReader("{\n \"trigger_url\": \"<string>\",\n \"headers\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"body_template_json\": \"<string>\",\n \"vapi_phone_number_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.usetuner.ai/api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/outbound-config")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"trigger_url\": \"<string>\",\n \"headers\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"body_template_json\": \"<string>\",\n \"vapi_phone_number_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usetuner.ai/api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/outbound-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 \"trigger_url\": \"<string>\",\n \"headers\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"body_template_json\": \"<string>\",\n \"vapi_phone_number_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"agent_settings_id": 123,
"trigger_url": "<string>",
"headers": [
{
"key": "<string>",
"value": "<string>"
}
],
"body_template_json": "<string>",
"vapi_phone_number_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": "VAPI phone number not found"
}{
"detail": "Not authenticated"
}{
"detail": "User does not have access to workspace 42"
}{
"detail": "Agent with ID 17 not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"detail": "Trigger URL 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
Response
Successful Response
Show child attributes
Show child attributes
⌘I