View Categories

Agents API

1 min read

Agents API #

List and retrieve information about your AI voice agents.

List All Agents #

Endpoint: GET /api/v1/agents

curl -X GET "https://app.voxpria.com/api/v1/agents" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response #

{
  "success": true,
  "data": [
    {
      "agentId": "agent_abc123",
      "name": "Customer Survey Agent",
      "description": "Conducts customer satisfaction surveys",
      "language": "en-US",
      "voice": "alloy",
      "status": "active",
      "createdAt": "2025-01-15T10:00:00Z"
    },
    {
      "agentId": "agent_def456",
      "name": "Appointment Reminder",
      "description": "Sends appointment reminders",
      "language": "en-US",
      "voice": "nova",
      "status": "active",
      "createdAt": "2025-01-20T14:30:00Z"
    }
  ]
}

Get Agent Details #

Endpoint: GET /api/v1/agents/:id

curl -X GET "https://app.voxpria.com/api/v1/agents/agent_abc123" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response #

{
  "success": true,
  "data": {
    "agentId": "agent_abc123",
    "name": "Customer Survey Agent",
    "description": "Conducts customer satisfaction surveys",
    "language": "en-US",
    "voice": "alloy",
    "status": "active",
    "configuration": {
      "greeting": "Hello! We'd love your feedback...",
      "questions": [...],
      "maxDuration": 300
    },
    "stats": {
      "totalCalls": 1250,
      "successRate": 87.5,
      "avgDuration": 145
    }
  }
}

Export Agent Flow #

Endpoint: GET /api/v1/agents/:id/flow

Export an agent’s conversation flow configuration:

curl -X GET "https://app.voxpria.com/api/v1/agents/agent_abc123/flow" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response #

{
  "success": true,
  "data": {
    "agentId": "agent_abc123",
    "flow": {
      "nodes": [...],
      "edges": [...],
      "version": "1.0"
    }
  }
}

Code Example #

JavaScript #

async function listAgents() {
  const response = await axios.get(
    'https://app.voxpria.com/api/v1/agents',
    {
      headers: {
        'Authorization': `Bearer ${process.env.VOXPRIA_API_KEY}`
      }
    }
  );
  return response.data.data;
}

// Usage
const agents = await listAgents();
agents.forEach(agent => {
  console.log(`${agent.name} (${agent.agentId})`);
});

Python #

def list_agents():
    response = requests.get(
        'https://app.voxpria.com/api/v1/agents',
        headers={
            'Authorization': f'Bearer {os.getenv("VOXPRIA_API_KEY")}'
        }
    )
    return response.json()['data']

# Usage
agents = list_agents()
for agent in agents:
    print(f"{agent['name']} ({agent['agentId']})")
💡 Note: Agent creation and editing is done through the VoxPria dashboard. The API provides read-only access to agent information.

Leave A Comment

Go to Top