Skip to main content

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

  • pageinteger

    Default: 1. At least 1.

  • per_pageinteger

    Default: 50. At least 1. At most 100.

Responses

200Paginated emails sent to customers.

  • dataarray of objectrequired

    Each item(14)
    • idstring (uuid)required

    • account_idstring (uuid)required

    • customer_idstring (uuid)required

    • kindstringrequired

      What 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)required

      The address it was sent to, which may not be the one on the customer.

    • subjectstringrequired

      The email's subject line.

    • bodystringrequired

      The 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 null

      The quote the email was about.

    • invoice_idstring (uuid) or null

      The invoice the email was about.

    • visit_idstring (uuid) or null

      The visit the email was about. The first of them, when one email covered several.

    • membership_idstring (uuid) or null

      The member who sent it. Null when it was sent automatically.

    • sent_atstring (date-time)required

      When the email was handed over for delivery. A message is written once and never changes.

    • created_atstring (date-time)required

    • updated_atstring (date-time)required

  • metaobjectrequired

    Fields(4)
    • pageintegerrequired

      At least 1.

    • per_pageintegerrequired

      At least 1. At most 100.

    • totalintegerrequired

      At least 0.

    • total_pagesintegerrequired

      At 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"