Menu

Expand
Rate this page:

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 all messages

GET /v3/messages

Base url: https://api.sendgrid.com

Filter all messages to search your Email Activity. All queries must be URL encoded, and use the following format:

query={query_type}="{query_content}"

Once URL encoded, the previous query will look like this:

query=type%3D%22query_content%22

For example, to filter by a specific email, use the following query:

query=to_email%3D%22example%40example.com%22

Visit our Query Reference section to see a full list of basic query types and examples.

Authentication

  • API Key

Headers

Authorization
string
default: Bearer <<YOUR_API_KEY_HERE>>
required
Authorization
string
default: Bearer <<YOUR_API_KEY_HERE>>
required

Query String

query
string

Use the query syntax to filter your email activity.

default: None
required
limit
number

The number of messages returned. This parameter must be greater than 0 and less than or equal to 1000

default: 10

Responses

object
messages
array[object]
from_email
string

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: email
msg_id
string

A unique ID assigned to the message. This ID can be used to retrieve activity data for the specific message.

subject
string

The email's subject line.

to_email
string

The intended recipient's email address.

format: email
status
string

The message's status.

Allowed Values: processed, delivered, not_delivered
opens_count
integer

The number of times the message was opened.

clicks_count
integer

The number of times links in the message were clicked.

last_event_time
string

A timestamp of the last event received for the specific message in iso 8601 format.

object
errors
array[object]
required
message
string
object
errors
array[object]
message
string
        
        
        
        Filter Email Activity messages by from address

        Filter all messages

        Filter Email Activity messages by from address
        Rate this page:

        Need some help?

        We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the SendGrid tag on Stack Overflow.

              
              
              

              Thank you for your feedback!

              Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

              Sending your feedback...
              🎉 Thank you for your feedback!
              Something went wrong. Please try again.

              Thanks for your feedback!

              Refer us and get $10 in 3 simple steps!

              Step 1

              Get link

              Get a free personal referral link here

              Step 2

              Give $10

              Your user signs up and upgrade using link

              Step 3

              Get $10

              1,250 free SMSes
              OR 1,000 free voice mins
              OR 12,000 chats
              OR more