I feel like this should be a relatively simple thing to do but have not been able to find a way to connect the dots and nothing comes up on google. How do I get the contacts who have been sent an email in the last week?
Hi Derek!
You can find contacts who has been sent a campaign in the last week with advanced search.
- Click Contacts on the left menu.
- Click the search field, then click “Advanced Search.”
- The segment builder will appear. Click the conditions dropdown.
- Click “Actions” > “Has been sent.” And you should be able to add a date range to search.
- Next, click the value field to select a specific campaign to search for contacts who were sent that campaign. Or, you can choose “Any campaign” to look for all contacts who were sent any campaign.
- Click the “Search” button.
Sorry, I meant in the API! Do you by chance know how to do it with the API
I have the same problem. I would need to retrieve contacts who are associated to a certain campaign, but there seems to be no proper endpoint in the API for this.
Hi Sanna!
You can use the Campaign Messages API! Here are the steps:
Step 1: Get Recent Campaigns First, fetch campaigns from the last week using the /api/3/campaigns endpoint with date filtering:
Step 2: Get Messages for Each Campaign For each campaign, use the /api/3/messages endpoint to get all sent messages:
Step 3: Extract Contact Information Each message response includes the contact ID. You can then batch fetch contact details using:
You can also use contact activities and the /api/3/contacts/{id}/contactActivities endpoint and filter for email activities, but this requires checking each contact individually, which is less efficient for bulk operations.