curl --request PATCH \
--url https://api.allternit.com/v1/agents/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"instructions": "<string>",
"greeting": "<string>",
"model": "<string>",
"voice": "af_heart",
"tools": [],
"transfer_targets": [
"<string>"
],
"business_hours": {},
"metadata": {},
"runtime": "allternit",
"agent_view": {}
}
'import requests
url = "https://api.allternit.com/v1/agents/{id}"
payload = {
"name": "<string>",
"instructions": "<string>",
"greeting": "<string>",
"model": "<string>",
"voice": "af_heart",
"tools": [],
"transfer_targets": ["<string>"],
"business_hours": {},
"metadata": {},
"runtime": "allternit",
"agent_view": {}
}
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({
name: '<string>',
instructions: '<string>',
greeting: '<string>',
model: '<string>',
voice: 'af_heart',
tools: [],
transfer_targets: ['<string>'],
business_hours: {},
metadata: {},
runtime: 'allternit',
agent_view: {}
})
};
fetch('https://api.allternit.com/v1/agents/{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.allternit.com/v1/agents/{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([
'name' => '<string>',
'instructions' => '<string>',
'greeting' => '<string>',
'model' => '<string>',
'voice' => 'af_heart',
'tools' => [
],
'transfer_targets' => [
'<string>'
],
'business_hours' => [
],
'metadata' => [
],
'runtime' => 'allternit',
'agent_view' => [
]
]),
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.allternit.com/v1/agents/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"instructions\": \"<string>\",\n \"greeting\": \"<string>\",\n \"model\": \"<string>\",\n \"voice\": \"af_heart\",\n \"tools\": [],\n \"transfer_targets\": [\n \"<string>\"\n ],\n \"business_hours\": {},\n \"metadata\": {},\n \"runtime\": \"allternit\",\n \"agent_view\": {}\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.allternit.com/v1/agents/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"instructions\": \"<string>\",\n \"greeting\": \"<string>\",\n \"model\": \"<string>\",\n \"voice\": \"af_heart\",\n \"tools\": [],\n \"transfer_targets\": [\n \"<string>\"\n ],\n \"business_hours\": {},\n \"metadata\": {},\n \"runtime\": \"allternit\",\n \"agent_view\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.allternit.com/v1/agents/{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 \"name\": \"<string>\",\n \"instructions\": \"<string>\",\n \"greeting\": \"<string>\",\n \"model\": \"<string>\",\n \"voice\": \"af_heart\",\n \"tools\": [],\n \"transfer_targets\": [\n \"<string>\"\n ],\n \"business_hours\": {},\n \"metadata\": {},\n \"runtime\": \"allternit\",\n \"agent_view\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "agent",
"account_id": "<string>",
"name": "<string>",
"instructions": "<string>",
"greeting": "<string>",
"model": "<string>",
"voice": "af_heart",
"tools": [
"send_text"
],
"autonomy": "draft",
"transfer_targets": [
"<string>"
],
"business_hours": {},
"metadata": {},
"runtime": "allternit",
"access": "plan",
"agent_view": {
"view": "allternit",
"look": "terminal"
},
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"url": "<string>"
}
}Update an agent
Absent fields are unchanged; business_hours: null clears it; arrays and metadata replace the old value. The agent’s account can’t change.
curl --request PATCH \
--url https://api.allternit.com/v1/agents/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"instructions": "<string>",
"greeting": "<string>",
"model": "<string>",
"voice": "af_heart",
"tools": [],
"transfer_targets": [
"<string>"
],
"business_hours": {},
"metadata": {},
"runtime": "allternit",
"agent_view": {}
}
'import requests
url = "https://api.allternit.com/v1/agents/{id}"
payload = {
"name": "<string>",
"instructions": "<string>",
"greeting": "<string>",
"model": "<string>",
"voice": "af_heart",
"tools": [],
"transfer_targets": ["<string>"],
"business_hours": {},
"metadata": {},
"runtime": "allternit",
"agent_view": {}
}
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({
name: '<string>',
instructions: '<string>',
greeting: '<string>',
model: '<string>',
voice: 'af_heart',
tools: [],
transfer_targets: ['<string>'],
business_hours: {},
metadata: {},
runtime: 'allternit',
agent_view: {}
})
};
fetch('https://api.allternit.com/v1/agents/{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.allternit.com/v1/agents/{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([
'name' => '<string>',
'instructions' => '<string>',
'greeting' => '<string>',
'model' => '<string>',
'voice' => 'af_heart',
'tools' => [
],
'transfer_targets' => [
'<string>'
],
'business_hours' => [
],
'metadata' => [
],
'runtime' => 'allternit',
'agent_view' => [
]
]),
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.allternit.com/v1/agents/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"instructions\": \"<string>\",\n \"greeting\": \"<string>\",\n \"model\": \"<string>\",\n \"voice\": \"af_heart\",\n \"tools\": [],\n \"transfer_targets\": [\n \"<string>\"\n ],\n \"business_hours\": {},\n \"metadata\": {},\n \"runtime\": \"allternit\",\n \"agent_view\": {}\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.allternit.com/v1/agents/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"instructions\": \"<string>\",\n \"greeting\": \"<string>\",\n \"model\": \"<string>\",\n \"voice\": \"af_heart\",\n \"tools\": [],\n \"transfer_targets\": [\n \"<string>\"\n ],\n \"business_hours\": {},\n \"metadata\": {},\n \"runtime\": \"allternit\",\n \"agent_view\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.allternit.com/v1/agents/{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 \"name\": \"<string>\",\n \"instructions\": \"<string>\",\n \"greeting\": \"<string>\",\n \"model\": \"<string>\",\n \"voice\": \"af_heart\",\n \"tools\": [],\n \"transfer_targets\": [\n \"<string>\"\n ],\n \"business_hours\": {},\n \"metadata\": {},\n \"runtime\": \"allternit\",\n \"agent_view\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "agent",
"account_id": "<string>",
"name": "<string>",
"instructions": "<string>",
"greeting": "<string>",
"model": "<string>",
"voice": "af_heart",
"tools": [
"send_text"
],
"autonomy": "draft",
"transfer_targets": [
"<string>"
],
"business_hours": {},
"metadata": {},
"runtime": "allternit",
"access": "plan",
"agent_view": {
"view": "allternit",
"look": "terminal"
},
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"url": "<string>"
}
}Body
af_alloy, af_aoede, af_bella, af_heart, af_jessica, af_kore, af_nicole, af_nova, af_river, af_sarah, af_sky, am_adam, am_echo, am_eric, am_fenrir, am_liam, am_michael, am_onyx, am_puck, am_santa, bf_alice, bf_emma, bf_isabella, bf_lily, bm_daniel, bm_fable, bm_george, bm_lewis calendar (needs end-customer Google/Microsoft calendar connections) and transfer (arrives with voice calls) aren't available for hosted agents yet (tool_not_available). knowledge_search searches the agent's knowledge files; channel_post posts to a channel connected for the agent's account.
send_text, call, email, channel_post, calendar, web_fetch, web_search, knowledge_search, ask_human, transfer The runtime that runs the agent. Platform agents run on Allternit's hosted runtime, so the only value is
allternit (the default; an alias is stored as allternit). Any other runtime from GET /api/v1/runtimes
runs only on a computer: 422 runtime_not_available (create the agent in the Allternit app instead); an
unknown id is 422 runtime_unknown. Saves without it are never refused for it.
"allternit"
Response
The updated agent.
af_alloy, af_aoede, af_bella, af_heart, af_jessica, af_kore, af_nicole, af_nova, af_river, af_sarah, af_sky, am_adam, am_echo, am_eric, am_fenrir, am_liam, am_michael, am_onyx, am_puck, am_santa, bf_alice, bf_emma, bf_isabella, bf_lily, bm_daniel, bm_fable, bm_george, bm_lewis calendar (needs end-customer Google/Microsoft calendar connections) and transfer (arrives with voice calls) aren't available for hosted agents yet (tool_not_available). knowledge_search searches the agent's knowledge files; channel_post posts to a channel connected for the agent's account.
send_text, call, email, channel_post, calendar, web_fetch, web_search, knowledge_search, ask_human, transfer The runtime that runs the agent. Platform agents run on Allternit's hosted runtime, so the only value is
allternit (the default; an alias is stored as allternit). Any other runtime from GET /api/v1/runtimes
runs only on a computer: 422 runtime_not_available (create the agent in the Allternit app instead); an
unknown id is 422 runtime_unknown. Saves without it are never refused for it.
"allternit"