Notifications REST API Reference


Use the Alexa Notifications REST API to send notifications to your Alexa Smart Properties (ASP) guests or residents. You can choose from voice and visual announcements, device notifications, and persistent visual alerts.

Notification types

The Notifications API can deliver notifications to up to one hundred different units in a single request. You can specify one of the following notification types:

  • Device notification – For Alexa-enabled devices without screens, the device notification is a yellow ring and a chime sound. For devices with screens, the device notification is a banner and a persistent notification indicator.
  • Announcement – For devices with and without screens, Alexa makes announcements by voice. For devices with screens, the announcement displays as a message on the screen.
  • Persistent visual alert – Persistent visual alerts are available for Alexa-enabled devices with screens. A persistent visual alert is a notification that displays on the screen until it expires or the guest or resident dismisses it.

API endpoint

Based on the country of your organization, set the Host parameter in the request header to one of the following API endpoints.

Country Endpoint

CA, US

https://api.amazonalexa.com

DE, ES, FR, IT, UK

https://api.eu.amazonalexa.com

JP

https://api.fe.amazonalexa.com

Authentication

Each API request must have an authorization header whose value is the access token retrieved from Login with Amazon (LWA). For details, see Manage API Access.

Operations

The Notifications API includes the following operations.

Operation HTTP Method and URI

Send notifications

POST /v3/notifications

Delete notification by unit ID

DELETE /v3/notifications?recipients.id={unitid}&recipients.type={type}&notification.variants.type={variantType}

Delete all notifications

POST /v3/notifications/delete

Query persistent visual alerts

POST /v3/notifications/query

Send notifications

Send a notification to each of the specified recipients. You can send one notification type at a time. If a persistent visual alert is active, you can't send another persistent visual alert until the active one expires.

This operation is available in the following countries.

Healthcare Hospitality Senior Living Core

US

US, UK, FR, CA, IT, DE, ES, JP

US, UK, FR, CA, IT, DE, ES, JP

US

Request

To send a notification, you make a POST request to the /v3/notifications resource.

Request path and header example

Copied to clipboard.

POST /v3/notifications HTTP/1.1
Host: api.amazonalexa.com
Accept: application/json
Authorization: Bearer {access token}

Request path and header parameters

Parameter Located in Description Type Required

access token

Header

Access token for the customer.
Set to an LWA token.

String

Yes

Request body examples

The following examples show the notification request body for each notification type.

Request body properties

Property Description Type Required

recipients

List of recipients of the notification.
Maximum number of items in the list: 100.

Array of objects

Yes

recipients[].type

Type of recipient.
Valid value: Unit.

String

Yes

recipients[].id

Identifies the unit.
Formatted as Amazon Common Identifier (ACI), amzn1.alexa.unit.did.{id}.

String

Yes

notification

Describes the notification.

Object

Yes

notification.variants

List of notification variants.

Array of objects

Yes

notification.variants[].type

Notification delivery type. For details about the types, see Notification types.
Valid values: DeviceNotification, Announcement, or PersistentVisualAlert.

String

Yes

notification.variants[].content

Content for the notification. The specific fields for this object depend on the type of notification.

Content object

Yes

notification.dismissalTime

Expiration date and time of the notification. Valid for notification type of PersistentVisualAlert only.
The notification remains on the device until this time, unless the guest or resident dismisses the notification manually.
Defined in ISO 8601 format, YYYY-MM-DDThh:mm:ssZ.

String

No

notification.referenceId

Reference ID of the newly created notification.
Valid for notification type of PersistentVisualAlert only.
The referenceId is unique for each notification in a unit. Include to update an already-delivered persistent visual alert.

String

No

Response

A successful response returns HTTP 202 Accepted, along with the list of notifications published and failed. If the entire request fails, the response returns the appropriate HTTP status code and includes a response body with an Error object.

Response body examples

The following response example shows a notification sent to all recipients successfully.

The following response example shows a persistent notification sent to some recipients successfully and failed to send to other recipients.

The following response example shows a notification that failed to send to all recipients. In this example, the failure reasons are different for each recipient.

Response body properties

Property Description Type

type

Short description of the result.

String

message

Detailed description of the result.

String

successResults

List of successful notification results.

Array of objects

successResults[].id

Identifies the unit notified.
Formatted as Amazon Common Identifier (ACI), amzn1.alexa.unit.did.{id}.

String

successResults[].referenceId

Unique reference identifier for the unit and notification. If a problem occurs, Amazon can use this value to troubleshoot the problem.

For notifications of type DeviceNotification, the referenceId is a unique ID for each notification created for each unit. In other words, there's a one-to-one relationship between the referenceId and a notification.

