List the emails sent to every customer
GET/api/v1/messages
Every email TradeSender has sent the workspace's customers, newest first: what listCustomerMessages lists for one customer, for all of them. automatic=true lists only the emails nobody sent by hand (a null membership_id), such as the reminders and follow-ups the workspace sends by itself; automatic=false only those a member sent. from and to are days in the workspace's time zone, both included. Managers only.
- Needs an API key, and runs with the access of the member who made the key.
- A connected AI assistant can use it too, as
listMessages.
Parameters
In the query string
pageintegerDefault: 1. At least 1.
per_pageintegerDefault: 50. At least 1. At most 100.
kindstringWhat the email was. `quote`: Quote emailed. `invoice`: Invoice emailed. `portal_link`: Portal link emailed. `invoice_reminder`: Payment reminder. `quote_follow_up`: Quote follow-up. `visit_reminder`: Visit reminder. `on_my_way`: On my way. `rescheduled`: Visit moved. `direct_debit_failed`: Direct Debit failed. `refund`: Refund.
One of: quote, invoice, portal_link, invoice_reminder, quote_follow_up, visit_reminder, on_my_way, rescheduled, direct_debit_failed, refund.
automaticbooleanfromstring (date)tostring (date)
Responses
200Paginated emails sent to customers.
dataarray of objectrequiredEach item(14)
idstring (uuid)requiredaccount_idstring (uuid)requiredcustomer_idstring (uuid)requiredkindstringrequiredWhat the email was. `quote`: Quote emailed. `invoice`: Invoice emailed. `portal_link`: Portal link emailed. `invoice_reminder`: Payment reminder. `quote_follow_up`: Quote follow-up. `visit_reminder`: Visit reminder. `on_my_way`: On my way. `rescheduled`: Visit moved. `direct_debit_failed`: Direct Debit failed. `refund`: Refund.
One of: quote, invoice, portal_link, invoice_reminder, quote_follow_up, visit_reminder, on_my_way, rescheduled, direct_debit_failed, refund.
to_emailstring (email)requiredThe address it was sent to, which may not be the one on the customer.
subjectstringrequiredThe email's subject line.
bodystringrequiredThe note the customer read, as plain text: the words above the link, not the whole email. It never holds a link that signs the customer in. Where a quote or invoice note had the customer's link it reads `[Link]`, and a sign-in link somebody typed into a note reads `portal=[removed]`.
quote_idstring (uuid) or nullThe quote the email was about.
invoice_idstring (uuid) or nullThe invoice the email was about.
visit_idstring (uuid) or nullThe visit the email was about. The first of them, when one email covered several.
membership_idstring (uuid) or nullThe member who sent it. Null when it was sent automatically.
sent_atstring (date-time)requiredWhen the email was handed over for delivery. A message is written once and never changes.
created_atstring (date-time)requiredupdated_atstring (date-time)required
metaobjectrequiredFields(4)
pageintegerrequiredAt least 1.
per_pageintegerrequiredAt least 1. At most 100.
totalintegerrequiredAt least 0.
total_pagesintegerrequiredAt least 0.
A refusal answers in the one error shape every operation shares.
Example
A request our own tests send. The ids are made up: put your own in their place.
curl "https://app.tradesender.co.uk/api/v1/messages?page=1&per_page=50&kind=invoice_reminder" \ -H "Authorization: Bearer $TRADESENDER_KEY"