List the emails sent to a customer
GET/api/v1/customers/{customer_id}/messages
Every email TradeSender has sent this customer, newest first. kind says what each one was. A message is listed once the email has been handed over for delivery, which does not prove that it arrived. An email that was refused before sending, by the daily limit or a bad address, is not listed, and nor is one sent before this list existed. Managers only. An archived customer keeps their messages.
- 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
listCustomerMessages.
Parameters
In the address
customer_idstring (uuid)required
In the query string
pageintegerDefault: 1. At least 1.
per_pageintegerDefault: 50. At least 1. At most 100.
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/customers/372a8e62-6d44-552f-9c0e-c1229b6478be/messages?page=1&per_page=50" \ -H "Authorization: Bearer $TRADESENDER_KEY"