For notifications of type PersistentVisualAlert, you can provide the referenceId when you send the notification. Here, all units have the same referenceId, forming a one-to-many relationship between referenceId and the notification.

String

errors

(Optional) List of error results.

Array

errors[].id

Identifies the unit where the notiification failed.
Formatted as Amazon Common Identifier (ACI), amzn1.alexa.unit.did.{id}.

String

errors[].status

HTTP response code for the failed request item.

Integer

errors[].errorCode

Short error code.

String

errors[].errorDescription

Human-readable error message. The error message appears only for debugging and logging purposes. You must not share it with the customer. No business logic should depend on the content of the error description.

String

paginationContext

Indicates whether there are more results to return.

Object

paginationContext.nextToken

Included when the response is truncated.
Use this value in a subsequent request. If no more results, nextToken is null.

String

HTTP status codes

Status Description

202 Accepted

Response body contains list of success and error results.

400 Bad Request

Indicates that one or more properties in the request body aren't valid.

401 Unauthorized

Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource.

403 Forbidden

Indicates that the authorization token is valid, but the requested operation isn't allowed.

404 Not Found

Requested resource not found.

429 Too Many Requests

Permitted rate limit, specified as the number of requests per unit of time, exceeded. You can retry the request by using exponential back-off.

500 Server Error

Error occurred on the server. You can retry the request by using exponential back-off.

503 Service Unavailable

Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request.

Delete notification by unit ID

Delete all notifications of the specified type from the specified unit.

This operation is available in the following countries.

Healthcare Hospitality Senior Living Core

US

US, UK, FR, CA, IT, DE, ES, JP

US, UK, FR, CA, IT, DE, ES, JP

US

Request

To remove notifications, you make a DELETE request to the /v3/notifications resource.

Request path and header example

Copied to clipboard.

DELETE /v3/notifications?recipients.id={unitid}&recipients.type={recipientType}&notification.variants.type={variantType}
Host: api.amazonalexa.com
Content-Type: application/json
Authorization: Bearer {access token}

Request path and header parameters

Parameter Located in Description Type Required

unitid

Query

Identifies the unit.
Formatted as Amazon Common Identifier (ACI), amzn1.alexa.unit.did.{id}.

String

Yes

recipientType

Query

Type of recipient.
Valid value: Unit.

String

Yes

variantType

Query

Notification delivery type.
Valid values: PersistentVisualAlert, DeviceNotification.

String

Yes

access token

Header

Access token for the customer.
Set to an LWA token.

String

Yes

Request body example

The request has no body.

Request body properties

The request has no body.

Response

A successful response returns HTTP 202 Accepted. On error, the response returns the appropriate HTTP status code and includes a response body with an Error object.

Response body example

The response has no body.

Response body properties

The response has no body.

HTTP status codes

Status Description

202 Accepted

All notifications deleted from specified unit.

400 Bad Request

Indicates that one or more properties in the request body aren't valid.

401 Unauthorized

Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource.

403 Forbidden

Indicates that the authorization token is valid, but the requested operation isn't allowed.

404 Not Found

Requested resource not found.

429 Too Many Requests

Permitted rate limit, specified as the number of requests per unit of time, exceeded. You can retry the request by using exponential back-off.

500 Server Error

Error occurred on the server. You can retry the request by using exponential back-off.

503 Service Unavailable

Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request.

Delete all notifications

Delete all notifications associated with the specified units.

This operation is available in the following countries.

Healthcare Hospitality Senior Living Core

US

US, UK, FR, CA, IT, DE, JP

US, UK, FR, CA, IT, DE, JP

US

Request

To delete notifications, you make a DELETE request to the /v3/notifications/delete resource.

Request path and header example

Copied to clipboard.

POST /v3/notifications/delete
Host: api.amazonalexa.com
Content-type: application/json
Authorization: Bearer {access token}

Request path and header parameters

Parameter Located in Description Type Required

access token

Header

Access token for the customer.
Set to an LWA token.

String

Yes

Request body example

Copied to clipboard.

{
    "recipients": [{
            "type": "Unit",
            "id": "amzn1.alexa.unit.did.101"
        },
        {
            "type": "Unit",
            "id": "amzn1.alexa.unit.did.102"
        }
    ],
    "notificationTypes": ["PersistentVisualAlert"]
}

Request body properties

Property Description Type Required

recipients

List of recipients of the notification.
Maximum number of items in the list: 100.

Array of objects

Yes

recipients[].type

Type of recipient.
Valid value: Unit.

String

Yes

recipients[].id

Identifies the unit from which to delete notifications.
Formatted as Amazon Common Identifier (ACI), amzn1.alexa.unit.did.{id}.

