Skip to main content

Hi all,

I can’t see, inside the API Reference, a way to list messages based on specific criteria such as from/to adresses, dates, or even a Conversation ID

It seems Events could be used for this intent but I can’t find a way to filter the events I list based on the type = message (seems type can’t be used as query filter ‘q’)…

Is there any way you can think of to identify whether or not, a message has been received:

  • Within 24hours
  • From a specific email address
  • Containing a specific keyword inside the subject or body o

Thanks you so much for your help guys !

Cheers,

Sacha

Hey Sacha,

There’s currently no support for specifically listing Messages based on any criteria other than getting all messages in a given conversation (see list conversation messages endpoint). 

You can use the conversation search endpoint to build complex searches (looking at dates/recipients/keywords/etc) however this returns a list of conversations, not messages. 

The conversation search endpoint is the most effective way to filter based on your criteria. As an example, this query would search for conversations which contain a message;

  1. Created after the stated timestamp (2024-05-28)
  2. From the specified email (sender@example.com)
  3. Containing the keyword (“keyword”)

GET /conversations/search/after:1716879600 from:sender@example.com keyword

URL-encoded, that would look like;

GET /conversations/search/after%3A1716879600%20from%3Asender%40example.com%20keyword'


Reply