Messages

Get message metrics

Returns your texting over a window (the last 7 days by default, starting at most a year back): texts sent and received, how the sent ones ended up (delivered, left the phone with no delivery report, unconfirmed, failed, still queued) and the delivery rate, how long they took to send and to be delivered, why they failed, your conversations and how many of the ones you texted wrote back within a day, and each phone's share with its busiest 30 minutes, to compare with the send_limit the response carries. The points chart it by the hour or the day (granularity) in time_zone; hour buckets need a window of 7 days or less. Scope it to one phone with phone_id or one conversation with conversation_id. A text counts at the time the platform stored it when sent, and when the phone received it when received.

get/messages/metrics

Request

Query parameters

period_start_atstring date-time

Start of the window (RFC 3339). Defaults to 7 days before period_end_at, and may be at most a year before now.

period_end_atstring date-time

End of the window (RFC 3339). Defaults to now, and a later time is read as now.

granularity'hour' | 'day'

Bucket size: hour or day. hour is allowed for windows of 7 days or less.

time_zonestring

IANA time zone the buckets follow, such as America/Los_Angeles: a day starts at local midnight and an hour on the local hour. An unknown name is an error.

phone_idstring

Only this phone's texts. A phone your organization doesn't rent is not found.

conversation_idstring uuid

Only this conversation's texts, and only its phone. Another organization's conversation is not found. When phone_id is also given, it is ignored: the conversation names the phone.

Response

OK

delivery_ratenumber double nullable required

Delivered over sent, not counting texts still queued, from 0 to 1. Null when nothing settled.

period_end_atstring date-time required

End of the window, as resolved: never later than now.

period_start_atstring date-time required

Start of the window, as resolved.

Changes