String

Yes

notificationTypes

Type of notification to delete.
Maximum size: 1.
Valid values: PersistentVisualAlert, DeviceNotification.

Array of strings

Yes

Response

A successful response returns HTTP 202 Accepted. On error, the response returns the appropriate HTTP status code and includes a response body with an Error object.

Response body examples

On success, the response has no body.

The following example shows the response when a specified unit ID is invalid.

The following example shows the response when you're not authorized to operate on one or more unit IDs.

Response body properties

On success, the response has no body.

On error, the response body includes the following properties.

Property Description Type

type

Short description of the result.

String

message

Detailed description of the result.

String

errors

(Optional) List of error results.

Array

errors[].id

Identifies the unit where the notiification failed.
Formatted as Amazon Common Identifier (ACI), amzn1.alexa.unit.did.{id}.

String

errors[].status

HTTP response code for the failed request item.

Integer

errors[].errorCode

Short error code.

String

errors[].errorDescription

Human-readable error message. The error message appears only for debugging and logging purposes. You must not share it with the customer. No business logic should depend on the content of the error description.

String

HTTP status codes

Status Description

202 Accepted

Deletion of all notifications accepted and processing.

400 Bad Request

Indicates that one or more properties in the request body aren't valid.

401 Unauthorized

Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource.

403 Forbidden

Indicates that the authorization token is valid, but the requested operation isn't allowed.

404 Not Found

Requested resource not found.

429 Too Many Requests

Permitted rate limit, specified as the number of requests per unit of time, exceeded. You can retry the request by using exponential back-off.

500 Server Error

Error occurred on the server. You can retry the request by using exponential back-off.

503 Service Unavailable

Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request.

Query persistent visual alerts

Query for persistent visual alerts in a list of units.

This operation is available in the following countries.

Healthcare Hospitality Senior Living Core

US

US, UK, FR, CA, IT, DE, ES, JP

US, UK, FR, CA, IT, DE, ES, JP

US

Request

To get the alerts, you make a POST request to the /v3/notifications/query resource.

Request path and header example

Copied to clipboard.

POST /v3/notifications/query HTTP/1.1
Host: api.amazonalexa.com
Accept: application/json
Authorization: Bearer {access token}

Request path and header parameters

Parameter Located in Description Type Required

access token

Header

Access token for the customer.
Set to an LWA token.

String

Yes

Request body examples

The following example gets active persistent visual alert notifications for one or more units.

The following example gets active persistent visual alert notifications for one of the specified reference IDs.

Request parameters

Property Description Type Required

query

Filtering conditions. You can filter on recipent ID, recipient type, or reference ID.
Include one of the and or or properties.

The query must adhere to the following rules:

  • The query must match one of the general structures shown in the request body examples.
  • The query can only have one key and operation or one key or operation.
  • The only allowed condition is match.

Array of objects

Yes

query.and

List of conditions to apply with a logical AND operation.
You can include the match property or another list of or filtering conditions that include the match property. These conditions are JSON-flattened with dot operator.
Example: {"and": [{"DSN": "DSN1234"}, {"UnitId": "Unit1234"}]}

A query.and must meet to the following criteria:

  • Maximum size for and: 1–3 items.
  • Valid match conditions for and:
    recipients.type set to Unit,
    notifications.variants.type set to PersistentVisualAlert.
  • Maximum size for and.or: 1–100 items.
  • Valid match conditions for and.or:
    recipients.id set to unit ID.

Array of objects

No

query.or

List of conditions to apply with a logical OR operation.
You can include the match property. These conditions are JSON-flattened with dot operator.
Example: {"or": [{"DSN": "DSN1234"}, {"DSN": "DSN5678"}]}

A query.or must meet to the following criteria:

  • Maximum size for and.or: 1–100 items.
  • Valid match condition: notification.reference.id

Array of objects

No

paginationContext

Pagination information. Include if iterating over a paginated response. If omitted, the first page of results are returned.

Object

No

paginationContext.maxResults

Maximum number of results to return in the response. Valid values: 1–100. Default: 10.

Integer

No

paginationContext.nextToken

Identifies the next set of data to return from a previous response. Include if iterating over a paginated response. Set to null otherwise.

String

No

Response

A successful response returns HTTP 200 OK, along with the list of results that match the query. On error, the response returns the appropriate HTTP status code and includes a response body with an Error object.

Response body example

The following example shows a successful response.

