API des agents #
Lister et récupérer des informations sur vos agents vocaux IA.
Lister tous les agents #
Point de terminaison : GET /api/v1/agents
curl -X GET "https://app.voxpria.com/api/v1/agents" -H "Authorization: Bearer YOUR_API_KEY"
Réponse #
{
"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"
}
]
}
Obtenir les détails d’un agent #
Point de terminaison : GET /api/v1/agents/:id
curl -X GET "https://app.voxpria.com/api/v1/agents/agent_abc123" -H "Authorization: Bearer YOUR_API_KEY"
Réponse #
{
"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
}
}
}
Exporter le flux d’un agent #
Point de terminaison : GET /api/v1/agents/:id/flow
Exportez la configuration du flux de conversation d’un agent :
curl -X GET "https://app.voxpria.com/api/v1/agents/agent_abc123/flow" -H "Authorization: Bearer YOUR_API_KEY"
Réponse #
{
"success": true,
"data": {
"agentId": "agent_abc123",
"flow": {
"nodes": [...],
"edges": [...],
"version": "1.0"
}
}
}
Exemple de code #
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']})")
