Event Messenger REST API Reference
Use the Event Messenger REST API to subscribe to events from Alexa. These events enable you to take actions, such as raising alarms and retrying operations. For example, you might want to create an alarm for skill time-out events so that you can make sure that the web services that power your skill are running. Alexa publishes events to the Amazon Simple Notification Service (SNS).
First, you create an SNS topic, and then you create a subscription configuration to define a delivery channel for Alexa events. Last, you create a subscription that specifies the type of event you want to subscribe to and which delivery channel to use. For details about how to use the Event Messenger API, see Receive Events for Alexa Smart Properties.
API endpoint
In the request header, set Host
to the following, depending on the region of your organization: https://api.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 Event Messenger API includes the following operations.
Operation | HTTP Method and URI |
---|---|
| |
| |
| |
| |
| |
| |
| |
|
Create subscription configuration
Create a subscription configuration, which defines a delivery channel that multiple subscriptions can use.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US |
US |
US |
Request
To create a subscription configuration, you make a POST
request to the /v1/eventMessenger/subscriptionConfigurations
resource.
Request path and header example
POST /v1/eventMessenger/subscriptionConfigurations
Host: api.amazonalexa.com
Content-Type: application/json
Authorization: Bearer {access token}
Request header and path parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
{
"deliveryChannels": [{
"type": "SNS",
"id": "arn:aws:sns:us-east-1:0123456789:AlexaEvents"
}]
}
Request body properties
Property | Description | Type | Required |
---|---|---|---|
|
List of delivery mechanism configuration objects. |
Array of objects |
Yes |
|
Type of delivery channel. |
String |
Yes |
|
Identifies the delivery channel. |
String |
Yes |
Response
A successful response returns HTTP 201 Created
, along with the subscription configuration ID.
The response header also includes a link to the subscription configuration ID in the Location
parameter.
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 the body of a successful response.
{
"id": "amzn1.alexa.aem.subscription.configuration.123"
}
Response body properties
Property | Description | Type |
---|---|---|
|
Unique ID of the subscription configuration. |
String |
HTTP status codes
Status | Description |
---|---|
|
Subscription configuration created successfully. |
|
Indicates that one or more properties in the request body aren't valid. |
|
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. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as the number of requests per unit of time, exceeded. You can retry the request by using exponential back-off. |
|
Error occurred on the server. You can retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
Delete subscription configuration
Deletes the specified subscription configuration.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US |
US |
US |
Request
To delete a subscription confirmation, you make a DELETE
request to the /v1/eventMessenger/subscriptionConfigurations/{id}
resource.
Request path and header example
DELETE /v1/eventMessenger/subscriptionConfigurations/{id}
Host: api.amazonalexa.com
Content-Type: application/json
Authorization: Bearer {access token}
Request header and path parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Path |
Unique ID of the subscription configuration to delete. |
String |
Yes |
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
The request has no body.
Request body properties
The request has no body.
Response
A successful response returns HTTP 204 No Content
.
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 |
---|---|
|
Subscription configuration deleted successfully. |
|
Indicates that one or more properties in the request body aren't valid.
|
|
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. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as number of requests per unit of time, exceeded. Retry the request by using exponential back-off. |
|
Error occurred on the server. Retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
Get subscription configuration by ID
Get a subscription configuration by configuration ID.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US |
US |
US |
Request
To get a subscription configuration, you make a GET
request to the /v1/eventMessenger/subscriptionConfigurations/{id}
resource.
Request path and header example
GET /v1/eventMessenger/subscriptionConfigurations/{id}
Host: api.amazonalexa.com
Content-Type: application/json
Authorization: Bearer {access token}
Request header and path parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Path |
Unique ID of the subscription configuration. |
String |
Yes |
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
The request has no body.
Request body properties
The request has no body.
Response
A successful response returns HTTP 200 OK
, along with the details of the specified subscription configuration.
On error, the response returns the appropriate HTTP status code and includes a response body with an Error object.
Response body example
{
"id": "amzn1.alexa.aem.subscription.configuration.123",
"deliveryChannels": [{
"type": "SNS",
"id": "arn.aws.sns::12345:us-east1:abc"
}]
}
Response body properties
Property | Description | Type |
---|---|---|
|
Unique ID of the subscription configuration. |
String |
|
List of delivery mechanism configuration objects. |
Array of objects |
|
Type of delivery channel. |
String |
|
Identifies the delivery channel. |
String |
HTTP status codes
Status | Description |
---|---|
|
Response body contains the subscription configuration details. |
|
Indicates that one or more properties in the request body aren't valid.
|
|
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. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as number of requests per unit of time, exceeded. Retry the request by using exponential back-off. |
|
Error occurred on the server. Retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
List subscription configurations
Get a list of subscription configurations owned by the caller.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US |
US |
US |
Request
To get subscription configurations, you make a GET
request to the /v1/eventMessenger/subscriptionConfigurations
resource.
Request path and header example
GET /v1/eventMessenger/subscriptionConfigurations?owner={owner}&maxResults={maxResults}&nextToken={nextToken}
Host: api.amazonalexa.com
Content-Type: application/json
Authorization: Bearer {access token}
Request header and path parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Query |
Filter results to those subscription configurations associated with the owner. |
String |
Yes |
|
Query |
Maximum number of results to return in the response. |
Integer |
No |
|
Query |
Token from the previous response. |
String |
No |
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
The request has no body.
Request body properties
The request has no body.
Response
A successful response returns HTTP 200 OK
, along with a list of subscription configurations owned by the caller.
On error, the response returns the appropriate HTTP status code and includes a response body with an Error object.
Response body example
{
"results": [{
"id": "amzn1.alexa.aem.subscription.configuration.123",
"deliveryChannels": [{
"type": "SNS",
"id": "arn.aws.sns::12345:us-east1:abc"
}]
},
{
"id": "amzn1.alexa.aem.subscription.configuration.456",
"deliveryChannels": [{
"type": "SNS",
"identifier": "arn.aws.sns::12345:us-east1:abc"
}]
}
],
"paginationContext": {
"nextToken": someToken.1
}
}
Response body properties
Property | Description | Type |
---|---|---|
|
List of subscription configurations owned by the caller. |
Array of objects |
|
Unique ID of the subscription configuration. |
String |
|
List of delivery mechanism configuration objects. |
Array of objects |
|
Type of delivery channel. |
String |
|
Identifies the delivery channel. |
String |
|
(Optional) Indicates whether there are more results to return. |
Object |
|
Included when the response is truncated. Use this value in a subsequent request. |
String |
HTTP status codes
Status | Description |
---|---|
|
Response body contains the list of subscription configurations. |
|
Indicates that one or more properties in the request body aren't valid.
|
|
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. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as number of requests per unit of time, exceeded. Retry the request by using exponential back-off. |
|
Error occurred on the server. Retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
Create subscription
Create a subscription that specifies the type of event you want to subscribe to and which subscription configuration to use. For a list of events, see Event Schemas.
HTTP 403 Forbidden
, contact your Alexa Smart Properties solution architect to properly tag your skill for events.This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US |
US |
US |
Request
To create a subscription, you make a POST
request to the /v1/eventMessenger/subscriptions
resource.
Request path and header example
POST /v1/eventMessenger/subscriptions
Host: api.amazonalexa.com
Content-Type: application/json
Authorization: Bearer {access token}
Request header and path parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
{
"subscriptionConfigurationId": "amzn1.alexa.aem.subscription.configuration.123",
"eventType": {
"namespace": "Alexa.Automation.Execution",
"name": "Completion"
},
"entities": {
"unit": {
"type": "Unit",
"id": "amzn1.alexa.unit.did.101"
}
}
}
Request body properties
Property | Description | Type | Required |
---|---|---|---|
|
Unique ID of the subscription configuration to which to create the subscription. |
String |
Yes |
|
Event details. |
Object |
Yes |
|
Represents the category to which an event belongs. |
String |
Yes |
|
Event name within the namespace. |
String |
Yes |
|
Entities that define resources or experiences from which the event is generated, or which are directly related to the event. The entity provides additional context and metadata for the event that you can use for routing and access control. |
Object of entities |
No |
Response
A successful response returns HTTP 201 Created
, along with the subscription ID. The response header also includes a link to the subscription ID in the Location
parameter.
On error, the response returns the appropriate HTTP status code and includes a response body with an Error object.
Response body example
{
"id": "amzn1.alexa.aem.subscription.123"
}
Response body properties
Property | Description | Type |
---|---|---|
|
Unique ID of the subscription. |
String |
HTTP status codes
Status | Description |
---|---|
|
Subscription created successfully. |
|
Indicates that one or more properties in the request body aren't valid. |
|
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. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as the number of requests per unit of time, exceeded. You can retry the request by using exponential back-off. |
|
Error occurred on the server. You can retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
Delete subscription
Deletes the specified subscription.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US |
US |
US |
Request
To delete a subscription, you make a DELETE
request to the /v1/eventMessenger/subscriptions/{id}
resource.
Request path and header example
DELETE /v1/eventMessenger/subscriptions/{id}
Host: api.amazonalexa.com
Content-Type: application/json
Authorization: Bearer {access token}
Request header and path parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Query |
Unique ID of the subscription. |
String |
Yes |
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
The request has no body.
Request body properties
The request has no body.
Response
A successful response returns HTTP 204 No Content
.
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 |
---|---|
|
Subscription deleted successfully. |
|
Indicates that one or more properties in the request body aren't valid.
|
|
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. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as number of requests per unit of time, exceeded. Retry the request by using exponential back-off. |
|
Error occurred on the server. Retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
Get subscription by ID
Gets the details of a the specified subscription.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US |
US |
US |
Request
To get a subscription, you make a GET
request to the /v1/eventMessenger/subscriptions/{id}
resource.
Request path and header example
GET /v1/eventMessenger/subscriptions/{id}
Host: api.amazonalexa.com
Content-Type: application/json
Authorization: Bearer {access token}
Request header and path parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Query |
Unique ID of the subscription. |
String |
Yes |
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
The request has no body.
Request body properties
The request has no body.
Response
A successful response returns HTTP 200 OK
, along with the details of the specified subscription.
On error, the response returns the appropriate HTTP status code and includes a response body with an Error object.
Response body example
{
"id": "amzn1.alexa.aem.subscription.123",
"subscriptionConfigurationId": "amzn1.alexa.aem.subscription.configuration.123",
"eventType": {
"namespace": "Alexa.Automation.Execution",
"name": "Completion"
},
"entities": {
"unit": {
"type": "Unit",
"id": "amzn1.alexa.unit.did.101"
}
}
}
Response body properties
Property | Description | Type |
---|---|---|
|
Unique ID of the subscription. |
String |
|
Unique ID of the subscription configuration. |
String |
|
Event details. |
Object |
|
Represents the category to which an event belongs. |
String |
|
Event name within the namespace. |
String |
|
Entities that define resources or experiences from which the event is generated, or which are directly related with the event. The entity provides additional context and metadata for the event that you can use for routing and access control. |
Object of entities |
HTTP status codes
Status | Description |
---|---|
|
Response body contains the subscription details. |
|
Indicates that one or more properties in the request body aren't valid.
|
|
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. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as number of requests per unit of time, exceeded. Retry the request by using exponential back-off. |
|
Error occurred on the server. Retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
List subscriptions
Get a list of subscriptions owned by the caller.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US |
US |
US |
Request
To get subscriptions, you make a GET
request to the /v1/eventMessenger/subscriptions
resource.
Request path and header example
GET /v1/eventMessenger/subscriptions?owner={owner}&entities.unit.id={unitId}&entities.unit.type={entityType}&entities.unit.parent.id={parentId}&entities.unit.parent.type={parentType}&eventType.namespace={nameSpace}&eventType.names={name}&maxResults={maxResults}&nextToken={nextToken}
Host: api.amazonalexa.com
Content-Type: application/json
Authorization: Bearer {access token}
Request header and path parameters
Include one of the following sets of query parameters: owner
, entities.unit.id and entities.unit.type
, or entities.unit.parent.id and entities.unit.parent.type
.
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Query |
Filter results to those subscriptions with the owner. |
String |
No |
|
Query |
Filter subscriptions to those associated with a particular unit. |
String |
No |
|
Query |
Filter subscriptions to those associated with a particular entity type. |
String |
No |
|
Query |
Filter subscriptions to those associated with a particular parent unit. |
String |
No |
|
Query |
Filter subscriptions to those associated with a particular entity type. |
String |
No. |
|
Query |
Filter subscriptions to those associated with a particular event namespace. |
String |
No |
|
Query |
Filter subscriptions to those associated with a particular event name. |
String |
No |
|
Query |
Maximum number of results to return in the response. |
Integer |
No |
|
Query |
Token from the previous response. |
String |
No |
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
The request has no body.
Request body properties
The request has no body.
Response
A successful response returns HTTP 200 OK
, along with a list of subscriptions.
On error, the response returns the appropriate HTTP status code and includes a response body with an Error object.
Response body example
{
"results": [{
"id": "amzn1.alexa.aem.subscription.123",
"subscriptionConfigurationId": "amzn1.alexa.aem.subscription.configuration.123",
"eventType": {
"namespace": "Alexa.Automation.Execution",
"name": "Completion"
},
"entities": {
"unit": {
"type": "Unit",
"id": "amzn1.alexa.unit.did.101"
}
}
}
],
"paginationContext": {
"nextToken": null
}
}
Response body properties
Property | Description | Type |
---|---|---|
|
List of subscription objects. |
Array of objects |
|
Unique ID of the subscription. |
String |
|
Unique ID of the subscription configuration. |
String |
|
Event details. |
Object |
|
Represents the category to which an event belongs. |
String |
|
Event name within the namespace. |
String |
|
Entities that define resources or experiences from which the event is generated, or which are directly related with the event. The entity provides additional context and metadata for the event that you can use for routing and access control. |
Object of entities |
|
(Optional) Indicates whether there are more results to return. |
Object |
|
Included when the response is truncated. Use this value in a subsequent request. |
String |
HTTP status codes
Status | Description |
---|---|
|
Response body contains the list of subscriptions. |
|
Indicates that one or more properties in the request body aren't valid.
|
|
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. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as number of requests per unit of time, exceeded. Retry the request by using exponential back-off. |
|
Error occurred on the server. Retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
Object definitions
The Event Messenger API defines the following objects.
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 of error that occurred. |
String |
|
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 |
Resource entity
Use the Resource
entity for the following events:
Alexa.Role.Management.Assignment
Alexa.Role.Management.Revocation
Property | Description | Type | Required |
---|---|---|---|
|
Resource details. |
Object |
Yes |
|
Type of entity. |
String |
Yes |
|
Type of resource. |
String |
Yes |
|
Unique identifier for the resource |
String |
Yes |
Skill entity
Use the Skill
entity for the following events:
Alexa.Skill.Interaction.Failure
Property | Description | Type | Required |
---|---|---|---|
|
Details of the skill. |
Object |
No |
|
Type of entity. |
String |
No |
|
Skill identifier. |
String |
No |
Unit entity
Use the Unit
entity for the following events:
Alexa.Automation.Execution.Completion
Alexa.Skill.Interaction.Failure
Alexa.Enterprise.Subscription.Activation
Alexa.Endpoint.Lifecycle.SetupCompletion
Property | Description | Type | Required |
---|---|---|---|
|
Details of the unit. |
Object |
No |
|
Entity type. |
String |
No |
|
Unit identifier. |
String |
No |
|
Identifies the parent unit. |
Object |
No |
Related topics
Last updated: Nov 26, 2024