GET/2010-04-01/Accounts/{AccountSid}/Messages.json

List messages for an account

Lists message resources associated with an account. Filter the results by recipient, sender, or sent date, and use the page parameters to navigate the list.

9 parameters
AccountSidstringrequired
The SID of the account whose message resources to list, in the format `AC` followed by 32 hexadecimal characters.
Tostringoptional
Filter by recipient phone number.
Fromstringoptional
Filter by sender phone number.
DateSentstringoptional
Filter by sent date using a GMT date in `YYYY-MM-DD` format, or use a date inequality to include messages on or before or after that date.
DateSent<stringoptional
Filter for messages sent on or before the specified GMT date, using a `YYYY-MM-DD` date value.
DateSent>stringoptional
Filter for messages sent on or after the specified GMT date, using a `YYYY-MM-DD` date value.
PageSizeintegeroptional
The number of resources to return per page, from 1 to 1000. Defaults to 50 when omitted.
Pageintegeroptional
The page index used for client state. Must be zero or greater.
PageTokenstringoptional
The page token provided by the API for navigating the results.

1 status code
200Returns a paginated response containing message records and page navigation metadata. Message records include fields such as sender, recipient, body, status, direction, sent date, and message SID.
endintegeroptional
first_page_uristringoptional
next_page_uristringoptional
pageintegeroptional
page_sizeintegeroptional
previous_page_uristringoptional
startintegeroptional
uristringoptional
messagesarray<object>optional

Error handling

AccountSid must be a 34-character account SID beginning with AC. PageSize must be between 1 and 1000, and Page must be zero or greater; To and From use phone-number values.