Skip to main content
The Calls API provides programmatic access to call logs and analytics. Use these APIs to retrieve call history, participant details, duration metrics, and recording information for your application.

Base URL

https://{appId}.call-{region}.cometchat.io/v3
VariableDescription
appIdYour CometChat App ID
regionYour app’s region: us, eu, or in

Authentication

All API requests require authentication using your REST API Key in the header:
curl -X GET "https://{appId}.call-{region}.cometchat.io/v3/calls" \
  -H "apikey: YOUR_REST_API_KEY"
Use the REST API Key from your CometChat Dashboard. This key has full access scope and should only be used server-side.

Available Endpoints

EndpointMethodDescription
/callsGETList all calls with filtering options
/calls/GETGet details of a specific call

Use Cases

Use CaseEndpointDescription
Call historyList CallsDisplay call logs in your app
Analytics dashboardList CallsAggregate call duration and participant metrics
Call details pageGet CallShow detailed information for a specific call
Recording accessGet CallRetrieve recording URLs for playback
Billing reportsList CallsCalculate audio/video minutes for billing

Call Object

The call object contains all information about a call session.
PropertyTypeDescription
sessionIdstringUnique identifier for the call
typestringCall type: audio or video
modestringCall mode: call, meet, or presenter
statusstringCurrent status: initiated, ongoing, ended, unanswered, rejected, canceled
receiverTypestringReceiver type: user or group
initiatorstringUID of the user who initiated the call
receiverstringUID of the user or GUID of the group receiving the call
totalParticipantsintegerNumber of participants (multiple devices counted separately)
totalAudioMinutesfloatTotal audio minutes across all participants
totalVideoMinutesfloatTotal video minutes across all participants
totalDurationInMinutesfloatTotal call duration (audio + video minutes)
totalDurationstringDuration in timer format (e.g., “00:05:30”)
hasRecordingbooleanWhether the call has recordings
initiatedAtintegerUnix timestamp when call was initiated
startedAtintegerUnix timestamp when call started (first participant joined)
endedAtintegerUnix timestamp when call ended
participantsarrayList of participant objects
recordingsarrayList of recording objects (if hasRecording is true)

Call Status Values

StatusDescription
initiatedCall has been initiated but no one has joined yet
ongoingCall is currently in progress
endedCall has ended normally
unansweredCall was not answered within the timeout period
rejectedReceiver rejected the call
canceledCaller canceled before receiver answered

Call Mode Values

ModeDescription
callStandard 1-on-1 or group call initiated via SDK
meetMeeting/conference call with a shared session ID
presenterWebinar-style call with presenter and viewers

Participant Object

Each participant in a call has the following properties:
PropertyTypeDescription
uidstringUnique identifier of the user
deviceIdstringUnique identifier of the device used to join
isJoinedbooleanWhether the user actually joined the call
statestringParticipant state: ongoing, ended, unanswered, rejected
joinedAtintegerUnix timestamp when participant joined
leftAtintegerUnix timestamp when participant left
totalAudioMinutesfloatAudio minutes for this participant
totalVideoMinutesfloatVideo minutes for this participant
totalDurationInMinutesfloatTotal duration for this participant
If a user joins from multiple devices, each device is counted as a separate participant entry.

Recording Object

When a call has recordings, each recording contains:
PropertyTypeDescription
ridstringUnique identifier of the recording
recording_urlstringS3 URL to download/stream the recording
durationfloatRecording duration in minutes
startTimeintegerUnix timestamp when recording started
endTimeintegerUnix timestamp when recording ended

Example Response

{
  "data": {
    "sessionId": "v1.us.31780434a95d45.16923681138d75114d60d1345a22e4cc612263fb26c0b5cf92",
    "type": "audio",
    "mode": "call",
    "status": "ended",
    "receiverType": "user",
    "initiator": "superhero8",
    "receiver": "superhero2",
    "totalParticipants": 2,
    "totalAudioMinutes": 0.32,
    "totalVideoMinutes": 0,
    "totalDurationInMinutes": 0.32,
    "totalDuration": "00:00:19",
    "hasRecording": false,
    "initiatedAt": 1692368113,
    "startedAt": 1692368127,
    "endedAt": 1692368146,
    "participants": [
      {
        "uid": "superhero8",
        "deviceId": "70ecae89-b71c-4bb3-8220-b7c99ec1658f@rtc.cometchat.com/hsYWb5ul",
        "isJoined": true,
        "state": "ended",
        "joinedAt": 1692368128,
        "leftAt": 1692368144,
        "totalAudioMinutes": 0.27,
        "totalVideoMinutes": 0,
        "totalDurationInMinutes": 0.27
      },
      {
        "uid": "superhero2",
        "deviceId": "c9ed493e-8495-428d-b6ee-b32019cc57ce@rtc.cometchat.com/CKT3xgR4",
        "isJoined": true,
        "state": "ended",
        "joinedAt": 1692368132,
        "leftAt": 1692368146,
        "totalAudioMinutes": 0.23,
        "totalVideoMinutes": 0,
        "totalDurationInMinutes": 0.23
      }
    ]
  }
}

Pagination

List endpoints return paginated results with metadata:
{
  "data": [...],
  "meta": {
    "pagination": {
      "total": 150,
      "count": 25,
      "per_page": 25,
      "current_page": 1,
      "total_pages": 6
    }
  }
}
PropertyDescription
totalTotal number of records
countNumber of records in current response
per_pageRecords per page
current_pageCurrent page number
total_pagesTotal number of pages

Error Handling

The API returns standard HTTP status codes:
Status CodeDescription
200Success
400Bad request - Invalid parameters
401Unauthorized - Invalid or missing API key
404Not found - Call session doesn’t exist
429Rate limited - Too many requests
500Server error
Error responses include a message:
{
  "error": {
    "code": "ERR_SESSION_NOT_FOUND",
    "message": "The specified session ID does not exist"
  }
}