Update an agent
curl --request PATCH \
--url https://api-eg.olimi.ai/api/v2/agents/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "Admissions Assistant (Cairo)",
"description": "Answers questions about enrollment and fees."
}
'import requests
url = "https://api-eg.olimi.ai/api/v2/agents/{id}"
payload = {
"name": "Admissions Assistant (Cairo)",
"description": "Answers questions about enrollment and fees."
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Admissions Assistant (Cairo)',
description: 'Answers questions about enrollment and fees.'
})
};
fetch('https://api-eg.olimi.ai/api/v2/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-eg.olimi.ai/api/v2/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' => 'Admissions Assistant (Cairo)',
'description' => 'Answers questions about enrollment and fees.'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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-eg.olimi.ai/api/v2/agents/{id}"
payload := strings.NewReader("{\n \"name\": \"Admissions Assistant (Cairo)\",\n \"description\": \"Answers questions about enrollment and fees.\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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-eg.olimi.ai/api/v2/agents/{id}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Admissions Assistant (Cairo)\",\n \"description\": \"Answers questions about enrollment and fees.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eg.olimi.ai/api/v2/agents/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Admissions Assistant (Cairo)\",\n \"description\": \"Answers questions about enrollment and fees.\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Agent updated successfully",
"data": {
"id": "0d6a3f7e-5b8c-4b1e-9a51-2f1d7c9e4a10",
"organizationId": "5f2c8a91-7d3e-4b60-8c1a-9e4f2b7d6a35",
"name": "Admissions Assistant",
"description": "Answers questions about enrollment and fees.",
"callType": "inbound",
"isActive": true,
"languageId": "a3b9e2d4-6c1f-4e8a-9d72-1b5c8f3e0a46",
"voiceId": "e7d1c5b2-4a8f-4396-b0e2-7c9a1d3f5b68",
"voice": {
"id": "e7d1c5b2-4a8f-4396-b0e2-7c9a1d3f5b68",
"name": "Salma",
"gender": "female",
"language": {
"id": "a3b9e2d4-6c1f-4e8a-9d72-1b5c8f3e0a46",
"name": "Arabic - Egyptian",
"code": "ar-EG"
}
},
"createdAt": "2026-08-12T09:31:04.112Z",
"updatedAt": "2026-09-20T14:02:51.870Z"
}
}{
"statusCode": 404,
"errorCode": "agent_not_found",
"message": "Agent not found"
}{
"statusCode": 404,
"errorCode": "agent_not_found",
"message": "Agent not found"
}{
"statusCode": 404,
"errorCode": "agent_not_found",
"message": "Agent not found"
}{
"statusCode": 422,
"message": [
"name must be shorter than or equal to 100 characters"
],
"error": "Unprocessable Entity"
}Agents
Update an agent
Changes an agent’s name or description. Send only the fields you want to change.
PATCH
/
api
/
v2
/
agents
/
{id}
Update an agent
curl --request PATCH \
--url https://api-eg.olimi.ai/api/v2/agents/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "Admissions Assistant (Cairo)",
"description": "Answers questions about enrollment and fees."
}
'import requests
url = "https://api-eg.olimi.ai/api/v2/agents/{id}"
payload = {
"name": "Admissions Assistant (Cairo)",
"description": "Answers questions about enrollment and fees."
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Admissions Assistant (Cairo)',
description: 'Answers questions about enrollment and fees.'
})
};
fetch('https://api-eg.olimi.ai/api/v2/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-eg.olimi.ai/api/v2/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' => 'Admissions Assistant (Cairo)',
'description' => 'Answers questions about enrollment and fees.'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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-eg.olimi.ai/api/v2/agents/{id}"
payload := strings.NewReader("{\n \"name\": \"Admissions Assistant (Cairo)\",\n \"description\": \"Answers questions about enrollment and fees.\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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-eg.olimi.ai/api/v2/agents/{id}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Admissions Assistant (Cairo)\",\n \"description\": \"Answers questions about enrollment and fees.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eg.olimi.ai/api/v2/agents/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Admissions Assistant (Cairo)\",\n \"description\": \"Answers questions about enrollment and fees.\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Agent updated successfully",
"data": {
"id": "0d6a3f7e-5b8c-4b1e-9a51-2f1d7c9e4a10",
"organizationId": "5f2c8a91-7d3e-4b60-8c1a-9e4f2b7d6a35",
"name": "Admissions Assistant",
"description": "Answers questions about enrollment and fees.",
"callType": "inbound",
"isActive": true,
"languageId": "a3b9e2d4-6c1f-4e8a-9d72-1b5c8f3e0a46",
"voiceId": "e7d1c5b2-4a8f-4396-b0e2-7c9a1d3f5b68",
"voice": {
"id": "e7d1c5b2-4a8f-4396-b0e2-7c9a1d3f5b68",
"name": "Salma",
"gender": "female",
"language": {
"id": "a3b9e2d4-6c1f-4e8a-9d72-1b5c8f3e0a46",
"name": "Arabic - Egyptian",
"code": "ar-EG"
}
},
"createdAt": "2026-08-12T09:31:04.112Z",
"updatedAt": "2026-09-20T14:02:51.870Z"
}
}{
"statusCode": 404,
"errorCode": "agent_not_found",
"message": "Agent not found"
}{
"statusCode": 404,
"errorCode": "agent_not_found",
"message": "Agent not found"
}{
"statusCode": 404,
"errorCode": "agent_not_found",
"message": "Agent not found"
}{
"statusCode": 422,
"message": [
"name must be shorter than or equal to 100 characters"
],
"error": "Unprocessable Entity"
}Anything you leave out stays as it is. Sending
"description": null clears the description.
Common causes of a 422 validation error:
nameis empty or longer than 100 characters.descriptionis empty or longer than 5,000 characters.
400 can also mean the agent’s current voice setup is no longer valid, so any update is refused. Fix the agent’s voice in the Dashboard, then retry. See Errors.Authorizations
Path Parameters
The agent's id.
Body
application/json
The agent's display name. Surrounding spaces are trimmed.
Required string length:
1 - 100Example:
"Admissions Assistant (Cairo)"
A short description of what the agent does. Surrounding spaces are trimmed. Send null to clear it.
Required string length:
1 - 5000Example:
"Answers questions about enrollment and fees."