Amazon SNS · AsyncAPI Specification

Amazon SNS Notifications

Version 2010-03-31

Amazon Simple Notification Service (SNS) delivers notifications to subscribed endpoints when messages are published to topics. This AsyncAPI specification describes the notification messages that SNS delivers to HTTP/HTTPS endpoints, Amazon SQS queues, AWS Lambda functions, email recipients, and SMS recipients. When a message is published to an SNS topic, the service fans out the message to all confirmed subscribers using the delivery format appropriate for each protocol. HTTP/S endpoints receive a JSON-formatted POST request containing the message along with metadata such as the topic ARN, message ID, timestamp, and a signature for verification.

View Spec View on GitHub AWSEmailMessagingNotificationsPub/SubPush NotificationsSMSAsyncAPIWebhooksEvents

Channels

/sns/http-notification
subscribe receiveHttpNotification
Receive SNS notification via HTTP/HTTPS
HTTP/HTTPS notification delivery channel. When a message is published to a topic with HTTP/S subscribers, SNS sends an HTTP POST request to each confirmed subscriber endpoint containing the notification in JSON format. The endpoint must return a 2xx status code to acknowledge receipt. SNS includes headers such as x-amz-sns-message-type, x-amz-sns-message-id, and x-amz-sns-topic-arn.
/sns/sqs-notification
subscribe receiveSqsNotification
Receive SNS notification via SQS
Amazon SQS notification delivery channel. When a message is published to a topic with SQS subscribers, SNS delivers the notification as an SQS message to the subscribed queue. The SQS message body contains the SNS notification in JSON format unless raw message delivery is enabled, in which case only the published message body is delivered.
/sns/lambda-notification
subscribe receiveLambdaNotification
Receive SNS notification via Lambda invocation
AWS Lambda notification delivery channel. When a message is published to a topic with Lambda subscribers, SNS invokes the Lambda function asynchronously with an event containing an array of SNS records. Each record includes the notification message, subject, timestamp, message attributes, and topic ARN.
/sns/email-notification
subscribe receiveEmailNotification
Receive SNS notification via email
Email notification delivery channel. When a message is published to a topic with email subscribers, SNS delivers the message as an email. For the email protocol, the message body is sent as the email body with the optional Subject as the email subject line. For the email-json protocol, the full JSON notification object is sent as the email body.
/sns/sms-notification
subscribe receiveSmsNotification
Receive SNS notification via SMS
SMS notification delivery channel. When a message is published to a topic with SMS subscribers or directly to a phone number, SNS delivers the message as a text message. The SMS message contains only the published message text, truncated to fit SMS size limits.

Messages

Notification
SNS Notification Message
Standard notification message delivered to HTTP/S, SQS, and email-json subscribers
SubscriptionConfirmation
Subscription Confirmation Message
Sent to HTTP/S endpoints when a new subscription is created
UnsubscribeConfirmation
Unsubscribe Confirmation Message
Sent to HTTP/S endpoints when a subscription is deleted
LambdaEvent
SNS Lambda Invocation Event
Event payload delivered to Lambda function subscribers
SmsMessage
SNS SMS Message
Text message delivered to SMS subscribers

Servers

https
snsRegional https://sns.{region}.amazonaws.com
Amazon SNS regional endpoint. SNS delivers notifications from the region where the topic is created.