Skip to main content
GET
Count calls

Authorizations

Authorization
string
header
required

An org API key: Authorization: Bearer phk_…

Headers

Phonely-Organization
string | null

Optional. Must be the key's org.

Query Parameters

agent_id
string
required

The agent whose calls to read.

Minimum string length: 1
status
string[] | null

Only calls in these statuses; repeat for several. Defaults to completed, ended, in_progress and in_warm_transfer.

Where a call is in its lifecycle, including the outcomes of pay-per-call transfers. Known values: completed, ended, in_progress, in_warm_transfer, queued, queueing, redial_scheduled, cancelled, dnc, failed, transferred_sold, transferred_not_sold, transferred_pending_sale, rev_share_pending_qualification, transferred_busy, transferred_no_answer, transferred_failed. More can be added, so handle values you don't recognize.

type
string[] | null

Only calls of these types, as a call's type reports them; repeat for several.

started_from
string<date-time> | null

Only calls that started at or after this time (ISO 8601 with a timezone).

started_before
string<date-time> | null

Only calls that started before this time (ISO 8601 with a timezone).

ended_reason
string[] | null

Only calls that ended for these reasons, as a call's ended_reason reports them; repeat for several.

sentiment
string[] | null

Only calls with these sentiments, as a call's sentiment reports them; repeat for several.

outcome
string[] | null

Only calls with these outcomes, exactly as a call's outcome reports them; repeat for several.

customer_phone_number
string | null

Only calls with this customer, exactly as a call's customer_phone_number reports it, such as +14155550123. Encode the + as %2B in the URL, or it arrives as a space.

Minimum string length: 1
customer_phone_number_contains
string | null

Only calls whose customer_phone_number contains this text, such as 5550123. Not with customer_phone_number.

Required string length: 1 - 64
transcript_contains
string | null

Only calls where the agent or the customer said this text, ignoring case. Needs started_from, at most 31 days before started_before (or now).

Required string length: 1 - 100
analytics_field
string[] | null

Only calls whose analytics fields hold these options, each as <field_id>:<option_id> from the agent's GET /v1/agents/{id}/call-analysis. Options of one field combine with OR, different fields with AND. Repeat for several, at most 200.

experiment_id
string | null

Only calls that took part in this A/B experiment, on either arm, as a call's experiment_ids reports it.

Minimum string length: 1
campaign_id
string | null

Only calls placed by this campaign.

Minimum string length: 1
min_duration_seconds
number | null

Only calls that lasted at least this long. Like max_duration_seconds, it matches only calls with a duration (duration_seconds not null).

Required range: x >= 0
max_duration_seconds
number | null

Only calls that lasted at most this long. Like min_duration_seconds, it matches only calls with a duration (duration_seconds not null).

Required range: x >= 0

Response

Successful Response

How many of an agent's calls match the filters, in all and by value.

agent_id
string
required

The agent whose calls were counted.

ended_reason
CallValueCount · object[]
required

Matching calls by ended_reason, most first.

object
string
default:call_counts
required

The type of this object, always call_counts.

Allowed value: "call_counts"
outcome
CallValueCount · object[]
required

Matching calls by outcome, most first.

sentiment
CallValueCount · object[]
required

Matching calls by sentiment, most first.

status
CallValueCount · object[]
required

Matching calls by status, most first.

total_count
integer
required

How many calls match.

type
CallValueCount · object[]
required

Matching calls by type, most first.