Skip to main content

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

  • pageinteger

    Default: 1. At least 1.

  • per_pageinteger

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

  • kindstring

    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.

  • automaticboolean

  • fromstring (date)

  • tostring (date)

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/messages?page=1&per_page=50&kind=invoice_reminder" \
  -H "Authorization: Bearer $TRADESENDER_KEY"