Skip to content

aws.sesv2.get_message_insights

Example SQL Queries

SELECT * FROM
aws.sesv2.get_message_insights
WHERE
"message_id" = 'VALUE';

Description

Provides information about a specific message, including the from address, the subject, the recipient address, email tags, as well as events associated with the message.

You can execute this operation no more than once per second.

Table Definition

Column NameColumn Data Type
message_id Required Input Column

A unique identifier for the message.

VARCHAR
_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

email_tags

A list of tags, in the form of name/value pairs, that were applied to the email you sent, along with Amazon SES Auto-Tags.

STRUCT(
"name" VARCHAR,
"value" VARCHAR
)[]
Show child fields
email_tags[]
Show child fields
email_tags[].name

The name of the message tag. The message tag name has to meet the following criteria:

  • It can only contain ASCII letters (a–z, A–Z), numbers (0–9), underscores (_), or dashes (-).

  • It can contain no more than 256 characters.

email_tags[].value

The value of the message tag. The message tag value has to meet the following criteria:

  • It can only contain ASCII letters (a–z, A–Z), numbers (0–9), underscores (_), or dashes (-).

  • It can contain no more than 256 characters.

from_email_address

The from address used to send the message.

VARCHAR
insights

A set of insights associated with the message.

STRUCT(
"destination" VARCHAR,
"isp" VARCHAR,
"events" STRUCT(
"timestamp" TIMESTAMP_S,
"type" VARCHAR,
"details" STRUCT(
"bounce" STRUCT(
"bounce_type" VARCHAR,
"bounce_sub_type" VARCHAR,
"diagnostic_code" VARCHAR
),
"complaint" STRUCT(
"complaint_sub_type" VARCHAR,
"complaint_feedback_type" VARCHAR
)
)
)[]
)[]
Show child fields
insights[]
Show child fields
insights[].destination

The recipient of the email.

insights[].events[]
Show child fields
insights[].events[].details

Details about bounce or complaint events.

Show child fields
insights[].events[].details.bounce

Information about a Bounce event.

Show child fields
insights[].events[].details.bounce.bounce_sub_type

The subtype of the bounce, as determined by SES.

insights[].events[].details.bounce.bounce_type

The type of the bounce, as determined by SES. Can be one of UNDETERMINED, TRANSIENT, or PERMANENT

insights[].events[].details.bounce.diagnostic_code

The status code issued by the reporting Message Transfer Authority (MTA). This field only appears if a delivery status notification (DSN) was attached to the bounce and the Diagnostic-Code was provided in the DSN.

insights[].events[].details.complaint

Information about a Complaint event.

Show child fields
insights[].events[].details.complaint.complaint_feedback_type

The value of the Feedback-Type field from the feedback report received from the ISP.

insights[].events[].details.complaint.complaint_sub_type

Can either be null or OnAccountSuppressionList. If the value is OnAccountSuppressionList, SES accepted the message, but didn't attempt to send it because it was on the account-level suppression list.

insights[].events[].timestamp

The timestamp of the event.

insights[].events[].type

The type of event:

  • SEND - The send request was successful and SES will attempt to deliver the message to the recipient’s mail server. (If account-level or global suppression is being used, SES will still count it as a send, but delivery is suppressed.)

  • DELIVERY - SES successfully delivered the email to the recipient's mail server. Excludes deliveries to the mailbox simulator, and those from emails addressed to more than one recipient.

  • BOUNCE - Feedback received for delivery failures. Additional details about the bounce are provided in the Details object. Excludes bounces from the mailbox simulator, and those from emails addressed to more than one recipient.

  • COMPLAINT - Complaint received for the email. Additional details about the complaint are provided in the Details object. This excludes complaints from the mailbox simulator, those originating from your account-level suppression list (if enabled), and those from emails addressed to more than one recipient.

  • OPEN - Open event for emails including open trackers. Excludes opens for emails addressed to more than one recipient.

  • CLICK - Click event for emails including wrapped links. Excludes clicks for emails addressed to more than one recipient.

insights[].isp

The recipient's ISP (e.g., Gmail, Yahoo, etc.).

subject

The subject line of the message.

VARCHAR