Create Agent Endpoint
curl --request POST \
--url https://agent-prod.studio.lyzr.ai/v3/agents/ \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "Customer Support Agent",
"description": "Handles level 1 customer inquiries.",
"agent_role": "<string>",
"agent_instructions": "<string>",
"agent_goal": "<string>",
"agent_context": "<string>",
"agent_output": "<string>",
"examples": "<string>",
"features": [
"<string>"
],
"tools": [
"<string>"
],
"tool_usage_description": "<string>",
"llm_credential_id": "<string>",
"response_format": {},
"provider_id": "openai",
"model": "gpt-4o",
"top_p": 1,
"temperature": 0.7,
"managed_agents": [
{
"id": "<string>",
"name": "<string>",
"usage_description": "<string>"
}
],
"tool_configs": [
{
"tool_name": "<string>",
"tool_source": "<string>",
"action_names": [
"<string>"
],
"persist_auth": false,
"server_id": "<string>",
"provider_uuid": "<string>",
"credential_id": "<string>"
}
],
"store_messages": true,
"file_output": false,
"a2a_tools": [
{
"base_url": "<string>"
}
],
"voice_config": {},
"additional_model_params": {},
"image_output_config": {
"model": "<string>",
"credential_id": "<string>"
},
"max_iterations": 25,
"git_agent": {
"enabled": false,
"repo_name": "<string>",
"branch": "main",
"environments": [
"<string>"
],
"branches": [
"<string>"
],
"reviewers": [
"<string>"
],
"pat": "<string>",
"org": "<string>",
"provider": "github",
"repo_url": "<string>",
"repo_full_name": "<string>"
},
"proxy_config": {
"enabled": false,
"endpoint_url": "<string>",
"api_key": "<string>",
"system_prompt_captured": false,
"parameter_policies": {},
"passthrough_tools": true,
"passthrough_tool_choice": true,
"passthrough_response_format": true
}
}
'import requests
url = "https://agent-prod.studio.lyzr.ai/v3/agents/"
payload = {
"name": "Customer Support Agent",
"description": "Handles level 1 customer inquiries.",
"agent_role": "<string>",
"agent_instructions": "<string>",
"agent_goal": "<string>",
"agent_context": "<string>",
"agent_output": "<string>",
"examples": "<string>",
"features": ["<string>"],
"tools": ["<string>"],
"tool_usage_description": "<string>",
"llm_credential_id": "<string>",
"response_format": {},
"provider_id": "openai",
"model": "gpt-4o",
"top_p": 1,
"temperature": 0.7,
"managed_agents": [
{
"id": "<string>",
"name": "<string>",
"usage_description": "<string>"
}
],
"tool_configs": [
{
"tool_name": "<string>",
"tool_source": "<string>",
"action_names": ["<string>"],
"persist_auth": False,
"server_id": "<string>",
"provider_uuid": "<string>",
"credential_id": "<string>"
}
],
"store_messages": True,
"file_output": False,
"a2a_tools": [{ "base_url": "<string>" }],
"voice_config": {},
"additional_model_params": {},
"image_output_config": {
"model": "<string>",
"credential_id": "<string>"
},
"max_iterations": 25,
"git_agent": {
"enabled": False,
"repo_name": "<string>",
"branch": "main",
"environments": ["<string>"],
"branches": ["<string>"],
"reviewers": ["<string>"],
"pat": "<string>",
"org": "<string>",
"provider": "github",
"repo_url": "<string>",
"repo_full_name": "<string>"
},
"proxy_config": {
"enabled": False,
"endpoint_url": "<string>",
"api_key": "<string>",
"system_prompt_captured": False,
"parameter_policies": {},
"passthrough_tools": True,
"passthrough_tool_choice": True,
"passthrough_response_format": True
}
}
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({
name: 'Customer Support Agent',
description: 'Handles level 1 customer inquiries.',
agent_role: '<string>',
agent_instructions: '<string>',
agent_goal: '<string>',
agent_context: '<string>',
agent_output: '<string>',
examples: '<string>',
features: ['<string>'],
tools: ['<string>'],
tool_usage_description: '<string>',
llm_credential_id: '<string>',
response_format: {},
provider_id: 'openai',
model: 'gpt-4o',
top_p: 1,
temperature: 0.7,
managed_agents: [{id: '<string>', name: '<string>', usage_description: '<string>'}],
tool_configs: [
{
tool_name: '<string>',
tool_source: '<string>',
action_names: ['<string>'],
persist_auth: false,
server_id: '<string>',
provider_uuid: '<string>',
credential_id: '<string>'
}
],
store_messages: true,
file_output: false,
a2a_tools: [{base_url: '<string>'}],
voice_config: {},
additional_model_params: {},
image_output_config: {model: '<string>', credential_id: '<string>'},
max_iterations: 25,
git_agent: {
enabled: false,
repo_name: '<string>',
branch: 'main',
environments: ['<string>'],
branches: ['<string>'],
reviewers: ['<string>'],
pat: '<string>',
org: '<string>',
provider: 'github',
repo_url: '<string>',
repo_full_name: '<string>'
},
proxy_config: {
enabled: false,
endpoint_url: '<string>',
api_key: '<string>',
system_prompt_captured: false,
parameter_policies: {},
passthrough_tools: true,
passthrough_tool_choice: true,
passthrough_response_format: true
}
})
};
fetch('https://agent-prod.studio.lyzr.ai/v3/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://agent-prod.studio.lyzr.ai/v3/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([
'name' => 'Customer Support Agent',
'description' => 'Handles level 1 customer inquiries.',
'agent_role' => '<string>',
'agent_instructions' => '<string>',
'agent_goal' => '<string>',
'agent_context' => '<string>',
'agent_output' => '<string>',
'examples' => '<string>',
'features' => [
'<string>'
],
'tools' => [
'<string>'
],
'tool_usage_description' => '<string>',
'llm_credential_id' => '<string>',
'response_format' => [
],
'provider_id' => 'openai',
'model' => 'gpt-4o',
'top_p' => 1,
'temperature' => 0.7,
'managed_agents' => [
[
'id' => '<string>',
'name' => '<string>',
'usage_description' => '<string>'
]
],
'tool_configs' => [
[
'tool_name' => '<string>',
'tool_source' => '<string>',
'action_names' => [
'<string>'
],
'persist_auth' => false,
'server_id' => '<string>',
'provider_uuid' => '<string>',
'credential_id' => '<string>'
]
],
'store_messages' => true,
'file_output' => false,
'a2a_tools' => [
[
'base_url' => '<string>'
]
],
'voice_config' => [
],
'additional_model_params' => [
],
'image_output_config' => [
'model' => '<string>',
'credential_id' => '<string>'
],
'max_iterations' => 25,
'git_agent' => [
'enabled' => false,
'repo_name' => '<string>',
'branch' => 'main',
'environments' => [
'<string>'
],
'branches' => [
'<string>'
],
'reviewers' => [
'<string>'
],
'pat' => '<string>',
'org' => '<string>',
'provider' => 'github',
'repo_url' => '<string>',
'repo_full_name' => '<string>'
],
'proxy_config' => [
'enabled' => false,
'endpoint_url' => '<string>',
'api_key' => '<string>',
'system_prompt_captured' => false,
'parameter_policies' => [
],
'passthrough_tools' => true,
'passthrough_tool_choice' => true,
'passthrough_response_format' => true
]
]),
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://agent-prod.studio.lyzr.ai/v3/agents/"
payload := strings.NewReader("{\n \"name\": \"Customer Support Agent\",\n \"description\": \"Handles level 1 customer inquiries.\",\n \"agent_role\": \"<string>\",\n \"agent_instructions\": \"<string>\",\n \"agent_goal\": \"<string>\",\n \"agent_context\": \"<string>\",\n \"agent_output\": \"<string>\",\n \"examples\": \"<string>\",\n \"features\": [\n \"<string>\"\n ],\n \"tools\": [\n \"<string>\"\n ],\n \"tool_usage_description\": \"<string>\",\n \"llm_credential_id\": \"<string>\",\n \"response_format\": {},\n \"provider_id\": \"openai\",\n \"model\": \"gpt-4o\",\n \"top_p\": 1,\n \"temperature\": 0.7,\n \"managed_agents\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"usage_description\": \"<string>\"\n }\n ],\n \"tool_configs\": [\n {\n \"tool_name\": \"<string>\",\n \"tool_source\": \"<string>\",\n \"action_names\": [\n \"<string>\"\n ],\n \"persist_auth\": false,\n \"server_id\": \"<string>\",\n \"provider_uuid\": \"<string>\",\n \"credential_id\": \"<string>\"\n }\n ],\n \"store_messages\": true,\n \"file_output\": false,\n \"a2a_tools\": [\n {\n \"base_url\": \"<string>\"\n }\n ],\n \"voice_config\": {},\n \"additional_model_params\": {},\n \"image_output_config\": {\n \"model\": \"<string>\",\n \"credential_id\": \"<string>\"\n },\n \"max_iterations\": 25,\n \"git_agent\": {\n \"enabled\": false,\n \"repo_name\": \"<string>\",\n \"branch\": \"main\",\n \"environments\": [\n \"<string>\"\n ],\n \"branches\": [\n \"<string>\"\n ],\n \"reviewers\": [\n \"<string>\"\n ],\n \"pat\": \"<string>\",\n \"org\": \"<string>\",\n \"provider\": \"github\",\n \"repo_url\": \"<string>\",\n \"repo_full_name\": \"<string>\"\n },\n \"proxy_config\": {\n \"enabled\": false,\n \"endpoint_url\": \"<string>\",\n \"api_key\": \"<string>\",\n \"system_prompt_captured\": false,\n \"parameter_policies\": {},\n \"passthrough_tools\": true,\n \"passthrough_tool_choice\": true,\n \"passthrough_response_format\": true\n }\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://agent-prod.studio.lyzr.ai/v3/agents/")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Customer Support Agent\",\n \"description\": \"Handles level 1 customer inquiries.\",\n \"agent_role\": \"<string>\",\n \"agent_instructions\": \"<string>\",\n \"agent_goal\": \"<string>\",\n \"agent_context\": \"<string>\",\n \"agent_output\": \"<string>\",\n \"examples\": \"<string>\",\n \"features\": [\n \"<string>\"\n ],\n \"tools\": [\n \"<string>\"\n ],\n \"tool_usage_description\": \"<string>\",\n \"llm_credential_id\": \"<string>\",\n \"response_format\": {},\n \"provider_id\": \"openai\",\n \"model\": \"gpt-4o\",\n \"top_p\": 1,\n \"temperature\": 0.7,\n \"managed_agents\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"usage_description\": \"<string>\"\n }\n ],\n \"tool_configs\": [\n {\n \"tool_name\": \"<string>\",\n \"tool_source\": \"<string>\",\n \"action_names\": [\n \"<string>\"\n ],\n \"persist_auth\": false,\n \"server_id\": \"<string>\",\n \"provider_uuid\": \"<string>\",\n \"credential_id\": \"<string>\"\n }\n ],\n \"store_messages\": true,\n \"file_output\": false,\n \"a2a_tools\": [\n {\n \"base_url\": \"<string>\"\n }\n ],\n \"voice_config\": {},\n \"additional_model_params\": {},\n \"image_output_config\": {\n \"model\": \"<string>\",\n \"credential_id\": \"<string>\"\n },\n \"max_iterations\": 25,\n \"git_agent\": {\n \"enabled\": false,\n \"repo_name\": \"<string>\",\n \"branch\": \"main\",\n \"environments\": [\n \"<string>\"\n ],\n \"branches\": [\n \"<string>\"\n ],\n \"reviewers\": [\n \"<string>\"\n ],\n \"pat\": \"<string>\",\n \"org\": \"<string>\",\n \"provider\": \"github\",\n \"repo_url\": \"<string>\",\n \"repo_full_name\": \"<string>\"\n },\n \"proxy_config\": {\n \"enabled\": false,\n \"endpoint_url\": \"<string>\",\n \"api_key\": \"<string>\",\n \"system_prompt_captured\": false,\n \"parameter_policies\": {},\n \"passthrough_tools\": true,\n \"passthrough_tool_choice\": true,\n \"passthrough_response_format\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agent-prod.studio.lyzr.ai/v3/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 \"name\": \"Customer Support Agent\",\n \"description\": \"Handles level 1 customer inquiries.\",\n \"agent_role\": \"<string>\",\n \"agent_instructions\": \"<string>\",\n \"agent_goal\": \"<string>\",\n \"agent_context\": \"<string>\",\n \"agent_output\": \"<string>\",\n \"examples\": \"<string>\",\n \"features\": [\n \"<string>\"\n ],\n \"tools\": [\n \"<string>\"\n ],\n \"tool_usage_description\": \"<string>\",\n \"llm_credential_id\": \"<string>\",\n \"response_format\": {},\n \"provider_id\": \"openai\",\n \"model\": \"gpt-4o\",\n \"top_p\": 1,\n \"temperature\": 0.7,\n \"managed_agents\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"usage_description\": \"<string>\"\n }\n ],\n \"tool_configs\": [\n {\n \"tool_name\": \"<string>\",\n \"tool_source\": \"<string>\",\n \"action_names\": [\n \"<string>\"\n ],\n \"persist_auth\": false,\n \"server_id\": \"<string>\",\n \"provider_uuid\": \"<string>\",\n \"credential_id\": \"<string>\"\n }\n ],\n \"store_messages\": true,\n \"file_output\": false,\n \"a2a_tools\": [\n {\n \"base_url\": \"<string>\"\n }\n ],\n \"voice_config\": {},\n \"additional_model_params\": {},\n \"image_output_config\": {\n \"model\": \"<string>\",\n \"credential_id\": \"<string>\"\n },\n \"max_iterations\": 25,\n \"git_agent\": {\n \"enabled\": false,\n \"repo_name\": \"<string>\",\n \"branch\": \"main\",\n \"environments\": [\n \"<string>\"\n ],\n \"branches\": [\n \"<string>\"\n ],\n \"reviewers\": [\n \"<string>\"\n ],\n \"pat\": \"<string>\",\n \"org\": \"<string>\",\n \"provider\": \"github\",\n \"repo_url\": \"<string>\",\n \"repo_full_name\": \"<string>\"\n },\n \"proxy_config\": {\n \"enabled\": false,\n \"endpoint_url\": \"<string>\",\n \"api_key\": \"<string>\",\n \"system_prompt_captured\": false,\n \"parameter_policies\": {},\n \"passthrough_tools\": true,\n \"passthrough_tool_choice\": true,\n \"passthrough_response_format\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"agent_id": "654b9d3d451c1aeefd800xyz"
}{
"detail": "API key missing"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Agents
Create Agent
Create a new agent by providing comprehensive configuration details. Returns the ID of the newly created agent.
POST
/
v3
/
agents
/
Create Agent Endpoint
curl --request POST \
--url https://agent-prod.studio.lyzr.ai/v3/agents/ \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "Customer Support Agent",
"description": "Handles level 1 customer inquiries.",
"agent_role": "<string>",
"agent_instructions": "<string>",
"agent_goal": "<string>",
"agent_context": "<string>",
"agent_output": "<string>",
"examples": "<string>",
"features": [
"<string>"
],
"tools": [
"<string>"
],
"tool_usage_description": "<string>",
"llm_credential_id": "<string>",
"response_format": {},
"provider_id": "openai",
"model": "gpt-4o",
"top_p": 1,
"temperature": 0.7,
"managed_agents": [
{
"id": "<string>",
"name": "<string>",
"usage_description": "<string>"
}
],
"tool_configs": [
{
"tool_name": "<string>",
"tool_source": "<string>",
"action_names": [
"<string>"
],
"persist_auth": false,
"server_id": "<string>",
"provider_uuid": "<string>",
"credential_id": "<string>"
}
],
"store_messages": true,
"file_output": false,
"a2a_tools": [
{
"base_url": "<string>"
}
],
"voice_config": {},
"additional_model_params": {},
"image_output_config": {
"model": "<string>",
"credential_id": "<string>"
},
"max_iterations": 25,
"git_agent": {
"enabled": false,
"repo_name": "<string>",
"branch": "main",
"environments": [
"<string>"
],
"branches": [
"<string>"
],
"reviewers": [
"<string>"
],
"pat": "<string>",
"org": "<string>",
"provider": "github",
"repo_url": "<string>",
"repo_full_name": "<string>"
},
"proxy_config": {
"enabled": false,
"endpoint_url": "<string>",
"api_key": "<string>",
"system_prompt_captured": false,
"parameter_policies": {},
"passthrough_tools": true,
"passthrough_tool_choice": true,
"passthrough_response_format": true
}
}
'import requests
url = "https://agent-prod.studio.lyzr.ai/v3/agents/"
payload = {
"name": "Customer Support Agent",
"description": "Handles level 1 customer inquiries.",
"agent_role": "<string>",
"agent_instructions": "<string>",
"agent_goal": "<string>",
"agent_context": "<string>",
"agent_output": "<string>",
"examples": "<string>",
"features": ["<string>"],
"tools": ["<string>"],
"tool_usage_description": "<string>",
"llm_credential_id": "<string>",
"response_format": {},
"provider_id": "openai",
"model": "gpt-4o",
"top_p": 1,
"temperature": 0.7,
"managed_agents": [
{
"id": "<string>",
"name": "<string>",
"usage_description": "<string>"
}
],
"tool_configs": [
{
"tool_name": "<string>",
"tool_source": "<string>",
"action_names": ["<string>"],
"persist_auth": False,
"server_id": "<string>",
"provider_uuid": "<string>",
"credential_id": "<string>"
}
],
"store_messages": True,
"file_output": False,
"a2a_tools": [{ "base_url": "<string>" }],
"voice_config": {},
"additional_model_params": {},
"image_output_config": {
"model": "<string>",
"credential_id": "<string>"
},
"max_iterations": 25,
"git_agent": {
"enabled": False,
"repo_name": "<string>",
"branch": "main",
"environments": ["<string>"],
"branches": ["<string>"],
"reviewers": ["<string>"],
"pat": "<string>",
"org": "<string>",
"provider": "github",
"repo_url": "<string>",
"repo_full_name": "<string>"
},
"proxy_config": {
"enabled": False,
"endpoint_url": "<string>",
"api_key": "<string>",
"system_prompt_captured": False,
"parameter_policies": {},
"passthrough_tools": True,
"passthrough_tool_choice": True,
"passthrough_response_format": True
}
}
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({
name: 'Customer Support Agent',
description: 'Handles level 1 customer inquiries.',
agent_role: '<string>',
agent_instructions: '<string>',
agent_goal: '<string>',
agent_context: '<string>',
agent_output: '<string>',
examples: '<string>',
features: ['<string>'],
tools: ['<string>'],
tool_usage_description: '<string>',
llm_credential_id: '<string>',
response_format: {},
provider_id: 'openai',
model: 'gpt-4o',
top_p: 1,
temperature: 0.7,
managed_agents: [{id: '<string>', name: '<string>', usage_description: '<string>'}],
tool_configs: [
{
tool_name: '<string>',
tool_source: '<string>',
action_names: ['<string>'],
persist_auth: false,
server_id: '<string>',
provider_uuid: '<string>',
credential_id: '<string>'
}
],
store_messages: true,
file_output: false,
a2a_tools: [{base_url: '<string>'}],
voice_config: {},
additional_model_params: {},
image_output_config: {model: '<string>', credential_id: '<string>'},
max_iterations: 25,
git_agent: {
enabled: false,
repo_name: '<string>',
branch: 'main',
environments: ['<string>'],
branches: ['<string>'],
reviewers: ['<string>'],
pat: '<string>',
org: '<string>',
provider: 'github',
repo_url: '<string>',
repo_full_name: '<string>'
},
proxy_config: {
enabled: false,
endpoint_url: '<string>',
api_key: '<string>',
system_prompt_captured: false,
parameter_policies: {},
passthrough_tools: true,
passthrough_tool_choice: true,
passthrough_response_format: true
}
})
};
fetch('https://agent-prod.studio.lyzr.ai/v3/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://agent-prod.studio.lyzr.ai/v3/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([
'name' => 'Customer Support Agent',
'description' => 'Handles level 1 customer inquiries.',
'agent_role' => '<string>',
'agent_instructions' => '<string>',
'agent_goal' => '<string>',
'agent_context' => '<string>',
'agent_output' => '<string>',
'examples' => '<string>',
'features' => [
'<string>'
],
'tools' => [
'<string>'
],
'tool_usage_description' => '<string>',
'llm_credential_id' => '<string>',
'response_format' => [
],
'provider_id' => 'openai',
'model' => 'gpt-4o',
'top_p' => 1,
'temperature' => 0.7,
'managed_agents' => [
[
'id' => '<string>',
'name' => '<string>',
'usage_description' => '<string>'
]
],
'tool_configs' => [
[
'tool_name' => '<string>',
'tool_source' => '<string>',
'action_names' => [
'<string>'
],
'persist_auth' => false,
'server_id' => '<string>',
'provider_uuid' => '<string>',
'credential_id' => '<string>'
]
],
'store_messages' => true,
'file_output' => false,
'a2a_tools' => [
[
'base_url' => '<string>'
]
],
'voice_config' => [
],
'additional_model_params' => [
],
'image_output_config' => [
'model' => '<string>',
'credential_id' => '<string>'
],
'max_iterations' => 25,
'git_agent' => [
'enabled' => false,
'repo_name' => '<string>',
'branch' => 'main',
'environments' => [
'<string>'
],
'branches' => [
'<string>'
],
'reviewers' => [
'<string>'
],
'pat' => '<string>',
'org' => '<string>',
'provider' => 'github',
'repo_url' => '<string>',
'repo_full_name' => '<string>'
],
'proxy_config' => [
'enabled' => false,
'endpoint_url' => '<string>',
'api_key' => '<string>',
'system_prompt_captured' => false,
'parameter_policies' => [
],
'passthrough_tools' => true,
'passthrough_tool_choice' => true,
'passthrough_response_format' => true
]
]),
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://agent-prod.studio.lyzr.ai/v3/agents/"
payload := strings.NewReader("{\n \"name\": \"Customer Support Agent\",\n \"description\": \"Handles level 1 customer inquiries.\",\n \"agent_role\": \"<string>\",\n \"agent_instructions\": \"<string>\",\n \"agent_goal\": \"<string>\",\n \"agent_context\": \"<string>\",\n \"agent_output\": \"<string>\",\n \"examples\": \"<string>\",\n \"features\": [\n \"<string>\"\n ],\n \"tools\": [\n \"<string>\"\n ],\n \"tool_usage_description\": \"<string>\",\n \"llm_credential_id\": \"<string>\",\n \"response_format\": {},\n \"provider_id\": \"openai\",\n \"model\": \"gpt-4o\",\n \"top_p\": 1,\n \"temperature\": 0.7,\n \"managed_agents\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"usage_description\": \"<string>\"\n }\n ],\n \"tool_configs\": [\n {\n \"tool_name\": \"<string>\",\n \"tool_source\": \"<string>\",\n \"action_names\": [\n \"<string>\"\n ],\n \"persist_auth\": false,\n \"server_id\": \"<string>\",\n \"provider_uuid\": \"<string>\",\n \"credential_id\": \"<string>\"\n }\n ],\n \"store_messages\": true,\n \"file_output\": false,\n \"a2a_tools\": [\n {\n \"base_url\": \"<string>\"\n }\n ],\n \"voice_config\": {},\n \"additional_model_params\": {},\n \"image_output_config\": {\n \"model\": \"<string>\",\n \"credential_id\": \"<string>\"\n },\n \"max_iterations\": 25,\n \"git_agent\": {\n \"enabled\": false,\n \"repo_name\": \"<string>\",\n \"branch\": \"main\",\n \"environments\": [\n \"<string>\"\n ],\n \"branches\": [\n \"<string>\"\n ],\n \"reviewers\": [\n \"<string>\"\n ],\n \"pat\": \"<string>\",\n \"org\": \"<string>\",\n \"provider\": \"github\",\n \"repo_url\": \"<string>\",\n \"repo_full_name\": \"<string>\"\n },\n \"proxy_config\": {\n \"enabled\": false,\n \"endpoint_url\": \"<string>\",\n \"api_key\": \"<string>\",\n \"system_prompt_captured\": false,\n \"parameter_policies\": {},\n \"passthrough_tools\": true,\n \"passthrough_tool_choice\": true,\n \"passthrough_response_format\": true\n }\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://agent-prod.studio.lyzr.ai/v3/agents/")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Customer Support Agent\",\n \"description\": \"Handles level 1 customer inquiries.\",\n \"agent_role\": \"<string>\",\n \"agent_instructions\": \"<string>\",\n \"agent_goal\": \"<string>\",\n \"agent_context\": \"<string>\",\n \"agent_output\": \"<string>\",\n \"examples\": \"<string>\",\n \"features\": [\n \"<string>\"\n ],\n \"tools\": [\n \"<string>\"\n ],\n \"tool_usage_description\": \"<string>\",\n \"llm_credential_id\": \"<string>\",\n \"response_format\": {},\n \"provider_id\": \"openai\",\n \"model\": \"gpt-4o\",\n \"top_p\": 1,\n \"temperature\": 0.7,\n \"managed_agents\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"usage_description\": \"<string>\"\n }\n ],\n \"tool_configs\": [\n {\n \"tool_name\": \"<string>\",\n \"tool_source\": \"<string>\",\n \"action_names\": [\n \"<string>\"\n ],\n \"persist_auth\": false,\n \"server_id\": \"<string>\",\n \"provider_uuid\": \"<string>\",\n \"credential_id\": \"<string>\"\n }\n ],\n \"store_messages\": true,\n \"file_output\": false,\n \"a2a_tools\": [\n {\n \"base_url\": \"<string>\"\n }\n ],\n \"voice_config\": {},\n \"additional_model_params\": {},\n \"image_output_config\": {\n \"model\": \"<string>\",\n \"credential_id\": \"<string>\"\n },\n \"max_iterations\": 25,\n \"git_agent\": {\n \"enabled\": false,\n \"repo_name\": \"<string>\",\n \"branch\": \"main\",\n \"environments\": [\n \"<string>\"\n ],\n \"branches\": [\n \"<string>\"\n ],\n \"reviewers\": [\n \"<string>\"\n ],\n \"pat\": \"<string>\",\n \"org\": \"<string>\",\n \"provider\": \"github\",\n \"repo_url\": \"<string>\",\n \"repo_full_name\": \"<string>\"\n },\n \"proxy_config\": {\n \"enabled\": false,\n \"endpoint_url\": \"<string>\",\n \"api_key\": \"<string>\",\n \"system_prompt_captured\": false,\n \"parameter_policies\": {},\n \"passthrough_tools\": true,\n \"passthrough_tool_choice\": true,\n \"passthrough_response_format\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agent-prod.studio.lyzr.ai/v3/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 \"name\": \"Customer Support Agent\",\n \"description\": \"Handles level 1 customer inquiries.\",\n \"agent_role\": \"<string>\",\n \"agent_instructions\": \"<string>\",\n \"agent_goal\": \"<string>\",\n \"agent_context\": \"<string>\",\n \"agent_output\": \"<string>\",\n \"examples\": \"<string>\",\n \"features\": [\n \"<string>\"\n ],\n \"tools\": [\n \"<string>\"\n ],\n \"tool_usage_description\": \"<string>\",\n \"llm_credential_id\": \"<string>\",\n \"response_format\": {},\n \"provider_id\": \"openai\",\n \"model\": \"gpt-4o\",\n \"top_p\": 1,\n \"temperature\": 0.7,\n \"managed_agents\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"usage_description\": \"<string>\"\n }\n ],\n \"tool_configs\": [\n {\n \"tool_name\": \"<string>\",\n \"tool_source\": \"<string>\",\n \"action_names\": [\n \"<string>\"\n ],\n \"persist_auth\": false,\n \"server_id\": \"<string>\",\n \"provider_uuid\": \"<string>\",\n \"credential_id\": \"<string>\"\n }\n ],\n \"store_messages\": true,\n \"file_output\": false,\n \"a2a_tools\": [\n {\n \"base_url\": \"<string>\"\n }\n ],\n \"voice_config\": {},\n \"additional_model_params\": {},\n \"image_output_config\": {\n \"model\": \"<string>\",\n \"credential_id\": \"<string>\"\n },\n \"max_iterations\": 25,\n \"git_agent\": {\n \"enabled\": false,\n \"repo_name\": \"<string>\",\n \"branch\": \"main\",\n \"environments\": [\n \"<string>\"\n ],\n \"branches\": [\n \"<string>\"\n ],\n \"reviewers\": [\n \"<string>\"\n ],\n \"pat\": \"<string>\",\n \"org\": \"<string>\",\n \"provider\": \"github\",\n \"repo_url\": \"<string>\",\n \"repo_full_name\": \"<string>\"\n },\n \"proxy_config\": {\n \"enabled\": false,\n \"endpoint_url\": \"<string>\",\n \"api_key\": \"<string>\",\n \"system_prompt_captured\": false,\n \"parameter_policies\": {},\n \"passthrough_tools\": true,\n \"passthrough_tool_choice\": true,\n \"passthrough_response_format\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"agent_id": "654b9d3d451c1aeefd800xyz"
}{
"detail": "API key missing"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Body
application/json
Example:
"Customer Support Agent"
Example:
"Handles level 1 customer inquiries."
Example:
"openai"
Example:
"gpt-4o"
Example:
1
Example:
0.7
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
Agent created successfully.
The unique identifier of the created agent.
Example:
"654b9d3d451c1aeefd800xyz"
⌘I