Agents API
Retrieve available AI agent types for your organization.
The Agents API provides access to the available AI agent types that can be used for customer interactions, support, and automation within your organization.
Agent Type Object
An agent type represents a configuration template for AI agents with the following structure:
{
"id": "agent_type_123",
"name": "Customer Support Agent",
"description": "AI agent specialized in customer support inquiries",
"capabilities": ["chat", "voice", "email"],
"createdAt": "2025-01-15T10:30:00.000Z",
"updatedAt": "2025-01-15T10:30:00.000Z"
}Attributes
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the agent type |
name | string | Display name of the agent type |
description | string | Detailed description of the agent's purpose |
capabilities | array | List of supported communication channels |
createdAt | string | ISO 8601 timestamp of creation |
updatedAt | string | ISO 8601 timestamp of last update |
List All Agent Types
Retrieve a list of all available AI agent types for your organization.
GET /api/agentsHeaders
| Header | Required | Description |
|---|---|---|
X-API-Key | Yes | Your API key for authentication |
Content-Type | Yes | Must be application/json |
Response
Status Code: 200 OK
[
{
"id": "agent_type_support",
"name": "Customer Support Agent",
"description": "Handles customer inquiries and support tickets",
"capabilities": ["chat", "voice", "email"],
"createdAt": "2025-01-15T10:30:00.000Z",
"updatedAt": "2025-01-15T10:30:00.000Z"
},
{
"id": "agent_type_sales",
"name": "Sales Agent",
"description": "Assists with product recommendations and sales",
"capabilities": ["chat", "voice"],
"createdAt": "2025-01-16T14:20:00.000Z",
"updatedAt": "2025-01-16T14:20:00.000Z"
}
]Example Request
curl -X GET "https://api.evon.com/api/agents" \
-H "X-API-Key: your_api_key_here" \
-H "Content-Type: application/json"Example Response (Empty)
If no agent types are configured, the endpoint returns an empty array:
[]Error Responses
401 Unauthorized
Returned when the API key is missing or invalid.
{
"error": "Unauthorized",
"message": "Invalid or missing API key"
}500 Internal Server Error
Returned when a server error occurs.
{
"error": "Internal server error",
"message": "Failed to retrieve agent types"
}Use Cases
Dynamically Display Available Agents
Use this endpoint to populate a selection interface where users can choose which type of AI agent to interact with based on their needs.
async function getAvailableAgents() {
const response = await fetch('https://api.evon.com/api/agents', {
headers: {
'X-API-Key': 'your_api_key_here',
'Content-Type': 'application/json'
}
});
const agents = await response.json();
return agents;
}Filter by Capability
After retrieving agents, you can filter them based on required capabilities:
const agents = await getAvailableAgents();
const voiceAgents = agents.filter((agent) =>
agent.capabilities.includes('voice')
);