Agent v1.0 APIs
Patch Update to Voice AI Agent API (deprecated)
Learn how to partially update properties. Update Bolna Voice AI agent name, welcome message, webhook URL, voice settings, and prompts, using this endpoint.
PATCH
/
agent
/
{agent_id}
cURL
curl --request PATCH \
--url https://api.bolna.ai/agent/{agent_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_config": {
"agent_name": "Alfred",
"agent_welcome_message": "How are you doing Bruce?",
"webhook_url": null,
"ingest_source_config": {
"source_type": "api",
"source_url": "https://example.com/api/data",
"source_auth_token": "abc123",
"source_name": "leads_sheet_june.csv"
},
"telephony_provider": "sip-trunk",
"calling_guardrails": {
"call_start_hour": 9,
"call_end_hour": 21
}
},
"agent_prompts": {}
}
'import requests
url = "https://api.bolna.ai/agent/{agent_id}"
payload = {
"agent_config": {
"agent_name": "Alfred",
"agent_welcome_message": "How are you doing Bruce?",
"webhook_url": None,
"ingest_source_config": {
"source_type": "api",
"source_url": "https://example.com/api/data",
"source_auth_token": "abc123",
"source_name": "leads_sheet_june.csv"
},
"telephony_provider": "sip-trunk",
"calling_guardrails": {
"call_start_hour": 9,
"call_end_hour": 21
}
},
"agent_prompts": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent_config: {
agent_name: 'Alfred',
agent_welcome_message: 'How are you doing Bruce?',
webhook_url: null,
ingest_source_config: {
source_type: 'api',
source_url: 'https://example.com/api/data',
source_auth_token: 'abc123',
source_name: 'leads_sheet_june.csv'
},
telephony_provider: 'sip-trunk',
calling_guardrails: {call_start_hour: 9, call_end_hour: 21}
},
agent_prompts: {}
})
};
fetch('https://api.bolna.ai/agent/{agent_id}', 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.bolna.ai/agent/{agent_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'agent_config' => [
'agent_name' => 'Alfred',
'agent_welcome_message' => 'How are you doing Bruce?',
'webhook_url' => null,
'ingest_source_config' => [
'source_type' => 'api',
'source_url' => 'https://example.com/api/data',
'source_auth_token' => 'abc123',
'source_name' => 'leads_sheet_june.csv'
],
'telephony_provider' => 'sip-trunk',
'calling_guardrails' => [
'call_start_hour' => 9,
'call_end_hour' => 21
]
],
'agent_prompts' => [
]
]),
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.bolna.ai/agent/{agent_id}"
payload := strings.NewReader("{\n \"agent_config\": {\n \"agent_name\": \"Alfred\",\n \"agent_welcome_message\": \"How are you doing Bruce?\",\n \"webhook_url\": null,\n \"ingest_source_config\": {\n \"source_type\": \"api\",\n \"source_url\": \"https://example.com/api/data\",\n \"source_auth_token\": \"abc123\",\n \"source_name\": \"leads_sheet_june.csv\"\n },\n \"telephony_provider\": \"sip-trunk\",\n \"calling_guardrails\": {\n \"call_start_hour\": 9,\n \"call_end_hour\": 21\n }\n },\n \"agent_prompts\": {}\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.bolna.ai/agent/{agent_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent_config\": {\n \"agent_name\": \"Alfred\",\n \"agent_welcome_message\": \"How are you doing Bruce?\",\n \"webhook_url\": null,\n \"ingest_source_config\": {\n \"source_type\": \"api\",\n \"source_url\": \"https://example.com/api/data\",\n \"source_auth_token\": \"abc123\",\n \"source_name\": \"leads_sheet_june.csv\"\n },\n \"telephony_provider\": \"sip-trunk\",\n \"calling_guardrails\": {\n \"call_start_hour\": 9,\n \"call_end_hour\": 21\n }\n },\n \"agent_prompts\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bolna.ai/agent/{agent_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_config\": {\n \"agent_name\": \"Alfred\",\n \"agent_welcome_message\": \"How are you doing Bruce?\",\n \"webhook_url\": null,\n \"ingest_source_config\": {\n \"source_type\": \"api\",\n \"source_url\": \"https://example.com/api/data\",\n \"source_auth_token\": \"abc123\",\n \"source_name\": \"leads_sheet_june.csv\"\n },\n \"telephony_provider\": \"sip-trunk\",\n \"calling_guardrails\": {\n \"call_start_hour\": 9,\n \"call_end_hour\": 21\n }\n },\n \"agent_prompts\": {}\n}"
response = http.request(request)
puts response.read_body{
"message": "success",
"state": "updated"
}{
"error": 123,
"message": "<string>"
}These APIs have now been deprecated.Please use the latest v2 APIs.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Update an agent
Response
agent status response
Was this page helpful?
⌘I
cURL
curl --request PATCH \
--url https://api.bolna.ai/agent/{agent_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_config": {
"agent_name": "Alfred",
"agent_welcome_message": "How are you doing Bruce?",
"webhook_url": null,
"ingest_source_config": {
"source_type": "api",
"source_url": "https://example.com/api/data",
"source_auth_token": "abc123",
"source_name": "leads_sheet_june.csv"
},
"telephony_provider": "sip-trunk",
"calling_guardrails": {
"call_start_hour": 9,
"call_end_hour": 21
}
},
"agent_prompts": {}
}
'import requests
url = "https://api.bolna.ai/agent/{agent_id}"
payload = {
"agent_config": {
"agent_name": "Alfred",
"agent_welcome_message": "How are you doing Bruce?",
"webhook_url": None,
"ingest_source_config": {
"source_type": "api",
"source_url": "https://example.com/api/data",
"source_auth_token": "abc123",
"source_name": "leads_sheet_june.csv"
},
"telephony_provider": "sip-trunk",
"calling_guardrails": {
"call_start_hour": 9,
"call_end_hour": 21
}
},
"agent_prompts": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent_config: {
agent_name: 'Alfred',
agent_welcome_message: 'How are you doing Bruce?',
webhook_url: null,
ingest_source_config: {
source_type: 'api',
source_url: 'https://example.com/api/data',
source_auth_token: 'abc123',
source_name: 'leads_sheet_june.csv'
},
telephony_provider: 'sip-trunk',
calling_guardrails: {call_start_hour: 9, call_end_hour: 21}
},
agent_prompts: {}
})
};
fetch('https://api.bolna.ai/agent/{agent_id}', 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.bolna.ai/agent/{agent_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'agent_config' => [
'agent_name' => 'Alfred',
'agent_welcome_message' => 'How are you doing Bruce?',
'webhook_url' => null,
'ingest_source_config' => [
'source_type' => 'api',
'source_url' => 'https://example.com/api/data',
'source_auth_token' => 'abc123',
'source_name' => 'leads_sheet_june.csv'
],
'telephony_provider' => 'sip-trunk',
'calling_guardrails' => [
'call_start_hour' => 9,
'call_end_hour' => 21
]
],
'agent_prompts' => [
]
]),
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.bolna.ai/agent/{agent_id}"
payload := strings.NewReader("{\n \"agent_config\": {\n \"agent_name\": \"Alfred\",\n \"agent_welcome_message\": \"How are you doing Bruce?\",\n \"webhook_url\": null,\n \"ingest_source_config\": {\n \"source_type\": \"api\",\n \"source_url\": \"https://example.com/api/data\",\n \"source_auth_token\": \"abc123\",\n \"source_name\": \"leads_sheet_june.csv\"\n },\n \"telephony_provider\": \"sip-trunk\",\n \"calling_guardrails\": {\n \"call_start_hour\": 9,\n \"call_end_hour\": 21\n }\n },\n \"agent_prompts\": {}\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.bolna.ai/agent/{agent_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent_config\": {\n \"agent_name\": \"Alfred\",\n \"agent_welcome_message\": \"How are you doing Bruce?\",\n \"webhook_url\": null,\n \"ingest_source_config\": {\n \"source_type\": \"api\",\n \"source_url\": \"https://example.com/api/data\",\n \"source_auth_token\": \"abc123\",\n \"source_name\": \"leads_sheet_june.csv\"\n },\n \"telephony_provider\": \"sip-trunk\",\n \"calling_guardrails\": {\n \"call_start_hour\": 9,\n \"call_end_hour\": 21\n }\n },\n \"agent_prompts\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bolna.ai/agent/{agent_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_config\": {\n \"agent_name\": \"Alfred\",\n \"agent_welcome_message\": \"How are you doing Bruce?\",\n \"webhook_url\": null,\n \"ingest_source_config\": {\n \"source_type\": \"api\",\n \"source_url\": \"https://example.com/api/data\",\n \"source_auth_token\": \"abc123\",\n \"source_name\": \"leads_sheet_june.csv\"\n },\n \"telephony_provider\": \"sip-trunk\",\n \"calling_guardrails\": {\n \"call_start_hour\": 9,\n \"call_end_hour\": 21\n }\n },\n \"agent_prompts\": {}\n}"
response = http.request(request)
puts response.read_body{
"message": "success",
"state": "updated"
}{
"error": 123,
"message": "<string>"
}
