Skip to navigation

rank_handoff_reasons

Ranks every handoff reason in a date range by the number of conversations, in one call. Each reason has its count, its share, what can fix it, a suggestion, and sample conversation IDs. Use it to pick the handoff reason to work on.

Read-only. The improvement loop uses it when you ask to reduce handoffs.

Example prompts

  • “Why does the Agent hand off to human agents? Rank the reasons for the last 30 days.”
  • “Which handoff reasons can I fix on the Chat channel this month?”

Parameters

ParameterTypeRequiredDescription
start_datestringYesStart of the range, YYYY-MM-DD or YYYY-MM-DDTHH:MM in time_zone. A date starts at 00:00.
end_datestringYesEnd of the range, YYYY-MM-DD or YYYY-MM-DDTHH:MM in time_zone. A date includes its whole day. A date with a time is exclusive.
time_zonestringNoIANA time zone, such as America/New_York, for the day boundaries. Defaults to UTC.
filtersarrayNoFilters in the shape of get_ada_metric filters, for example a channel or an Intent. Get the types from get_available_filters. A handoff reason filter isn’t allowed.
samplesintegerNoSample conversation IDs for each reason, from 0 to 10. Defaults to 3. 0 returns none and is faster.

Response

FieldDescription
totalsThe conversations in the range, the escalated conversations, and the conversations with_reason: those with a recorded handoff reason.
reasonsOne row per reason, ranked by count. Each row has reason_code, conversations, share, fix_surface, suggestion, and sample_conversation_ids.

fix_surface says what can fix the reason:

  • tool, knowledge, or routing: a change to the AI Agent’s configuration can fix it.
  • system or none: a configuration change usually can’t fix it. Read the suggestion.
  • unknown: the cause isn’t known. Read the sample conversations to decide.

conversations counts each conversation with at least one handoff of that reason. A conversation with two reasons counts under both, so the shares can add up to more than 1. share is the share of the conversations with_reason, or null when no conversation has a recorded reason. A handoff that recorded no reason is in no row, so the counts are a lower bound.

To read a sample, the assistant calls get_conversation. To list more conversations for one reason, it calls get_conversations with a handoff reason filter.