cURL
curl --request POST \ --url https://jwhite.tail8bf327.ts.net/api/v1/sessions \ --header 'Content-Type: application/json' \ --header 'x-api-key: <api-key>' \ --data ' { "agent_id": 123, "session_type": "<string>", "metadata": {} } '
{ "success": true, "session": { "session_id": 456, "agent_id": 123, "agent_name": "Sales Support Agent", "session_type": "agent_voice", "status": "active", "started_at": "2024-01-15T10:30:00Z", "metadata": { "source": "web_app", "device": "desktop" }, "avatar_id": 1, "avatar_name": "Professional Avatar", "avatar_url": "https://example.com/avatar.jpg", "voice_id": "21m00Tcm4TlvDq8ikWAM" }, "message": "Session started successfully" }
Create a new session (call) within an existing agent
x-api-key: ah_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx
POST https://jwhite.tail8bf327.ts.net/api/v1/sessions x-api-key: ah_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx Content-Type: application/json { "agent_id": 123, "session_type": "agent_voice", "metadata": { "source": "web_app", "device": "desktop" } }
{ "success": false, "error": "Agent not found or access denied" }