Filter messages by ID
Use this endpoint to retrieve detailed events for a specific message. You can obtain an sg_message_id from the Filter All Messages endpoint. This endpoint provides comprehensive details and the full event timeline for a single email.
GET/v3/logs/{sg_message_id}
Base url: https://api.sendgrid.com (for global users and subusers)
Base url: https://api.eu.sendgrid.com (for EU regional subusers)
Get all of the details about the specified message.
Bearer <<YOUR_API_KEY_HERE>>The ID of the message you are requesting details for.
Optional
For requests authenticated as the parent account, this argument must be passed if the desired message belongs to a subuser.
Detailed information for the specified message, including all events related to the message
Optional
The 'From' email address used to deliver the message. This may not be a valid email address.
Optional
A unique ID assigned to the message.
Optional
The email's subject line.
Optional
The intended recipient's email address.
Optional
A summary of the message status based on which events have occurred.
| Event | Status | | -- | -- | | processed | processed | | drop, cancel_drop | dropped | | deferred | deferred | | bounce | bounced | | bounce(type=block) | blocked | | delivered, click, open | delivered |
processeddelivereddeferreddroppedbouncedblockedOptional
The ID associated with a Twilio SendGrid email template used to format the message.
Optional
The unsubscribe group associated with this email.
Optional
Teammate's username.
^$|^[A-Za-z0-9]+Max length: 64Optional
The ID of the API Key used to authenticate the sending request for the message.
^$|^[A-Za-z0-9_-]+Max length: 50Optional
All events recorded for this message. Most recent events will be returned upto the maximum of 100 events.
100Optional
The IP address of the user who sent the message.
Optional
The categories associated with the message.
Optional
Custom key-value pairs associated with the message.
Optional
The IP address used to send to the remote Mail Transfer Agent.
Optional
The type of outbound IP address used to send the message.
dedicatedOptional
The ID of the marketing campaign associated with the message.
Optional
The name of the marketing campaign associated with the message.
Optional
The ID of the split associated with the marketing campaign.
Optional
The version of the marketing campaign associated with the message.
1const client = require("@sendgrid/client");2client.setApiKey(process.env.SENDGRID_API_KEY);34const sg_message_id =5"zYMjsUZORvevDeb4hlcVjg.recvd-6f5cbff5dc-k58s2-1-68CB0DC2-12.0";67const request = {8url: `/v3/logs/${sg_message_id}`,9method: "GET",10};1112client13.request(request)14.then(([response, body]) => {15console.log(response.statusCode);16console.log(response.body);17})18.catch((error) => {19console.error(error);20});