{
    "successResults": [{
        "recipients": [{
            "type": "Unit",
            "id": "amzn1.alexa.unit.did.101"
        }],
        "notification": {
            "variants": [{
                "type": "PersistentVisualAlert",
                "content": {
                    "variants": [{
                        "type": "V0Template",
                        "values": [{
                            "locale": "en-US",
                            "document": {
                                "type": "Link",
                                "src": "doc://alexa/apl/documents/enterprise/notifications/persistentvisualalert/textWrappingTemplate"
                            },
                            "datasources": {
                                "displayText": {
                                    "primaryText": "Example notification primary text.",
                                    "secondaryText": "Example notification text."
                                },
                                "background": {
                                    "backgroundImageSource": "https://www.example.com/image.jpg"
                                }
                            }
                        }]
                    }]
                },
                "dismissalTime": "2021-04-30T10:00:00.00Z"
            }],
            "referenceId": "example-ref-id-1 "
        }
    }],
    "paginationContext": {
        "nextToken": "someToken.2"
    }
}

Response body parameters

Property Description Type

successResults

List of successful notification results.

Array of objects

successResults[].recipients[].type

Type of recipient.
Valid value: Unit.

String

successResults[].recipients[].id

Identifies the unit.
Formatted as Amazon Common Identifier (ACI), amzn1.alexa.unit.did.{id}.

String

successResults[].notification

Describes the notification.

Object

successResults[].notification.variants

List of notification variants.

Array of objects

successResults[].notification.variants[].type

Notification delivery type.
Valid value: PersistentVisualAlert.

String

successResults[].notification.variants[].content

Content for the persistent visual alert.

Content object

successResults[].notification.dismissalTime

Expiration date and time of the notification.
Defined in ISO 8601 format, YYYY-MM-DDThh:mm:ssZ.

String

successResults[].referenceId

Reference ID of the notification.
This value is either a custom ID or a UUID generated by the Send notifications operation.

String

paginationContext

Indicates whether there are more results to return.

Object

paginationContext.nextToken

Included when the response is truncated.
Use this value in a subsequent request. If no more results, nextToken is null.

String

HTTP status codes

Status Description

200 OK

Response body contains list of matched results.

400 Bad Request

Indicates that one or more properties in the request body aren't valid.

401 Unauthorized

Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource.

403 Forbidden

Indicates that the authorization token is valid, but the requested operation isn't allowed.

404 Not Found

Requested resource not found.

429 Too Many Requests

Permitted rate limit, specified as the number of requests per unit of time, exceeded. You can retry the request by using exponential back-off.

500 Server Error

Error occurred on the server. You can retry the request by using exponential back-off.

503 Service Unavailable

Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request.

Persistent visual alert templates

When you define a persistent visual alert, you include an APL template to define the data for the alert. You specify the template in the notification.variants[].content.variants[].values[].document.src property of the Send notifications request body. Then set the fields for the template in the notification.variants[].content.variants[].values[].datasources object.

About background images

For each of these templates, you can provide a background image with the background.backgroundImageSource property. The template scales the image uniformly up or down to completely fill the screen ("best-fill"). As a result, if there is a mismatch between the aspect ratio of the image and the device screen, the image might get cut off.

For best results with images, consider the following recommendations:

  • Avoid images with text that extends to the edges of the image, as this text might be truncated due to the scaling.
  • If possible, test your images on the same device types used in your units.
  • If separate units contain different devices, consider targeting the different units with separate persistent visual alerts so that you can optimize the images for the devices. This strategy works when all the devices in a given unit have the same aspect ratio.
  • By default, the templates apply a scrim to the background image to make the text over the image easier to read. If the scrim makes the image too dark, you can turn it off by setting the background.colorOverlay property for the template to false.

You can provide images in PNG or JPG format. The image files can't exceed 400 KB in size.

Text wrapping template data source

The text wrapping template has the following properties within the notification.variants[].content.variants[].values[].datasources object.

Property name Description Type Required?

attribution.attributionImageSource

URL for the attribution image to display. Provide either attributionImageSource or attributionText, but not both.

String

No

attribution.attributionText

Attribution text displayed under the other text fields. Provide either attributionText or attributionImageSource, but not both.

String

No

background.backgroundImageSource

URL for the background image. When choosing images, see the recommendations in About background images.

String

No

background.colorOverlay

When true, the template applies a scrim to the background image to make it easier to read the text displayed over the image.

Boolean

No, defaults to true when not set.

displayText.headerText

Header text displayed before all the other text fields.

String

No

displayText.hintText

Hint text displayed at the bottom of the screen.

String

No

displayText.primaryText

Primary text to display. This text displays in a larger font than the rest of the text.

String

Yes

displayText.secondaryText

Secondary text displayed under the primary text in a smaller font.

String

No

displayText.tertiaryText

