Event Messenger API
The Event Messenger API enables you to subscribe to receive Alexa events. 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 correctly. Currently, the only supported delivery channel for events is Amazon Simple Notification Service (SNS).
To use this API, you first create a subscription configuration, which defines a delivery channel that multiple subscriptions can use. You then create a subscription that specifies the type of event you want to subscribe to and which subscription configuration 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 a Login with Amazon (LWA) access token.
Operations
The Event Messenger API includes the following operations.
Operation | HTTP Method and URI |
---|---|
| |
| |
| |
| |
| |
| |
| |
|
Create a subscription configuration
Creates 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 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 |
String |
Yes |
Request body example
{
"deliveryChannels": [{
"type": "SNS",
"id": "arn:aws:sns:us-east-1:0123456789:AlexaEvents"
}]
}
Request body parameters
Parameter | Description | Type | Required |
---|---|---|---|
|
List of delivery mechanism configuration objects. |
Array of objects |
Yes |
|
Type of delivery channel. Valid values: |
String |
Yes |
|
Identifier of the channel the update is required on. Valid values: The Amazon Resource Name (ARN) of the SNS topic to which to publish events. |
String enum |
Yes |
Response
A successful response returns HTTP 201 Created
with the subscription configuration ID in the Location
header.
Response body example
The following example shows the body of a successful response.
{
"id": "amzn1.alexa.aem.subscription.configuration.123"
}
The following example shows the body of an error response.
{
"type": "ERROR_TYPE",
"message": "ERROR_MESSAGE"
}
Successful response body parameters
Parameter | Description | Type |
---|---|---|
|
Unique ID of the subscription configuration in UUID format. |
String |
Error response body parameters
Parameter | Description | Type |
---|---|---|
|
Type of error. |
String |
|
Description of the error. |
String |
HTTP status codes
Status | Description |
---|---|
|
The subscription configuration was successfully created. |
|
The request is invalid due to missing required fields, incorrect values, or malformed JSON. |
|
Authorization token is invalid, expired, or doesn't have access to the resource. |
|
The request couldn't complete because the client doesn't have permission to perform the operation. |
|
The request was throttled. We recommend that you retry after one second, back off exponentially until a 256-second wait, and retry every 256 seconds thereafter until you receive a response that isn't 429. |
|
A server-side error occurred. |
|
The service is temporarily unavailable and couldn't accept the request. |
Get a subscription configuration by ID
Gets 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 by configuration ID, you make a GET
request to the /v1/eventMessenger/subscriptionConfigurations/{id}
resource.
Request header example
GET /v1/eventMessenger/subscriptionConfigurations/amzn1.alexa.aem.subscription.configuration.123
Host: api.amazonalexa.com
Content-Type: application/json
Authorization: Bearer {access token}
Request header and path parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Header |
String |
Yes | |
|
Query |
Unique ID of the subscription configuration to get. This ID is returned by the Create a subscription configuration operation. |
String |
Yes |
Request body example
The request has no body.
Request body parameters
The request has no body.
Response
A successful response returns HTTP 200 OK
.
Response body example
The following example shows the body of a successful response.
{
"id": "amzn1.alexa.aem.subscription.configuration.123",
"deliveryChannels": [{
"type": "SNS",
"id": "arn.aws.sns::12345:us-east1:abc"
}]
}
The following example shows the body of an error response.
{
"type": "ERROR_TYPE",
"message": "ERROR_MESSAGE"
}
Successful response body parameters
Parameter | Description | Type |
---|---|---|
|
Unique ID of the subscription configuration in UUID format. |
String |
|
List of delivery mechanism configuration objects. |
Array of objects |
|
Type of delivery channel. Valid values: |
String |
|
Identifier of the channel the update is required on. Valid values: The Amazon Resource Name (ARN) of the SNS topic to which to publish events. |
String enum |
Error response body parameters
Parameter | Description | Type |
---|---|---|
|
Type of error. |
String |
|
Description of the error. |
String |
HTTP status codes
Status | Description |
---|---|
|
The subscription configuration was successfully retrieved. |
|
Invalid subscription configuration ID. |
|
Authorization token is invalid, expired, or doesn't have access to the resource. |
|
The request couldn't complete because the client doesn't have permission to perform the operation. |
|
The subscription configuration doesn't exist. |
|
The request was throttled. We recommend that you retry after one second, back off exponentially until a 256-second wait, and retry every 256 seconds thereafter until you receive a response that isn't 429. |
|
A server-side error occurred. |
|
The service is temporarily unavailable and couldn't accept the request. |
Get subscription configurations
Gets subscription configurations.
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 header example
Request subscription configurations by owner
GET /v1/eventMessenger/subscriptionConfigurations?owner=~caller
Host: api.amazonalexa.com
Content-Type: application/json
Authorization: Bearer {access token}
Request that uses pagination
GET /v1/eventMessenger/subscriptionConfigurations?owner=~caller&nextToken=6666611111&maxResults=20
Host: api.amazonalexa.com
Content-Type: application/json
Authorization: Bearer {access token}
Request header and path parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Header |
String |
Yes | |
|
Query |
A parameter that filters subscription configurations to only the subscriptions that the caller owns. |
String |
Yes |
|
Query |
Token to retrieve a specific page of the paginated results. If this token isn't present, the response contains the first page of results. |
String |
No |
|
Query |
Maximum number of results to return in the response body. This value must be greater than zero and less than or equal to 100. The default value is 20. |
Number |
No |
Request body example
The request has no body.
Request body parameters
The request has no body.
Response
A successful response returns HTTP 200 OK
.
Response body example
The following example shows the body of a successful response.
{
"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": null
}
}
The following example shows the body of an error response.
{
"type": "ERROR_TYPE",
"message": "ERROR_MESSAGE"
}
Successful response body parameters
Parameter | Description | Type |
---|---|---|
|
List of subscription configuration objects. |
Array of objects |
|
Unique ID of the subscription configuration in UUID format. |
String |
|
List of delivery mechanism configuration objects. |
Array of objects |
|
Type of delivery channel. Valid values: |
String |
|
Identifier of the channel the update is required on. Valid values: The Amazon Resource Name (ARN) of the SNS topic to which to publish events. |
String enum |
|
Pagination details. |
Object |
|
Token to retrieve a specific page of the pagination results. |
String |
Error response body parameters
Parameter | Description | Type |
---|---|---|
|
Type of error. |
String |
|
Description of the error. |
String |
HTTP status codes
Status | Description |
---|---|
|
The subscription configurations were successfully retrieved. |
|
The request is invalid due to missing required fields, incorrect values, or malformed JSON. |
|
Authorization token is invalid, expired, or doesn't have access to the resource. |
|
The request couldn't complete because the client doesn't have permission to perform the operation. |
|
The request was throttled. We recommend that you retry after one second, back off exponentially until a 256-second wait, and retry every 256 seconds thereafter until you receive a response that isn't 429. |
|
A server-side error occurred. |
|
The service is temporarily unavailable and couldn't accept the request. |
Delete a subscription configuration
Deletes a 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 header example
DELETE /v1/eventMessenger/subscriptionConfigurations/amzn1.alexa.aem.subscription.configuration.123
Host: api.amazonalexa.com
Content-Type: application/json
Authorization: Bearer {access token}
Request header and path parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Header |
String |
Yes | |
|
Query |
Unique ID of the subscription configuration to delete. This ID is returned by the Create a subscription configuration operation. |
String |
Yes |
Request body example
The request has no body.
Request body parameters
The request has no body.
Response
A successful response returns HTTP 204 No Content
.
Response body example
A successful response has no body.
The following example shows the body of an error response.
{
"type": "ERROR_TYPE",
"message": "ERROR_MESSAGE"
}
Successful response body parameters
A successful response has no body.
Error response body parameters
Parameter | Description | Type |
---|---|---|
|
Type of error. |
String |
|
Description of the error. |
String |
HTTP status codes
Status | Description |
---|---|
|
The request was successfully processed. |
|
The subscription configuration ID is invalid. |
|
The subscription configuration can't be deleted because it has one or more subscriptions associated with it. |
|
Authorization token is invalid, expired, or doesn't have access to the resource. |
|
The request couldn't complete because the client doesn't have permission to perform the operation. |
|
The subscription configuration doesn't exist. |
|
The request was throttled. We recommend that you retry after one second, back off exponentially until a 256-second wait, and retry every 256 seconds thereafter until you receive a response that isn't 429. |
|
A server-side error occurred. |
|
The service is temporarily unavailable and couldn't accept the request. |
Create a subscription
Creates a subscription, which specifies the type of event you want to subscribe to and which subscription configuration to use.
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 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 |
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.{id}"
}
}
}
Request body parameters
Parameter | Description | Type | Required |
---|---|---|---|
|
Configuration ID of the subscription configuration created by using Create a subscription configuration. |
String |
Yes |
|
Object that contains event details. |
Object |
Yes |
|
Represents the category an event belongs to. All automation-related events share the same namespace. Example: |
String |
Yes |
|
An event name within the namespace. Example: |
String |
Yes |
|
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. For details, see Unit entity and Skill entity. |
No |
Unit entity
The unit entity is required for the following events:
Alexa.Automation.Execution.Completion
Alexa.Skill.Interaction.Failure
Alexa.Enterprise.Subscription.Activation
Alexa.Endpoint.Lifecycle.SetupCompletion
Parameter | Description | Type | Required |
---|---|---|---|
|
Object that represents the details of a unit. |
Object |
No |
|
Unit entity type. Valid values: |
String enum |
No |
|
Unit identifier |
String |
No |
|
Parent unit, which contains the parent ID. |
Object |
No |
Resource entity
The Resource entity is required for the following events:
Alexa.Role.Management.Assignment
Alexa.Role.Management.Revocation
Parameter | Description | Type | Required |
---|---|---|---|
|
Object that represents the details of the resource. |
Object |
Yes |
|
Resource entity type. Valid values: "Resource" |
String |
Yes |
|
The type of the resource. Valid value: "Unit" |
String |
Yes |
|
The unique identifier for the resource |
String |
Yes |
Skill entity
The skill entity is required for the following events:
Alexa.Skill.Interaction.Failure
Parameter | Description | Type | Required |
---|---|---|---|
|
Object that represents the details of a skill. |
Object |
No |
|
Skill entity type. Valid values: |
String enum |
No |
|
Skill identifier |
String |
No |
Response
A successful response returns HTTP 201 Created
with the subscription ID in the Location
header.
Response body example
The following example shows the body of a successful response.
{
"id": "amzn1.alexa.aem.subscription.123"
}
The following example shows the body of an error response.
{
"type": "ERROR_TYPE",
"message": "ERROR_MESSAGE"
}
Successful response body parameters
Parameter | Description | Type |
---|---|---|
|
Unique subscription ID in UUID format. |
String |
Error response body parameters
Parameter | Description | Type |
---|---|---|
|
Type of error. |
String |
|
Description of the error. |
String |
HTTP status codes
Status | Description |
---|---|
|
The subscription was successfully created. |
|
Invalid subscription configuration ID. |
|
Authorization token is invalid, expired, or doesn't have access to the resource. |
|
The request couldn't complete because the client doesn't have permission to perform the operation. If you are subscribing to receive skill fault events for a skill that is new, we might not have that skill tagged for events, which will generate a 403 error. In this case, reach out to your solution architect to properly tag your skill. |
|
The request was throttled. We recommend that you retry after one second, back off exponentially until a 256-second wait, and retry every 256 seconds thereafter until you receive a response that isn't 429. |
|
A server-side error occurred. |
|
The service is temporarily unavailable and couldn't accept the request. |
Get a subscription by ID
Gets a subscription by subscription ID.
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 header example
GET /v1/eventMessenger/subscriptions/amzn1.alexa.aem.subscription.123
Host: api.amazonalexa.com
Content-Type: application/json
Authorization: Bearer {access token}
Request header and path parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Header |
String |
Yes | |
|
Query |
Unique ID of the subscription to get. |
String |
Yes |
Request body example
The request has no body.
Request body parameters
The request has no body.
Response
A successful response returns HTTP 200 OK
.
Response body example
The following example shows the body of a successful response.
{
"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.{id}"
}
}
}
The following example shows the body of an error response.
{
"type": "ERROR_TYPE",
"message": "ERROR_MESSAGE"
}
Successful response body parameters
Parameter | Description | Type |
---|---|---|
|
Unique subscription ID in UUID format. |
String |
|
Configuration ID of the subscription configuration created by using Create a subscription configuration. |
String |
|
Object that contains event details. |
Object |
|
Represents the category an event belongs to. All automation-related events share the same namespace. Example: |
String |
|
An event name within the namespace. Example: |
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. For details, see Unit entity and Skill entity. |
Error response body parameters
Parameter | Description | Type |
---|---|---|
|
Type of error. |
String |
|
Description of the error. |
String |
HTTP status codes
Status | Description |
---|---|
|
The subscription was successfully retrieved. |
|
The subscription ID is invalid. |
|
Authorization token is invalid, expired, or doesn't have access to the resource. |
|
The request couldn't complete because the client doesn't have permission to perform the operation. |
|
The subscription doesn't exist. |
|
The request was throttled. We recommend that you retry after one second, back off exponentially until a 256-second wait, and retry every 256 seconds thereafter until you receive a response that isn't 429. |
|
A server-side error occurred. |
|
The service is temporarily unavailable and couldn't accept the request. |
Get subscriptions
Gets subscriptions.
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 header example
Request subscriptions by owner
GET /v1/eventMessenger/subscriptions?owner=~caller
Host: api.amazonalexa.com
Content-Type: application/json
Authorization: Bearer {access token}
Request subscriptions by entities.unit.id and entities.unit.type
GET /v1/eventMessenger/subscriptions?owner=~caller&entities.unit.id=amzn1.alexa.unit.did.123&entities.unit.type=Unit
Host: api.amazonalexa.com
Content-Type: application/json
Authorization: Bearer {access token}
Request that uses pagination
GET /v1/eventMessenger/subscriptions?owner=~caller&nextToken=6666611111&maxResults=20
Host: api.amazonalexa.com
Content-Type: application/json
Authorization: Bearer {access token}
Request header and path parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Header |
String |
Yes | |
|
Query |
A parameter that filters subscriptions to only the subscriptions that the caller owns. |
String |
Yes |
|
Query |
A parameter that filters subscriptions to only those that are associated with a particular |
String |
No. See description. |
|
Query |
A parameter that filter subscriptions to only those that are associated with a particular |
String |
No. See description. |
|
Query |
A parameter that filters subscriptions to only those that are associated with a particular parent |
String |
No. See description. |
|
Query |
A parameter that filters subscriptions to only those that are associated with a particular parent |
String |
No. See description. |
|
Query |
A parameter that filters subscriptions to only those that are associated with a particular |
String |
No |
|
Query |
A parameter that filters subscriptions to only those that are associated with a particular |
String |
No |
|
Query |
Token to retrieve a specific page of the paginated results. If this token isn't present, the response contains the first page of results. |
String |
No |
|
Query |
Maximum number of results to return in the response body. This value must be greater than zero and less than or equal to 100. The default value is 20. |
Number |
No |
Request body example
The request has no body.
Request body parameters
The request has no body.
Response
A successful response returns HTTP 200 OK
.
Response body example
The following example shows the body of a successful response.
{
"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.{id}"
}
}
}
],
"paginationContext": {
"nextToken": null
}
}
The following example shows the body of an error response.
{
"type": "ERROR_TYPE",
"message": "ERROR_MESSAGE"
}
Successful response body parameters
Parameter | Description | Type |
---|---|---|
|
Pagination details. |
Object |
|
Token to retrieve a specific page of the pagination results. |
String |
|
List of subscription objects. |
Array of objects |
|
Unique subscription ID in UUID format. |
String |
|
Configuration ID of the subscription configuration created by using Create a subscription configuration. |
String |
|
Object that contains event details. |
Object |
|
Represents the category an event belongs to. All automation-related events share the same namespace. Example: |
String |
|
An event name within the namespace. Example: |
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. For details, see Unit entity and Skill entity. |
Error response body parameters
Parameter | Description | Type |
---|---|---|
|
Type of error. |
String |
|
Description of the error. |
String |
HTTP status codes
Status | Description |
---|---|
|
The subscriptions were successfully retrieved. |
|
Invalid subscription ID. |
|
Authorization token is invalid, expired, or doesn't have access to the resource. |
|
The request couldn't complete because the client doesn't have permission to perform the operation. |
|
The subscription doesn't exist. |
|
The request was throttled. We recommend that you retry after one second, back off exponentially until a 256-second wait, and retry every 256 seconds thereafter until you receive a response that isn't 429. |
|
A server-side error occurred. |
|
The service is temporarily unavailable and couldn't accept the request. |
Delete subscription
Deletes a 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 header example
DELETE /v1/eventMessenger/subscriptions/amzn1.alexa.aem.subscription.123
Host: api.amazonalexa.com
Content-Type: application/json
Authorization: Bearer {access token}
Request header and path parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Header |
String |
Yes | |
|
Query |
Unique ID of the subscription to delete. |
String |
Yes |
Request body example
The request has no body.
Request body parameters
The request has no body.
Response
A successful response returns HTTP 204 No Content
.
Response body example
A successful response has no body.
The following example shows the body of an error response.
{
"type": "ERROR_TYPE",
"message": "ERROR_MESSAGE"
}
Successful response body parameters
A successful response has no body.
Error response body parameters
Parameter | Description | Type |
---|---|---|
|
Type of error. |
String |
|
Description of the error. |
String |
HTTP status codes
Status | Description |
---|---|
|
The request was successfully processed. |
|
Invalid subscription ID. |
|
Authorization token is invalid, expired, or doesn't have access to the resource. |
|
The request couldn't complete because the client doesn't have permission to perform the operation. |
|
The subscription doesn't exist. |
|
The request was throttled. We recommend that you retry after one second, back off exponentially until a 256-second wait, and retry every 256 seconds thereafter until you receive a response that isn't 429. |
|
A server-side error occurred. |
|
The service is temporarily unavailable and couldn't accept the request. |
Related topics
Last updated: Dec 13, 2023