E-Mail Activity
You must purchase additional email activity history to gain access to the Email Activity Feed API.
The Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages.
Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them.
See "Getting Started with the Email Activity Feed API" for help building queries and working with the API.
You can also work with email activity in the Activity section of the Twilio SendGrid App.
Filter messages by message ID
GET /v3/messages/{msg_id}
Base url: https://api.sendgrid.com
Get all of the details about the specified message.
Authentication
- API Key
Headers
Path Parameters
The ID of the message you are requesting details for.
default: NoneResponses
The 'From' email address used to deliver the message. This address should be a verified sender in your Twilio SendGrid account.
default: test0@example.comformat: emailA unique ID assigned to the message. This ID can be used to retrieve activity data for the specific message.
The email's subject line.
The intended recipient's email address.
format: emailThe message's status.
Allowed Values: processed, delivered, not_deliveredThe ID associated with a Twilio SendGrid email template used to format the message.
The unsubscribe group associated with this email.
minimum: 1Teammate's username
maxLength: 64minLength: 0pattern: ^$|^[A-Za-z0-9]+The ID of the API Key used to authenticate the sending request for the message.
maxLength: 50minLength: 3pattern: ^[A-Za-z0-9]+List of events related to email message
Name of event
Allowed Values: bounced, opened, clicked, processed, dropped, delivered, deferred, spam_report, unsubscribe, group_unsubscribe, group_resubscribeThe date when the event was processed
Explanation of what caused the message to be "bounced", "deferred", or "blocked". Usually contains error message from the server - e.g. message from gmail why mail was deferred.
maxLength: 1024Used with "deferred" events to indicate the attempt number out of 10. One "deferred" entry will exists under events array for each time a message was deferred with error message from the server.
maximum: 10minimum: 1Used with "clicked" event to indicate which url the user clicked.
pattern: ^((http[s]?|ftp):\/)?\/?([^:\/\s]+)((\/\w+)*\/)([\w\-\.]+[^#?\s]+)(.*)?(#[\w\-]+)?$Use to distinguish between types of bounces
Allowed Values: soft, hardClient recipient used to click or open message
The MX server that received the email. For example, mx.gmail.com
This is the IP of the user who sent the message.
format: ipv4Categories users associated to the message
JSON hash of key-value pairs associated with the message.
default: NullIP used to send to the remote Mail Transfer Agent.
format: ipv4Whether or not the outbound IP is dedicated vs shared
Allowed Values: dedicated, shared{
"from_email": "jane_doe@example.com",
"msg_id": "in aliquip id aliqua",
"subject": "est incididunt adipisicing pariatur",
"to_email": "send@test.com",
"status": "not_delivered",
"template_id": "123e4567-e89b-12d3-a456-426655440000",
"asm_group_id": 11376349,
"teammate": "",
"api_key_id": "sdfsdfsdf123",
"originating_ip": "2.3.4.5",
"events": [
{
"event_name": "bounced",
"processed": "2017-10-13T18:56:21Z",
"bounce_type": "soft",
"http_user_agent": "in tempor ex dolore est",
"mx_server": "quis proident",
"server_response": "some error message"
}
],
"categories": [
"hi",
"bye"
],
"unique_args": "{'key': 'value'}",
"outbound_ip": "1.2.3.4",
"outbound_ip_type": "dedicated"
}
Need some help?
We all do sometimes. Get help now from the Twilio SendGrid Support Team.
Running into a coding hurdle? Lean on the wisdom of the crowd by browsing the SendGrid tag on Stack Overflow or visiting Twilio's Stack Overflow Collective.