cURL
curl --request GET \ --url https://api.example.com/agents
{ "success": true, "data": [ { "data[].agentId": "<string>", "data[].name": "<string>", "data[].status": "<string>", "data[].bio": "<string>", "data[].enabled": true, "data[].createdAt": 123, "data[].updatedAt": 123 } ] }
Retrieve all agents in your elizaOS deployment
GET /agents
active
inactive
curl -X GET http://localhost:3000/agents \ -H "Content-Type: application/json"
curl -X GET http://localhost:3000/agents \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json"
curl -X GET "http://localhost:3000/agents?status=active" \ -H "Content-Type: application/json"
curl -X GET "http://localhost:3000/agents?offset=0&limit=10" \ -H "Content-Type: application/json"
{ "success": true, "data": [ { "agentId": "550e8400-e29b-41d4-a716-446655440000", "name": "Alice", "status": "active", "bio": "A helpful AI assistant specializing in customer support", "enabled": true, "createdAt": 1709510400000, "updatedAt": 1709596800000 }, { "agentId": "660e8400-e29b-41d4-a716-446655440001", "name": "Bob", "status": "inactive", "bio": "A technical expert focused on software development", "enabled": false, "createdAt": 1709424000000, "updatedAt": 1709510400000 } ] }
const response = await fetch('http://localhost:3000/agents', { method: 'GET', headers: { 'Content-Type': 'application/json' } }); const { success, data } = await response.json(); if (success) { console.log(`Found ${data.length} agents`); data.forEach(agent => { console.log(`- ${agent.name} (${agent.status})`); }); }
import requests response = requests.get('http://localhost:3000/agents') data = response.json() if data['success']: print(f"Found {len(data['data'])} agents") for agent in data['data']: print(f"- {agent['name']} ({agent['status']})")
interface Agent { agentId: string; name: string; status: 'active' | 'inactive'; bio?: string; enabled?: boolean; createdAt?: number; updatedAt?: number; } interface ListAgentsResponse { success: boolean; data: Agent[]; } const response = await fetch('http://localhost:3000/agents'); const { success, data }: ListAgentsResponse = await response.json(); if (success) { console.log(`Found ${data.length} agents`); }
{ "success": false, "error": "Agent service not available" }
{ "success": false, "error": "Failed to retrieve agents" }