Skip to content
Last updated

Event types

Event object overview

All JSON event objects contain the following properties:

  • event: the event type
  • time: Unix timestamp of event
  • email: email address of recipient triggering the event
  • mj_campaign_id: internal Mailjet campaign ID associated to the message
  • mj_contact_id: internal Mailjet contact ID
  • customcampaign: value of the X-Mailjet-Campaign header when provided
  • MessageID: The unique message ID
  • CustomID: the custom ID, when provided at send time
  • Payload: the event payload, when provided at send time

Sent event

Dispatched when the destination SMTP server (gmail, hotmail, yahoo, etc) has accepted the message. Depending on your volume, it could dispatch a lot of events to your system, please make sure you have checked the Group Events Checkbox in the Event API user interface or that the /eventcallbackurl version property is set at2.

Sent event additional properties:

  • mj_message_id : The unique message ID as a string (deprecated, see MessageID)
  • smtp_reply: The raw SMTP response message

Sample sent event

{
  "event": "sent",
  "time": 1433333949,
  "MessageID": 19421777835146490,
  "Message_GUID": "1ab23cd4-e567-8901-2345-6789f0gh1i2j",
  "email": "api@mailjet.com",
  "mj_campaign_id": 7257,
  "mj_contact_id": 4,
  "customcampaign": "",
  "mj_message_id": "19421777835146490",
  "smtp_reply": "sent (250 2.0.0 OK 1433333948 fa5si855896wjc.199 - gsmtp)",
  "CustomID": "helloworld",
  "Payload": ""
}

Open event

Open event additional properties:

  • ip : IP address (can be IPv4 or IPv6) that triggered the event
  • `geo : country code of IP address (see list)
  • agent : User-Agent

Sample open event

{
  "event": "open",
  "time": 1433103519,
  "MessageID": 19421777396190490,
  "Message_GUID": "1ab23cd4-e567-8901-2345-6789f0gh1i2j",
  "email": "api@mailjet.com",
  "mj_campaign_id": 7173,
  "mj_contact_id": 320,
  "customcampaign": "",
  "CustomID": "helloworld",
  "Payload": "",
  "ip": "127.0.0.1",
  "geo": "US",
  "agent": "Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0"
}

Click event

Click event additional properties:

~url~ : the link that was clicked

Sample click event API Response

{
  "event": "click",
  "time": 1433334653,
  "MessageID": 19421777836302490,
  "Message_GUID": "1ab23cd4-e567-8901-2345-6789f0gh1i2j",
  "email": "api@mailjet.com",
  "mj_campaign_id": 7272,
  "mj_contact_id": 4,
  "customcampaign": "",
  "CustomID": "helloworld",
  "Payload": "",
  "url": "https://mailjet.com",
  "ip": "127.0.0.1",
  "geo": "FR",
  "agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_0) AppleWebKit/537.36"
}

Bounce event

Bounce event additional properties:

  • blocked : true if this bounce leads to the recipient being blocked
  • hard_bounce : true if error was permanent
  • error_related_to : see error table
  • error : see error table
  • comment : the raw SMTP error code, including descriptions of the reason for the bounce

Sample bounce event API Response

{
   "event": "bounce",
   "time": 1430812195,
   "MessageID": 13792286917004336,
   "Message_GUID": "1ab23cd4-e567-8901-2345-6789f0gh1i2j",
   "email": "bounce@mailjet.com",
   "mj_campaign_id": 0,
   "mj_contact_id": 0,
   "customcampaign": "",
   "CustomID": "helloworld",
   "Payload": "",
   "blocked": false,
   "hard_bounce": true,
   "error_related_to": "recipient",
   "error": "user unknown",
   "comment": "Host or domain name not found. Name service error for name=lbjsnrftlsiuvbsren.com type=A: Host not found"
}
Info

If you consider using this event to modify the status of your recipient subscription or viability , please take into account the value of the hard_bounce and error property. All bounce events may not have the same level of importance

Blocked event

Blocked event additional properties:

  • error_related_to : see error table
  • `error' : see error table

Sample blocked event API Response

{
  "event": "blocked",
  "time": 1430812195,
  "MessageID": 13792286917004336,
  "Message_GUID": "1ab23cd4-e567-8901-2345-6789f0gh1i2j",
  "email": "bounce@mailjet.com",
  "mj_campaign_id": 0,
  "mj_contact_id": 0,
  "customcampaign": "",
  "CustomID": "helloworld",
  "Payload": "",
  "error_related_to": "recipient",
  "error": "user unknown"
}
Info

If you consider using this event to modify the status of your recipient subscription, please take into account the value of the error property. All blocked events may not have the same reason and perpetuity on the status of the contact (i.e. duplicate in campaign indicates that the recipient message was blocked for the campaign and preblocked indicates that the recipient is blocked for all messages)

Spam event

Spam event additional properties:

source : indicates which feedback loop program reported this complaint.

Sample spam event API Response

{
  "event": "spam",
  "time": 1430812195,
  "MessageID": 13792286917004336,
  "Message_GUID": "1ab23cd4-e567-8901-2345-6789f0gh1i2j",
  "email": "bounce@mailjet.com",
  "mj_campaign_id": 0,
  "mj_contact_id": 0,
  "customcampaign": "",
  "CustomID": "helloworld",
  "Payload": "",
  "source": "JMRPP"
}

Unsub event

Unsub event additional properties:

  • mj_list_id : internal Mailjet List id for REST API access to lists management
  • ip : IP address (can be IPv4 or IPv6) that triggered the event
  • geo : country code of IP address (see list)
  • agent : User-Agent

Sample unsub event API Response

{
  "event": "unsub",
  "time": 1433334941,
  "MessageID": 20547674933128000,
  "Message_GUID": "1ab23cd4-e567-8901-2345-6789f0gh1i2j",
  "email": "api@mailjet.com",
  "mj_campaign_id": 7276,
  "mj_contact_id": 126,
  "customcampaign": "",
  "CustomID": "helloworld",
  "Payload": "",
  "mj_list_id": 1,
  "ip": "127.0.0.1",
  "geo": "FR",
  "agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36"
}