Update a voice agent
curl --request PATCH \
--url https://app.miyon.ai/api/v1/voice_agents/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Booking agent",
"description": "Handles appointment calls"
}
'import requests
url = "https://app.miyon.ai/api/v1/voice_agents/{id}"
payload = {
"name": "Booking agent",
"description": "Handles appointment calls"
}
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: 'Booking agent', description: 'Handles appointment calls'})
};
fetch('https://app.miyon.ai/api/v1/voice_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://app.miyon.ai/api/v1/voice_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' => 'Booking agent',
'description' => 'Handles appointment calls'
]),
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://app.miyon.ai/api/v1/voice_agents/{id}"
payload := strings.NewReader("{\n \"name\": \"Booking agent\",\n \"description\": \"Handles appointment calls\"\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://app.miyon.ai/api/v1/voice_agents/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Booking agent\",\n \"description\": \"Handles appointment calls\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.miyon.ai/api/v1/voice_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\": \"Booking agent\",\n \"description\": \"Handles appointment calls\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"name": "<string>",
"description": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"concerns": {
"voice_config": {
"read_url": "<string>",
"schema_url": "<string>",
"change_url": "<string>"
},
"prompts": {
"read_url": "<string>",
"schema_url": "<string>",
"change_url": "<string>"
},
"knowledge_base": {
"read_url": "<string>",
"schema_url": "<string>",
"change_url": "<string>"
}
}
}
Voice Agents
Update a voice agent
Change the agent’s name and description. Both are mirrored to the agent’s prompt. All other settings live in the settings endpoints.
PATCH
/
api
/
v1
/
voice_agents
/
{id}
Update a voice agent
curl --request PATCH \
--url https://app.miyon.ai/api/v1/voice_agents/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Booking agent",
"description": "Handles appointment calls"
}
'import requests
url = "https://app.miyon.ai/api/v1/voice_agents/{id}"
payload = {
"name": "Booking agent",
"description": "Handles appointment calls"
}
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: 'Booking agent', description: 'Handles appointment calls'})
};
fetch('https://app.miyon.ai/api/v1/voice_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://app.miyon.ai/api/v1/voice_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' => 'Booking agent',
'description' => 'Handles appointment calls'
]),
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://app.miyon.ai/api/v1/voice_agents/{id}"
payload := strings.NewReader("{\n \"name\": \"Booking agent\",\n \"description\": \"Handles appointment calls\"\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://app.miyon.ai/api/v1/voice_agents/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Booking agent\",\n \"description\": \"Handles appointment calls\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.miyon.ai/api/v1/voice_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\": \"Booking agent\",\n \"description\": \"Handles appointment calls\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"name": "<string>",
"description": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"concerns": {
"voice_config": {
"read_url": "<string>",
"schema_url": "<string>",
"change_url": "<string>"
},
"prompts": {
"read_url": "<string>",
"schema_url": "<string>",
"change_url": "<string>"
},
"knowledge_base": {
"read_url": "<string>",
"schema_url": "<string>",
"change_url": "<string>"
}
}
}
Autorisierungen
Scoped API token. Required scopes are listed on each operation in x-required-scopes.
Pfadparameter
ID of the voice agent.
Body
application/json
Antwort
The updated voice agent.
ID of the voice agent.
Display name of the agent.
Empty string when no description is set.
When the agent was created.
When the agent or its prompt was last changed.
URLs of this agent's settings endpoints.
Show child attributes
Show child attributes