Update BYO Agent
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
}BYO Agents
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
PATCH
/
ai-agents
/
agents
/
{uid}
Update BYO Agent
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
}For the complete error reference, see Error Guide.
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
application/json
- 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
Available options:
mastra Type of connection
Available options:
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
200 - application/json
Agent updated successfully
Indicates whether the operation was successful
Example:
true
Was this page helpful?
⌘I