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

List account messages

Lists message resources associated with an account. Filter results by recipient, sender, or GMT sent date, then use the pagination parameters to retrieve additional pages.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

9 parameters
AccountSidstringrequired
The account SID associated with the messages, matching the 34-character `AC` SID format.
Tostringoptional
Filters messages by recipient phone number.
Fromstringoptional
Filters messages by sender phone number.
DateSentstringoptional
Filters messages by the specified GMT sent date.
DateSent<stringoptional
Filters messages sent on or before the specified GMT date.
DateSent>stringoptional
Filters messages sent on or after the specified GMT date.
PageSizeintegeroptional
The number of messages to return per page. Defaults to 50 when omitted and must be between 1 and 1000.
Pageintegeroptional
The zero-based page index used for client-side pagination. Must be zero or greater when supplied.
PageTokenstringoptional
The pagination token provided by the API for retrieving a specific subsequent page.

1 status code
200Returns a paginated object containing message resources in `messages`, along with page indexes, resource counts, and navigation URIs.
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. To and From must use the phone-number format, date filters must use the declared date-time format, PageSize must be between 1 and 1000, and Page must be zero or greater.