Skip to main content
GET
/
v1
/
call
JavaScript
import Roark from '@roarkanalytics/sdk';

const client = new Roark({
  bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted
});

const calls = await client.call.list();

console.log(calls.data);
{
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "projectId": "660e8400-e29b-41d4-a716-446655440001",
      "callDirection": "INBOUND",
      "startedAt": "2024-01-15T10:00:00Z",
      "title": "Customer support inquiry",
      "summary": "Customer inquired about billing and payment options",
      "status": "ENDED",
      "endedAt": "2024-01-15T10:30:00Z",
      "durationMs": 1800000,
      "endedStatus": "AGENT_ENDED_CALL",
      "recordingUrl": "https://s3.amazonaws.com/bucket/recording.mp3?...",
      "simulationJobId": "880e8400-e29b-41d4-a716-446655440003",
      "supersededByCallId": "990e8400-e29b-41d4-a716-446655440004",
      "agents": [
        {
          "id": "550e8400-e29b-41d4-a716-446655440000",
          "endpoint": {
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "environment": "Production",
            "phoneNumberE164": "+1234567890"
          }
        }
      ],
      "customers": [
        {
          "phoneNumberE164": "+1234567891",
          "label": "customer-01"
        }
      ],
      "createdAt": "2024-01-15T10:31:00Z",
      "updatedAt": "2024-01-15T10:31:00Z",
      "properties": {
        "customerId": "cust_123",
        "department": "sales"
      }
    }
  ],
  "pagination": {
    "total": 123,
    "hasMore": true,
    "nextCursor": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

limit
integer
default:20

Maximum number of calls to return (default: 20, max: 100)

Required range: 1 <= x <= 100
Example:

20

after
string<uuid>

Cursor for pagination - call ID to start after

Example:

"550e8400-e29b-41d4-a716-446655440000"

sortBy
enum<string>
default:createdAt

Field to sort by (default: createdAt)

Available options:
createdAt,
startedAt,
endedAt,
duration,
title,
status
Example:

"createdAt"

sortDirection
enum<string>
default:desc

Sort direction (default: desc)

Available options:
asc,
desc
Example:

"desc"

status
enum<string>

Filter by call status

Available options:
RINGING,
IN_PROGRESS,
ENDED
Example:

"ENDED"

searchText
string

Search text to filter calls by title, summary, or transcript

Example:

"billing inquiry"

Response

List of calls

data
CallResponse · object[]
required
pagination
object
required