Skip to main content

Dashboard Objections

Returns the most frequently encountered objections across calls, ranked by frequency, with success rates showing how often calls with each objection still resulted in a booking. Also returns top buying signals detected in calls.

Endpoint

PropertyValue
Function Namedashboard-objections
HTTP MethodGET
AuthenticationSupabase JWT (Bearer token)

Request

Headers

Authorization: Bearer <supabase_jwt_token>
Content-Type: application/json

Query Parameters

ParameterTypeRequiredDefaultDescription
periodstringNo30d7d, 30d, 90d, or custom
start_datestring (ISO date)If period=custom--Start date YYYY-MM-DD
end_datestring (ISO date)If period=custom--End date YYYY-MM-DD
campaign_idstring (UUID)No--Filter to a specific campaign
client_idstring (UUID)No--Filter to a specific client
limitintegerNo10Number of top objections to return (max 50)

Response

Success (200)

{
"period": { "start_date": "2026-01-18", "end_date": "2026-02-16" },
"top_objections": [
{
"objection": "we already have a solution",
"count": 23,
"resolved_to_booking": 5,
"success_rate": 21.7 // % of calls with this objection that still booked
},
{
"objection": "not in the budget right now",
"count": 18,
"resolved_to_booking": 3,
"success_rate": 16.7
}
],
"top_buying_signals": [
{ "signal": "asked about pricing", "count": 30 },
{ "signal": "requested a demo", "count": 22 }
],
"total_calls_analyzed": 150,
"total_calls_with_objections": 45,
"objection_rate": 30.0 // %
}

Error Responses

StatusCondition
401Missing or invalid authorization header
403User exists but has no agency_id
405HTTP method is not GET
500Failed to query calls table

Behavior

  • Authenticates the user via Supabase JWT and resolves their agency_id.
  • Queries the raw calls table for ended calls with non-null analysis within the date range.
  • Iterates through each call's analysis.sdr.objections array. Objection text is normalized (lowercased, trimmed) for consistent grouping.
  • For each unique objection, tracks the total count and how many of those calls still resulted in a booking (analysis.sdr.meeting_booked).
  • Computes success_rate as (resolved_to_booking / count) * 100.
  • Also extracts analysis.sdr.buying_signals arrays and counts frequency of each signal.
  • Returns objections and signals sorted by count descending, limited to the top N.
  • objection_rate is the percentage of analyzed calls that had at least one objection.

Database Tables

TableOperationDescription
usersReadFetches user profile to determine agency_id
callsReadRaw call records with analysis JSONB (objections and buying signals)

External APIs

None.