Skip to main content
GET
https://jwhite.tail8bf327.ts.net
/
api
/
v1
/
sessions
List Sessions
curl --request GET \
  --url https://jwhite.tail8bf327.ts.net/api/v1/sessions \
  --header 'x-api-key: <api-key>'
{
  "success": true,
  "sessions": [
    {
      "session_id": 456,
      "agent_id": 123,
      "session_type": "agent_voice",
      "status": "completed",
      "started_at": "2024-01-15T12:00:00Z",
      "ended_at": "2024-01-15T12:05:30Z",
      "duration": 330,
      "created_at": "2024-01-15T12:00:00Z",
      "agent_name": "Sales Support Agent",
      "avatar_id": 1,
      "avatar_name": "Professional Avatar",
      "avatar_url": "https://example.com/avatar.jpg",
      "voice_id": "21m00Tcm4TlvDq8ikWAM"
    }
  ]
}

Authentication

Requires API key authentication (x-api-key header).
x-api-key: ah_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx

Query Parameters

agent_id
integer
Filter sessions by agent ID
status
string
default:"all"
Filter sessions by status. Options:
  • all - Return all sessions (default)
  • active - Return only active sessions
  • completed - Return only completed sessions

Request

GET https://jwhite.tail8bf327.ts.net/api/v1/sessions?status=active
x-api-key: ah_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx

Response

{
  "success": true,
  "sessions": [
    {
      "session_id": 456,
      "agent_id": 123,
      "session_type": "agent_voice",
      "status": "completed",
      "started_at": "2024-01-15T12:00:00Z",
      "ended_at": "2024-01-15T12:05:30Z",
      "duration": 330,
      "created_at": "2024-01-15T12:00:00Z",
      "agent_name": "Sales Support Agent",
      "avatar_id": 1,
      "avatar_name": "Professional Avatar",
      "avatar_url": "https://example.com/avatar.jpg",
      "voice_id": "21m00Tcm4TlvDq8ikWAM"
    }
  ]
}

Response Fields

FieldTypeDescription
successbooleanWhether the request was successful
sessionsarrayArray of session objects
sessions[].session_idintegerUnique session identifier
sessions[].agent_idintegerParent agent ID
sessions[].session_typestringSession type (‘agent_voice’, ‘agent_video’, ‘agent_chat’, ‘webrtc_video’)
sessions[].statusstringSession status (‘active’, ‘completed’)
sessions[].started_atstringISO 8601 timestamp when session started
sessions[].ended_atstringISO 8601 timestamp when session ended (null if active)
sessions[].durationintegerSession duration in seconds (null if active)
sessions[].created_atstringISO 8601 timestamp of creation
sessions[].agent_namestringName of parent agent
sessions[].avatar_idintegerAvatar ID
sessions[].avatar_namestringAvatar display name
sessions[].avatar_urlstringAvatar image URL
sessions[].voice_idstringVoice ID from avatar (null if not set)

Error Responses

For information about error responses and status codes, see Error Responses.

Common Errors for This Endpoint

  • 401 Unauthorized - Invalid or missing API key
  • 429 Too Many Requests - Rate limit exceeded
  • 500 Internal Server Error - Server error