Sub-agents
Link a sub-agent (no PATCH afterwards — to change, unlink + re-link)
POST
/
public
/
api
/
v1
/
agents
/
{agentPublicId}
/
sub-agents
Link a sub-agent (no PATCH afterwards — to change, unlink + re-link)
curl --request POST \
--url https://api.gennia.ai/public/api/v1/agents/{agentPublicId}/sub-agents \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"subAgentPublicId": "9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21",
"aiModelPublicId": "1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d",
"description": "Handles billing-related questions and refunds.",
"sortOrder": 10
}
'import requests
url = "https://api.gennia.ai/public/api/v1/agents/{agentPublicId}/sub-agents"
payload = {
"subAgentPublicId": "9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21",
"aiModelPublicId": "1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d",
"description": "Handles billing-related questions and refunds.",
"sortOrder": 10
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subAgentPublicId: '9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21',
aiModelPublicId: '1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d',
description: 'Handles billing-related questions and refunds.',
sortOrder: 10
})
};
fetch('https://api.gennia.ai/public/api/v1/agents/{agentPublicId}/sub-agents', 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.gennia.ai/public/api/v1/agents/{agentPublicId}/sub-agents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'subAgentPublicId' => '9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21',
'aiModelPublicId' => '1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d',
'description' => 'Handles billing-related questions and refunds.',
'sortOrder' => 10
]),
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.gennia.ai/public/api/v1/agents/{agentPublicId}/sub-agents"
payload := strings.NewReader("{\n \"subAgentPublicId\": \"9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21\",\n \"aiModelPublicId\": \"1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d\",\n \"description\": \"Handles billing-related questions and refunds.\",\n \"sortOrder\": 10\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.gennia.ai/public/api/v1/agents/{agentPublicId}/sub-agents")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"subAgentPublicId\": \"9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21\",\n \"aiModelPublicId\": \"1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d\",\n \"description\": \"Handles billing-related questions and refunds.\",\n \"sortOrder\": 10\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gennia.ai/public/api/v1/agents/{agentPublicId}/sub-agents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subAgentPublicId\": \"9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21\",\n \"aiModelPublicId\": \"1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d\",\n \"description\": \"Handles billing-related questions and refunds.\",\n \"sortOrder\": 10\n}"
response = http.request(request)
puts response.read_body{
"aiModelName": "<string>",
"aiModelPublicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"sortOrder": 123,
"subAgentName": "<string>",
"subAgentPublicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"aiModelName": "<string>",
"aiModelPublicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"sortOrder": 123,
"subAgentName": "<string>",
"subAgentPublicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"aiModelName": "<string>",
"aiModelPublicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"sortOrder": 123,
"subAgentName": "<string>",
"subAgentPublicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"aiModelName": "<string>",
"aiModelPublicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"sortOrder": 123,
"subAgentName": "<string>",
"subAgentPublicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"aiModelName": "<string>",
"aiModelPublicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"sortOrder": 123,
"subAgentName": "<string>",
"subAgentPublicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"aiModelName": "<string>",
"aiModelPublicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"sortOrder": 123,
"subAgentName": "<string>",
"subAgentPublicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Autorizações
Parâmetros de caminho
Corpo
application/json
Body for linking an existing agent as a sub-agent of another agent.
Public ID of the agent to be linked as a sub-agent.
Exemplo:
"9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21"
Optional AI model override for this sub-agent invocation.
Exemplo:
"1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d"
Description of when and how the parent should delegate to this sub-agent.
Required string length:
1 - 500Exemplo:
"Handles billing-related questions and refunds."
Sort order of this sub-agent in the parent's sub-agent list.
Exemplo:
10
Esta página foi útil?
⌘I
Link a sub-agent (no PATCH afterwards — to change, unlink + re-link)
curl --request POST \
--url https://api.gennia.ai/public/api/v1/agents/{agentPublicId}/sub-agents \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"subAgentPublicId": "9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21",
"aiModelPublicId": "1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d",
"description": "Handles billing-related questions and refunds.",
"sortOrder": 10
}
'import requests
url = "https://api.gennia.ai/public/api/v1/agents/{agentPublicId}/sub-agents"
payload = {
"subAgentPublicId": "9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21",
"aiModelPublicId": "1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d",
"description": "Handles billing-related questions and refunds.",
"sortOrder": 10
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subAgentPublicId: '9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21',
aiModelPublicId: '1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d',
description: 'Handles billing-related questions and refunds.',
sortOrder: 10
})
};
fetch('https://api.gennia.ai/public/api/v1/agents/{agentPublicId}/sub-agents', 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.gennia.ai/public/api/v1/agents/{agentPublicId}/sub-agents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'subAgentPublicId' => '9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21',
'aiModelPublicId' => '1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d',
'description' => 'Handles billing-related questions and refunds.',
'sortOrder' => 10
]),
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.gennia.ai/public/api/v1/agents/{agentPublicId}/sub-agents"
payload := strings.NewReader("{\n \"subAgentPublicId\": \"9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21\",\n \"aiModelPublicId\": \"1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d\",\n \"description\": \"Handles billing-related questions and refunds.\",\n \"sortOrder\": 10\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.gennia.ai/public/api/v1/agents/{agentPublicId}/sub-agents")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"subAgentPublicId\": \"9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21\",\n \"aiModelPublicId\": \"1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d\",\n \"description\": \"Handles billing-related questions and refunds.\",\n \"sortOrder\": 10\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gennia.ai/public/api/v1/agents/{agentPublicId}/sub-agents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subAgentPublicId\": \"9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21\",\n \"aiModelPublicId\": \"1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d\",\n \"description\": \"Handles billing-related questions and refunds.\",\n \"sortOrder\": 10\n}"
response = http.request(request)
puts response.read_body{
"aiModelName": "<string>",
"aiModelPublicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"sortOrder": 123,
"subAgentName": "<string>",
"subAgentPublicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"aiModelName": "<string>",
"aiModelPublicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"sortOrder": 123,
"subAgentName": "<string>",
"subAgentPublicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"aiModelName": "<string>",
"aiModelPublicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"sortOrder": 123,
"subAgentName": "<string>",
"subAgentPublicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"aiModelName": "<string>",
"aiModelPublicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"sortOrder": 123,
"subAgentName": "<string>",
"subAgentPublicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"aiModelName": "<string>",
"aiModelPublicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"sortOrder": 123,
"subAgentName": "<string>",
"subAgentPublicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"aiModelName": "<string>",
"aiModelPublicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"sortOrder": 123,
"subAgentName": "<string>",
"subAgentPublicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
