Docs
Agents API

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

FieldTypeDescription
idstringUnique identifier for the agent type
namestringDisplay name of the agent type
descriptionstringDetailed description of the agent's purpose
capabilitiesarrayList of supported communication channels
createdAtstringISO 8601 timestamp of creation
updatedAtstringISO 8601 timestamp of last update

List All Agent Types

Retrieve a list of all available AI agent types for your organization.

GET /api/agents

Headers

HeaderRequiredDescription
X-API-KeyYesYour API key for authentication
Content-TypeYesMust 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')
);