Overview The Call Insights REST API provides programmatic access to call logs, call summaries, and call quality data for use in your applications and tools. This API allows you to search and retrieve call records with advanced filtering capabilities.
Base URL Call Insights data is available under the following base URL. The REST API is served over HTTPS; unencrypted HTTP is not supported.
Copy https://portalapi.rp4s.app/api/v1/call-logsAuthentication To authenticate requests to the Call Insights API, use the X-RP-API-Key header with your API key. API keys are mapped to specific tenants in the system configuration.
Example Request Copy curl -X POST https://portalapi.rp4s.app/api/v1/call-logs/search \
-H "X-RP-API-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"data": {
"from": "2024-01-01T00:00:00Z",
"to": "2024-01-31T23:59:59Z",
"limit": 25,
"offset": 0
}
}'Search Endpoint The search endpoint provides advanced filtering capabilities for call logs with support for multiple search criteria, date ranges, and pagination.
POST /call-logs/search Request Body Copy {
"keywords": ["string"],
"agents": ["string"],
"teams": ["string"],
"contacts": ["string"],
"bookmarks": ["string"],
"call_directions": ["inbound", "outbound"],
"call_statuses": ["completed", "failed", "busy"],
"call_outcomes": ["success", "failure"],
"call_durations": [
{
"from": 0,
"to": 300
}
],
"activity_type": "string",
"from": "2024-01-01T00:00:00Z",
"to": "2024-01-31T23:59:59Z",
"limit": 25,
"offset": 0
}Parameters
Parameter Type Required Description Example keywordsstring[] No Search keywords to match against call data, transcriptions, and notes. Supports partial matching and case-insensitive search. ["support", "issue", "problem"]agentsstring[] No Filter by agent names. Exact match required. Can be full names or partial names. ["John Doe", "Jane Smith"]teamsstring[] No Filter by team names. Exact match required. Used for organizational grouping. ["Sales", "Support", "Billing"]contactsstring[] No Filter by contact phone numbers. Supports various formats: +1234567890, 123-456-7890, (123) 456-7890. ["+1234567890", "+1987654321"]bookmarksstring[] No Filter by bookmark tags. Used for categorizing and organizing calls. ["important", "follow-up", "escalated"]call_directionsstring[] No Filter by call direction. Valid values: "inbound" (calls received), "outbound" (calls made). ["inbound", "outbound"]call_statusesstring[] No Filter by call status. Valid values: "completed", "failed", "busy", "no-answer", "cancelled". ["completed", "failed"]call_outcomesstring[] No Filter by call outcome. Valid values: "success", "failure", "partial", "abandoned". ["success", "failure"]call_durationsobject[] No Filter by call duration range in seconds. Each object contains "from" and "to" properties. [{"from": 60, "to": 600}]activity_typestring No Filter by activity type. Valid values: "call", "voicemail", "sms", "email". "call"fromdatetime No Start date and time for search range. ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. "2024-01-01T00:00:00Z"todatetime No End date and time for search range. ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. "2024-01-31T23:59:59Z"limitinteger No Number of results to return per page. Range: 1-100. Default: 25. 50offsetinteger No Number of results to skip for pagination. Used with limit for pagination. Default: 0. 25
Response
Each item in data is a call-log object. Contact crmReference and call crmReference use Salesforce Ids when linked. Media URLs under callMedia are signed URLs that expire after 30 minutes . For team calls, team.name is set; otherwise team is null.
Copy {
"tenant_name": "Acme Corp",
"data": [
{
"callId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"agent": {
"name": "Jane Smith"
},
"contact": {
"name": "John Doe",
"crmReference": "003XX000001FGHIJ",
"phoneNumber": "+15551234567",
"type": "Contact"
},
"startTime": "2025-08-25T07:02:39.287Z",
"calledVia": "+15559876543",
"endTime": "2025-08-25T07:05:44.287Z",
"duration": 185,
"direction": "Inbound",
"outcome": "Completed",
"status": "Completed",
"crmReference": "00TXX000007KLMNO",
"team": {
"name": "Sales Team"
},
"callMedium": "phone",
"callWasForwarded": false,
"callWasDiverted": false,
"callTargetType": "User",
"wrapUpStatus": "completed",
"bookmarks": [
{
"name": "Pricing discussion",
"startTime": "2025-08-25T07:03:10.000Z",
"relativeStartTime": 31,
"description": "Customer asked about enterprise pricing",
"reference": "a0BXX000001BOOK1",
"actionReference": "a0CXX000001ACT01",
"transcriptionSegments": [
{
"description": "What does the enterprise plan include?",
"startTime": "00:00:31",
"endTime": "00:00:35",
"speaker": "Contact"
}
],
"type": "Automated"
}
],
"callEvents": [
{
"startTime": "2025-08-25T07:02:39.287Z",
"type": "CallStarted"
},
{
"startTime": "2025-08-25T07:05:44.287Z",
"type": "CallEnded"
}
],
"aiinsights": {
"sentiment": "positive",
"summary": "Customer inquired about enterprise pricing and next steps.",
"topics": ["pricing", "enterprise"],
"coachingTips": [
{
"selectedText": "Let me check with my manager",
"tipsNote": ["Offer a clear next step and timeline"],
"startTime": "2025-08-25T07:04:00.000Z",
"type": "Default"
}
]
},
"callMedia": {
"agent-recording_url": "https://storage.googleapis.com/bucket/mic.wav?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Expires=1800&X-Goog-Signature=...",
"contact-recording_url": "https://storage.googleapis.com/bucket/phone.wav?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Expires=1800&X-Goog-Signature=...",
"call-transcription_url": "https://storage.googleapis.com/bucket/transcript.json?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Expires=1800&X-Goog-Signature=..."
}
}
],
"pagination": {
"count": 1,
"offset": 0,
"limit": 25,
"total": 142
},
"error": null
}Response Parameters
Parameter Type Description Example callIdstring Unique identifier for the call record "a1b2c3d4-e5f6-7890-abcd-ef1234567890"agentobject Agent who handled the call (name only). {"name":"Jane Smith"}contactobject Contact / customer. Name is resolved from the contacts table via callee_id. If callee_type is Account, name/crmReference are resolved from the accounts table instead. phoneNumber comes from the call record customer phone. type comes from callee_type. {"name":"John Doe","crmReference":"003XX000001FGHIJ","phoneNumber":"+15551234567","type":"Contact"}startTimedatetime Timestamp when the call started (ISO 8601 format) "2025-08-25T07:02:39.287Z"calledViastring Tenant-side number that was called (user, team, or org line). Use with callTargetType to know which kind of number it is. "+15559876543"endTimedatetime Timestamp when the call ended (ISO 8601 format) "2025-08-25T07:05:44.287Z"durationinteger Call duration in seconds 185directionstring Call direction (e.g. Inbound / Outbound) "Inbound"outcomestring Call outcome "Completed"statusstring Call status "Completed"crmReferencestring Salesforce Task Id (00T…) linked to the call "00TXX000007KLMNO"teamobject | null Present only for team calls, with the team name. Otherwise null. {"name":"Sales Team"} or nullcallMediumstring Medium used for the call "phone"callWasForwardedboolean Whether the call was forwarded falsecallWasDivertedboolean Whether the call was diverted falsecallTargetTypestring What calledVia belongs to: "User", "Team", "Org", "Account", "Contact", etc. "User"wrapUpStatusstring Wrap-up status of the call record "completed"bookmarksobject[] Bookmarks detected on the call. reference / actionReference use Salesforce Ids when available. — callEventsobject[] Timeline events for the call — aiinsightsobject AI insights: sentiment, summary, topics, and coaching tips — callMediaobject Signed media URLs (agent recording, contact recording, transcription). Valid for 30 minutes. —
Parameter Type Description countinteger Number of records returned in current response offsetinteger Number of records skipped for pagination limitinteger Maximum number of records requested totalinteger Total number of records matching the search criteria
Complex Objects agent Parameter Type Description namestring Agent display name
contact Parameter Type Description namestring Resolved from contacts via call record callee_id → contacts id (first_name + last_name) crmReferencestring Salesforce Id for the contact CRM record (Contact 003…, Account 001…, Lead 00Q…, etc.) phoneNumberstring Customer phone from the call record (customer_phone) typestring From call record callee_type: Account, Contact, Lead, etc.
team If the call is a team call, team contains the team name. If it is not a team call, team is null.
Parameter Type Description namestring Team name (only when this is a team call)
Bookmark Object Parameter Type Description namestring Bookmark name startTimedatetime Absolute start time of the bookmark relativeStartTimeinteger Seconds from call start when the bookmark occurs descriptionstring Bookmark description referencestring Salesforce reference Id for the bookmark actionReferencestring Salesforce reference Id for the bookmark action transcriptionSegmentsobject[] Related transcript segments (description, startTime, endTime, speaker) typestring Bookmark type (e.g. Automated)
callEvents Parameter Type Description startTimestring Event timestamp typestring Event type (e.g. CallStarted, CallEnded)
aiinsights Parameter Type Description sentimentstring Overall sentiment (positive / negative / neutral) summarystring AI call summary from open_ai_call_summary.ConversationSummary topicsstring[] Topics detected on the call coachingTipsobject[] Coaching tips (selectedText, tipsNote, startTime, type)
callMedia All URLs are time-limited signed URLs and are valid for 30 minutes from the time of the response. Re-request the search (or sign-media) endpoint if a URL has expired.
Parameter Type Description agent-recording_urlstring Signed URL for the agent (mic) recording contact-recording_urlstring Signed URL for the contact (phone) recording call-transcription_urlstring Signed URL for the call transcription
Examples Basic Search Search for calls within a date range:
Copy curl -X POST https://portalapi.rp4s.app/api/v1/call-logs/search \
-H "X-RP-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"from": "2024-01-01T00:00:00Z",
"to": "2024-01-31T23:59:59Z",
"limit": 10
}'Advanced Search Search with multiple filters:
Copy curl -X POST https://portalapi.rp4s.app/api/v1/call-logs/search \
-H "X-RP-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"agents": ["John Doe", "Jane Smith"],
"call_directions": ["inbound"],
"call_statuses": ["completed"],
"call_durations": [
{
"from": 60,
"to": 600
}
],
"from": "2024-01-01T00:00:00Z",
"to": "2024-01-31T23:59:59Z",
"limit": 25
}'Keyword Search Search for calls containing specific keywords:
Copy curl -X POST https://portalapi.rp4s.app/api/v1/call-logs/search \
-H "X-RP-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"keywords": ["support", "issue", "problem"],
"from": "2024-01-01T00:00:00Z",
"to": "2024-01-31T23:59:59Z",
"limit": 50
}'Error Codes HTTP Status Error Code Description 400 INVALID_INPUTInvalid request parameters or malformed JSON 401 UNAUTHORIZEDMissing or invalid API key 404 NOT_FOUNDResource not found 429 RATE_LIMIT_EXCEEDEDRate limit exceeded 500 INTERNAL_ERRORInternal server error
Error Response Example Copy {
"error": {
"title": "Invalid Input",
"details": "Invalid date format for 'from' parameter",
"error_code": "INVALID_INPUT"
}
}