Tertiary text displayed next to the secondary text.

String

No

Media template data source

The media template has the following properties within the notification.variants[].content.variants[].values[].datasources object.

Property name Description Type Required?

attribution.attributionImageSource

URL for the attribution image to display. Provide either attributionImageSource or attributionText, but not both.

String

No

attribution.attributionText

Attribution text displayed under the other text fields. Provide either attributionText or attributionImageSource, but not both.

String

No

background.backgroundImageSource

URL for the background image. When choosing images, see the recommendations in About background images.

String

No

background.colorOverlay

When true, the template applies a scrim to the background image to make it easier to read the text displayed over the image.

Boolean

No, defaults to true when not set.

displayText.headerText

Header text displayed before all the other text fields.

String

No

displayText.hintText

Hint text displayed at the bottom of the screen.

String

No

displayText.primaryText

Primary text to display. This text displays in a larger font than the rest of the text.

String

Yes

displayText.secondaryText

Secondary text displayed under the primary text in a smaller font.

String

No

displayText.tertiaryText

Tertiary text displayed next to the secondary text.

String

No

thumbnail.thumbnailImageSource

URL for the image thumbnail to display next to the text fields.

String

No

Rating template data source

The rating template has the following properties within the notification.variants[].content.variants[].values[].datasources object.

Property name Description Type Required?

background.backgroundImageSource

URL for the background image. When choosing images, see the recommendations in About background images.

String

No

background.colorOverlay

When true, the template applies a scrim to the background image to make it easier to read the text displayed over the image.

Boolean

No, defaults to true when not set.

displayText.headerText

Header text displayed before all the other text fields.

String

No

displayText.hintText

Hint text displayed at the bottom of the screen.

String

No

displayText.primaryText

Primary text to display. This text displays in a larger font than the rest of the text.

String

Yes

displayText.ratingNumber

Number of stars for the rating. The rating number can be between one and five, and can include half stars, such as 3.5.

Number between one and five

Yes

displayText.ratingText

Brief text to give context to the star rating. Must be fewer than eight characters.

String

Yes

thumbnail.thumbnailImageSource

URL for the image thumbnail to display.

String

No

Object definitions

The Notification API defines the following objects.

Content object

The Content object defines the notification text or APL document. The specific fields for this object depend on the delivery type of notification that you set in the notification.variants[].type property: DeviceNotification, Announcement, or PersistentVisualAlert

Property Description Type Required

variants

Locale-specific notification content.

Array of objects

Yes

variants[].type

Type of content.
Valid values:

  • SpokenText – Localized text input. Valid for DeviceNotification and Announcement delivery types.
  • V0TemplateAlexa Presentation Language (APL) document that displays content on a device with a screen. Valid for PersistentVisualAlert delivery type.

String

Yes

variants[].values

Notification content. Include for all notification types.
Each element in the array represents a localized version of the notification.

Array of objects

Yes

variants[].values[].locale

Locale in which to render the spoken text, in BCP-47 format. The locale must include both the language and country or region, for example: en-US.

String

Yes

variants[].values[].text

Spoken text in plain text format. Include when the notification type is DeviceNotification or Announcement.
Maximum length: 1024 characters or 2048 bytes.

String

No

variants[].values[].document

Defines the APL document to display. Include when the notification type is PersistentVisualAlert.

Object

No

variants[].values[].document.type

Type of APL document to display. Include when the notification type is PersistentVisualAlert.
Valid value: Link.

String

No

variants[].values[].document.src

APL template to display. Include when the notification type is PersistentVisualAlert.
Valid values:

  • Text wrappingdoc://alexa/apl/documents/enterprise/notifications/persistentvisualalert/textWrappingTemplate
  • Media thumbnaildoc://alexa/apl/documents/enterprise/notifications/persistentvisualalert/mediaThumbnailTemplate
  • Ratingdoc://alexa/apl/documents/enterprise/notifications/persistentvisualalert/ratingTemplate

String

No

variants[].values[].datasources

Data for the specified src document. Include when the notification type is PersistentVisualAlert.
The specific data depends on the template that you set for the document.src property. For details, see the following references:

Object

No

Error object

The Error object defines the error type and message included in the response when an error occurs.

The following example shows the response body.

{
    "type": "BAD_REQUEST",
    "message": "The request is malformed or is missing any required parameters."
}
Property Description Type

type

Type of error that occurred.
For specific error types, see the HTTP status code table for each operation.

String

message

Human-readable error message. The error message appears only for debugging and logging purposes. You must not share it with the customer. No business logic should depend on the content of the error message.

String


Was this page helpful?

Last updated: Dec 04, 2024