Skip to content
Last updated

View message history

You can track important events linked to sent emails, for example, whether the recipient opened the message, or clicked on a link within.

To view message history, do a GET request on /messagehistory/{message_ID}to retrieve the list of events linked to the email that was sent.

Example

# Run :
curl -s \
	-X GET \
	--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
	https://api.mailjet.com/v3/REST/messagehistory/$MESSAGE_ID

API Response

{
    "Count": 4,
    "Data": [
        {
            "EventAt": 1546958313,
            "EventType": "sent",
            ".........................."
        },
        {
            "EventAt": 1546958354,
            "EventType": "opened",
            ".........................."
        },
        {
            "EventAt": 1546958355,
            "EventType": "clicked",
            ".........................."
        }
    ],
    "Total": 4
}

You will see the event type, as well as a timestamp indicating when it happened.

Info

Since the API detects each email event, you are able to see multiple events of the same type, for example when the message is opened multiple times, or there are multiple link clicks.