Agents
Get an agent by ID
Returns an agent’s details by ID.
GET
/
agents
/
{id}
Get an agent by ID
curl --request GET \
--url https://api-trial.cognigy.ai/v1/agents/{id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api-trial.cognigy.ai/v1/agents/{id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api-trial.cognigy.ai/v1/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-trial.cognigy.ai/v1/agents/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api-trial.cognigy.ai/v1/agents/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-trial.cognigy.ai/v1/agents/{id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-trial.cognigy.ai/v1/agents/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"agentType": "voice",
"createdAt": 123,
"createdBy": "507f1f77bcf86cd799439011",
"description": "<string>",
"disabledToolReferenceIds": [
"<string>"
],
"guardrails": {
"dataPrivacy": {
"contactProfilesOption": "completeProfile",
"selectedProfileFields": [
"<string>"
]
},
"safetySettings": {
"avoidCopyrightInfringements": true,
"avoidHarmfulContent": true,
"avoidUngroundedContent": true,
"preventJailbreakAndManipulation": true
}
},
"hooks": {
"preTurn": [
{
"handler": {
"flowReferenceId": "<string>",
"kind": "<string>"
}
}
]
},
"id": "507f1f77bcf86cd799439011",
"image": "<string>",
"imageOptimizedFormat": true,
"instructions": "<string>",
"knowledge": {
"cognigyParameters": {
"language": "<string>",
"stores": [
"<string>"
],
"topK": 123
},
"context": "<string>",
"onSearchFailure": "<string>",
"ragMode": "<string>",
"ragType": "<string>"
},
"largeLanguageModelReferenceId": "<string>",
"lastChangedAt": 123,
"lastChangedBy": "507f1f77bcf86cd799439011",
"llmConfig": {
"maxOutputTokens": 123,
"reasoningEffort": "<string>",
"temperature": 123
},
"localeReferenceId": "<string>",
"name": "<string>",
"organisationId": "507f1f77bcf86cd799439011",
"personaReferenceId": "<string>",
"projectId": "507f1f77bcf86cd799439011",
"realtimeVoice": "<string>",
"referenceId": "<string>",
"role": "<string>",
"skillReferenceIds": [
"<string>"
],
"toolReferenceIds": [
"<string>"
],
"voiceDelegationTurns": 123,
"voiceLargeLanguageModelReferenceId": "<string>",
"voicePromptTemplate": "<string>"
}{
"code": "reserved_tool_name",
"detail": "request body validation failed",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
],
"instance": "/v1/{resource}",
"status": 400,
"title": "Bad Request",
"traceId": "api--a4d2f126-bec4-4544-a049-7c0cf08524ed",
"type": "about:blank"
}{
"detail": "access denied: insufficient permissions",
"instance": "/v1/{resource}/{id}",
"status": 403,
"title": "Forbidden",
"traceId": "api--a4d2f126-bec4-4544-a049-7c0cf08524ed",
"type": "about:blank"
}{
"detail": "the requested resource does not exist",
"instance": "/v1/{resource}/{id}",
"status": 404,
"title": "Not Found",
"traceId": "api--a4d2f126-bec4-4544-a049-7c0cf08524ed",
"type": "about:blank"
}{
"detail": "internal server error",
"instance": "/v1/{resource}",
"status": 500,
"title": "Internal Server Error",
"traceId": "api--a4d2f126-bec4-4544-a049-7c0cf08524ed",
"type": "about:blank"
}Response
Returns the agent.
The modality that the agent was authored for: text or voice. The
configuration UI uses it to decide which sections to show. The runtime
doesn't use it and takes the modality from the channel of each turn. An
agent that was stored without a type returns text.
Available options:
text, voice Example:
"voice"
⌘I
Get an agent by ID
curl --request GET \
--url https://api-trial.cognigy.ai/v1/agents/{id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api-trial.cognigy.ai/v1/agents/{id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api-trial.cognigy.ai/v1/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-trial.cognigy.ai/v1/agents/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api-trial.cognigy.ai/v1/agents/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-trial.cognigy.ai/v1/agents/{id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-trial.cognigy.ai/v1/agents/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"agentType": "voice",
"createdAt": 123,
"createdBy": "507f1f77bcf86cd799439011",
"description": "<string>",
"disabledToolReferenceIds": [
"<string>"
],
"guardrails": {
"dataPrivacy": {
"contactProfilesOption": "completeProfile",
"selectedProfileFields": [
"<string>"
]
},
"safetySettings": {
"avoidCopyrightInfringements": true,
"avoidHarmfulContent": true,
"avoidUngroundedContent": true,
"preventJailbreakAndManipulation": true
}
},
"hooks": {
"preTurn": [
{
"handler": {
"flowReferenceId": "<string>",
"kind": "<string>"
}
}
]
},
"id": "507f1f77bcf86cd799439011",
"image": "<string>",
"imageOptimizedFormat": true,
"instructions": "<string>",
"knowledge": {
"cognigyParameters": {
"language": "<string>",
"stores": [
"<string>"
],
"topK": 123
},
"context": "<string>",
"onSearchFailure": "<string>",
"ragMode": "<string>",
"ragType": "<string>"
},
"largeLanguageModelReferenceId": "<string>",
"lastChangedAt": 123,
"lastChangedBy": "507f1f77bcf86cd799439011",
"llmConfig": {
"maxOutputTokens": 123,
"reasoningEffort": "<string>",
"temperature": 123
},
"localeReferenceId": "<string>",
"name": "<string>",
"organisationId": "507f1f77bcf86cd799439011",
"personaReferenceId": "<string>",
"projectId": "507f1f77bcf86cd799439011",
"realtimeVoice": "<string>",
"referenceId": "<string>",
"role": "<string>",
"skillReferenceIds": [
"<string>"
],
"toolReferenceIds": [
"<string>"
],
"voiceDelegationTurns": 123,
"voiceLargeLanguageModelReferenceId": "<string>",
"voicePromptTemplate": "<string>"
}{
"code": "reserved_tool_name",
"detail": "request body validation failed",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
],
"instance": "/v1/{resource}",
"status": 400,
"title": "Bad Request",
"traceId": "api--a4d2f126-bec4-4544-a049-7c0cf08524ed",
"type": "about:blank"
}{
"detail": "access denied: insufficient permissions",
"instance": "/v1/{resource}/{id}",
"status": 403,
"title": "Forbidden",
"traceId": "api--a4d2f126-bec4-4544-a049-7c0cf08524ed",
"type": "about:blank"
}{
"detail": "the requested resource does not exist",
"instance": "/v1/{resource}/{id}",
"status": 404,
"title": "Not Found",
"traceId": "api--a4d2f126-bec4-4544-a049-7c0cf08524ed",
"type": "about:blank"
}{
"detail": "internal server error",
"instance": "/v1/{resource}",
"status": 500,
"title": "Internal Server Error",
"traceId": "api--a4d2f126-bec4-4544-a049-7c0cf08524ed",
"type": "about:blank"
}