curl --request PATCH \
--url https://{appid}.api-{region}.cometchat.io/v3/ai-agents/agents/{uid} \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"name": "<string>",
"icon": "<string>",
"isActive": true,
"integrateWith": "mastra",
"integrationType": "agent",
"integrationMeta": {
"baseUrl": "https://my-mastra-app.example.com",
"agentId": "weatherAgent"
},
"tools": [
"<string>"
],
"actions": [
"<string>"
],
"metaData": {
"greetingMessage": "<string>",
"introductoryMessage": "<string>",
"suggestedMessages": [
"<string>"
]
}
}
'import requests
url = "https://{appid}.api-{region}.cometchat.io/v3/ai-agents/agents/{uid}"
payload = {
"name": "<string>",
"icon": "<string>",
"isActive": True,
"integrateWith": "mastra",
"integrationType": "agent",
"integrationMeta": {
"baseUrl": "https://my-mastra-app.example.com",
"agentId": "weatherAgent"
},
"tools": ["<string>"],
"actions": ["<string>"],
"metaData": {
"greetingMessage": "<string>",
"introductoryMessage": "<string>",
"suggestedMessages": ["<string>"]
}
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
icon: '<string>',
isActive: true,
integrateWith: 'mastra',
integrationType: 'agent',
integrationMeta: {baseUrl: 'https://my-mastra-app.example.com', agentId: 'weatherAgent'},
tools: ['<string>'],
actions: ['<string>'],
metaData: {
greetingMessage: '<string>',
introductoryMessage: '<string>',
suggestedMessages: ['<string>']
}
})
};
fetch('https://{appid}.api-{region}.cometchat.io/v3/ai-agents/agents/{uid}', 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://{appid}.api-{region}.cometchat.io/v3/ai-agents/agents/{uid}",
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>',
'icon' => '<string>',
'isActive' => true,
'integrateWith' => 'mastra',
'integrationType' => 'agent',
'integrationMeta' => [
'baseUrl' => 'https://my-mastra-app.example.com',
'agentId' => 'weatherAgent'
],
'tools' => [
'<string>'
],
'actions' => [
'<string>'
],
'metaData' => [
'greetingMessage' => '<string>',
'introductoryMessage' => '<string>',
'suggestedMessages' => [
'<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <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://{appid}.api-{region}.cometchat.io/v3/ai-agents/agents/{uid}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"icon\": \"<string>\",\n \"isActive\": true,\n \"integrateWith\": \"mastra\",\n \"integrationType\": \"agent\",\n \"integrationMeta\": {\n \"baseUrl\": \"https://my-mastra-app.example.com\",\n \"agentId\": \"weatherAgent\"\n },\n \"tools\": [\n \"<string>\"\n ],\n \"actions\": [\n \"<string>\"\n ],\n \"metaData\": {\n \"greetingMessage\": \"<string>\",\n \"introductoryMessage\": \"<string>\",\n \"suggestedMessages\": [\n \"<string>\"\n ]\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("apikey", "<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://{appid}.api-{region}.cometchat.io/v3/ai-agents/agents/{uid}")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"icon\": \"<string>\",\n \"isActive\": true,\n \"integrateWith\": \"mastra\",\n \"integrationType\": \"agent\",\n \"integrationMeta\": {\n \"baseUrl\": \"https://my-mastra-app.example.com\",\n \"agentId\": \"weatherAgent\"\n },\n \"tools\": [\n \"<string>\"\n ],\n \"actions\": [\n \"<string>\"\n ],\n \"metaData\": {\n \"greetingMessage\": \"<string>\",\n \"introductoryMessage\": \"<string>\",\n \"suggestedMessages\": [\n \"<string>\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{appid}.api-{region}.cometchat.io/v3/ai-agents/agents/{uid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"icon\": \"<string>\",\n \"isActive\": true,\n \"integrateWith\": \"mastra\",\n \"integrationType\": \"agent\",\n \"integrationMeta\": {\n \"baseUrl\": \"https://my-mastra-app.example.com\",\n \"agentId\": \"weatherAgent\"\n },\n \"tools\": [\n \"<string>\"\n ],\n \"actions\": [\n \"<string>\"\n ],\n \"metaData\": {\n \"greetingMessage\": \"<string>\",\n \"introductoryMessage\": \"<string>\",\n \"suggestedMessages\": [\n \"<string>\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true
}Update BYO Agent
Updates an existing BYO Agent by its UID. Use this endpoint to modify agent configuration, update referenced tools, or change the connected AI framework.
Validation: Referenced tools and actions are validated if provided.
curl --request PATCH \
--url https://{appid}.api-{region}.cometchat.io/v3/ai-agents/agents/{uid} \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"name": "<string>",
"icon": "<string>",
"isActive": true,
"integrateWith": "mastra",
"integrationType": "agent",
"integrationMeta": {
"baseUrl": "https://my-mastra-app.example.com",
"agentId": "weatherAgent"
},
"tools": [
"<string>"
],
"actions": [
"<string>"
],
"metaData": {
"greetingMessage": "<string>",
"introductoryMessage": "<string>",
"suggestedMessages": [
"<string>"
]
}
}
'import requests
url = "https://{appid}.api-{region}.cometchat.io/v3/ai-agents/agents/{uid}"
payload = {
"name": "<string>",
"icon": "<string>",
"isActive": True,
"integrateWith": "mastra",
"integrationType": "agent",
"integrationMeta": {
"baseUrl": "https://my-mastra-app.example.com",
"agentId": "weatherAgent"
},
"tools": ["<string>"],
"actions": ["<string>"],
"metaData": {
"greetingMessage": "<string>",
"introductoryMessage": "<string>",
"suggestedMessages": ["<string>"]
}
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
icon: '<string>',
isActive: true,
integrateWith: 'mastra',
integrationType: 'agent',
integrationMeta: {baseUrl: 'https://my-mastra-app.example.com', agentId: 'weatherAgent'},
tools: ['<string>'],
actions: ['<string>'],
metaData: {
greetingMessage: '<string>',
introductoryMessage: '<string>',
suggestedMessages: ['<string>']
}
})
};
fetch('https://{appid}.api-{region}.cometchat.io/v3/ai-agents/agents/{uid}', 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://{appid}.api-{region}.cometchat.io/v3/ai-agents/agents/{uid}",
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>',
'icon' => '<string>',
'isActive' => true,
'integrateWith' => 'mastra',
'integrationType' => 'agent',
'integrationMeta' => [
'baseUrl' => 'https://my-mastra-app.example.com',
'agentId' => 'weatherAgent'
],
'tools' => [
'<string>'
],
'actions' => [
'<string>'
],
'metaData' => [
'greetingMessage' => '<string>',
'introductoryMessage' => '<string>',
'suggestedMessages' => [
'<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <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://{appid}.api-{region}.cometchat.io/v3/ai-agents/agents/{uid}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"icon\": \"<string>\",\n \"isActive\": true,\n \"integrateWith\": \"mastra\",\n \"integrationType\": \"agent\",\n \"integrationMeta\": {\n \"baseUrl\": \"https://my-mastra-app.example.com\",\n \"agentId\": \"weatherAgent\"\n },\n \"tools\": [\n \"<string>\"\n ],\n \"actions\": [\n \"<string>\"\n ],\n \"metaData\": {\n \"greetingMessage\": \"<string>\",\n \"introductoryMessage\": \"<string>\",\n \"suggestedMessages\": [\n \"<string>\"\n ]\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("apikey", "<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://{appid}.api-{region}.cometchat.io/v3/ai-agents/agents/{uid}")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"icon\": \"<string>\",\n \"isActive\": true,\n \"integrateWith\": \"mastra\",\n \"integrationType\": \"agent\",\n \"integrationMeta\": {\n \"baseUrl\": \"https://my-mastra-app.example.com\",\n \"agentId\": \"weatherAgent\"\n },\n \"tools\": [\n \"<string>\"\n ],\n \"actions\": [\n \"<string>\"\n ],\n \"metaData\": {\n \"greetingMessage\": \"<string>\",\n \"introductoryMessage\": \"<string>\",\n \"suggestedMessages\": [\n \"<string>\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{appid}.api-{region}.cometchat.io/v3/ai-agents/agents/{uid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"icon\": \"<string>\",\n \"isActive\": true,\n \"integrateWith\": \"mastra\",\n \"integrationType\": \"agent\",\n \"integrationMeta\": {\n \"baseUrl\": \"https://my-mastra-app.example.com\",\n \"agentId\": \"weatherAgent\"\n },\n \"tools\": [\n \"<string>\"\n ],\n \"actions\": [\n \"<string>\"\n ],\n \"metaData\": {\n \"greetingMessage\": \"<string>\",\n \"introductoryMessage\": \"<string>\",\n \"suggestedMessages\": [\n \"<string>\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true
}Authorizations
API Key (i.e. Rest API Key from the Dashboard).
Headers
Chat API version. Defaults to v3.0.
Path Parameters
Unique identifier of the agent
Body
- Mastra
- Mastra (Legacy)
- LangGraph
- CrewAI
- Vercel AI V5
- AG2
- Rasa
- Agno
- AG-UI
Name of the agent
URL to the icon/avatar of the agent
Whether the agent is active
Integration platform identifier
mastra Type of connection
agent Mastra-specific configuration
Show child attributes
Show child attributes
List of tool names (must exist in the app's tools)
List of action names (must exist in the app's actions)
Metadata for the agent
Show child attributes
Show child attributes
Response
Agent updated successfully
Indicates whether the operation was successful
true
Was this page helpful?