GET
/
api
/
v1
/
calls

Get Calls

Retrieve a paginated list of calls with various filtering options.

Endpoint

GET /api/v1/calls

Authentication

This endpoint requires an API key with the can_read_calls permission.

Query Parameters

ParameterTypeRequiredDescription
agent_idstringNoFilter by agent ID or assistant ID
statusstringNoFilter by call status (completed, failed, in-progress)
typestringNoFilter by call type (inbound, outbound)
pageintegerNoPage number for pagination (default: 1)
limitintegerNoNumber of results per page (default: 10, max: 100)

Response

{
  "count": 42,         // Total number of calls matching the criteria
  "page": 1,           // Current page
  "limit": 10,         // Results per page
  "pages": 5,          // Total number of pages
  "calls": [
    {
      "id": "klen_call_id",
      "agent_id": "klen_assistant_id",
      "agent_name": "Sales Representative",
      "status": "completed",
      "type": "outbound",
      "phone_number": "+15551234567",
      "started_at": "2025-04-23T14:30:45Z",
      "ended_at": "2025-04-23T14:35:12Z",
      "duration_seconds": 267,
      "summary": "Brief summary of the call content...",
      "recording_url": "https://storage.example.com/recordings/call_id.mp3",
      "contact": {
        "id": 123,
        "name": "John Doe",
        "email": "[email protected]",
        "company": "Acme Corp"
      }
    },
    // Additional call objects...
  ]
}

Error Codes

Status CodeError CodeDescription
401authentication_requiredNo API key was provided
401invalid_keyThe API key is invalid or inactive
403permission_deniedThe API key doesn’t have the required permission
500server_errorAn unexpected server error occurred

Example Request

curl -X GET 'https://api.klen.ai/api/v1/calls?agent_id=12345&type=outbound&page=1&limit=25' \
  -H 'Authorization: Bearer klen_abcdef123456789'

Example Response

{
  "count": 42,
  "page": 1,
  "limit": 25,
  "pages": 2,
  "calls": [
    {
      "id": "call_6789",
      "agent_id": "assistant_12345",
      "agent_name": "Sales Representative",
      "status": "completed",
      "type": "outbound",
      "phone_number": "+15551234567",
      "started_at": "2025-04-23T14:30:45Z",
      "ended_at": "2025-04-23T14:35:12Z",
      "duration_seconds": 267,
      "summary": "The agent discussed product pricing with the customer and answered questions about delivery times. The customer expressed interest in the premium package.",
      "recording_url": "https://storage.example.com/recordings/call_6789.mp3",
      "contact": {
        "id": 123,
        "name": "John Doe",
        "email": "[email protected]",
        "company": "Acme Corp"
      }
    },
    // Additional call objects...
  ]
}