New guide: Your Salesforce Org Is Missing Critical Data , Download free
Developers

API Documentation

Call Insights REST API , programmatic access to call logs, summaries and call quality data.

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.

https://portalapi.rp4s.app/api/v1/call-logs

Authentication

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

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

{
  "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

ParameterTypeRequiredDescriptionExample
keywordsstring[]NoSearch keywords to match against call data, transcriptions, and notes. Supports partial matching and case-insensitive search.["support", "issue", "problem"]
agentsstring[]NoFilter by agent names. Exact match required. Can be full names or partial names.["John Doe", "Jane Smith"]
teamsstring[]NoFilter by team names. Exact match required. Used for organizational grouping.["Sales", "Support", "Billing"]
contactsstring[]NoFilter by contact phone numbers. Supports various formats: +1234567890, 123-456-7890, (123) 456-7890.["+1234567890", "+1987654321"]
bookmarksstring[]NoFilter by bookmark tags. Used for categorizing and organizing calls.["important", "follow-up", "escalated"]
call_directionsstring[]NoFilter by call direction. Valid values: "inbound" (calls received), "outbound" (calls made).["inbound", "outbound"]
call_statusesstring[]NoFilter by call status. Valid values: "completed", "failed", "busy", "no-answer", "cancelled".["completed", "failed"]
call_outcomesstring[]NoFilter by call outcome. Valid values: "success", "failure", "partial", "abandoned".["success", "failure"]
call_durationsobject[]NoFilter by call duration range in seconds. Each object contains "from" and "to" properties.[{"from": 60, "to": 600}]
activity_typestringNoFilter by activity type. Valid values: "call", "voicemail", "sms", "email"."call"
fromdatetimeNoStart date and time for search range. ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ."2024-01-01T00:00:00Z"
todatetimeNoEnd date and time for search range. ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ."2024-01-31T23:59:59Z"
limitintegerNoNumber of results to return per page. Range: 1-100. Default: 25.50
offsetintegerNoNumber 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.

{
  "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

ParameterTypeDescriptionExample
callIdstringUnique identifier for the call record"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
agentobjectAgent who handled the call (name only).{"name":"Jane Smith"}
contactobjectContact / 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"}
startTimedatetimeTimestamp when the call started (ISO 8601 format)"2025-08-25T07:02:39.287Z"
calledViastringTenant-side number that was called (user, team, or org line). Use with callTargetType to know which kind of number it is."+15559876543"
endTimedatetimeTimestamp when the call ended (ISO 8601 format)"2025-08-25T07:05:44.287Z"
durationintegerCall duration in seconds185
directionstringCall direction (e.g. Inbound / Outbound)"Inbound"
outcomestringCall outcome"Completed"
statusstringCall status"Completed"
crmReferencestringSalesforce Task Id (00T…) linked to the call"00TXX000007KLMNO"
teamobject | nullPresent only for team calls, with the team name. Otherwise null.{"name":"Sales Team"} or null
callMediumstringMedium used for the call"phone"
callWasForwardedbooleanWhether the call was forwardedfalse
callWasDivertedbooleanWhether the call was divertedfalse
callTargetTypestringWhat calledVia belongs to: "User", "Team", "Org", "Account", "Contact", etc."User"
wrapUpStatusstringWrap-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
aiinsightsobjectAI insights: sentiment, summary, topics, and coaching tips
callMediaobjectSigned media URLs (agent recording, contact recording, transcription). Valid for 30 minutes.

Pagination Object

ParameterTypeDescription
countintegerNumber of records returned in current response
offsetintegerNumber of records skipped for pagination
limitintegerMaximum number of records requested
totalintegerTotal number of records matching the search criteria

Complex Objects

agent
ParameterTypeDescription
namestringAgent display name
contact
ParameterTypeDescription
namestringResolved from contacts via call record callee_id → contacts id (first_name + last_name)
crmReferencestringSalesforce Id for the contact CRM record (Contact 003…, Account 001…, Lead 00Q…, etc.)
phoneNumberstringCustomer phone from the call record (customer_phone)
typestringFrom 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.

ParameterTypeDescription
namestringTeam name (only when this is a team call)
Bookmark Object
ParameterTypeDescription
namestringBookmark name
startTimedatetimeAbsolute start time of the bookmark
relativeStartTimeintegerSeconds from call start when the bookmark occurs
descriptionstringBookmark description
referencestringSalesforce reference Id for the bookmark
actionReferencestringSalesforce reference Id for the bookmark action
transcriptionSegmentsobject[]Related transcript segments (description, startTime, endTime, speaker)
typestringBookmark type (e.g. Automated)
callEvents
ParameterTypeDescription
startTimestringEvent timestamp
typestringEvent type (e.g. CallStarted, CallEnded)
aiinsights
ParameterTypeDescription
sentimentstringOverall sentiment (positive / negative / neutral)
summarystringAI 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.

ParameterTypeDescription
agent-recording_urlstringSigned URL for the agent (mic) recording
contact-recording_urlstringSigned URL for the contact (phone) recording
call-transcription_urlstringSigned URL for the call transcription

Examples

Basic Search

Search for calls within a date range:

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:

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:

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 StatusError CodeDescription
400INVALID_INPUTInvalid request parameters or malformed JSON
401UNAUTHORIZEDMissing or invalid API key
404NOT_FOUNDResource not found
429RATE_LIMIT_EXCEEDEDRate limit exceeded
500INTERNAL_ERRORInternal server error

Error Response Example

{
  "error": {
    "title": "Invalid Input",
    "details": "Invalid date format for 'from' parameter",
    "error_code": "INVALID_INPUT"
  }
}