Automation REST API Reference
Use the Automation REST API to specify operations for Alexa to automatically perform tasks for users in Alexa Smart Properties (ASP). An automation consists of a trigger, operations, and optional conditions.
About automations
An automation template describes the behavior of an automated task without any unit or endpoint specifics. The template represents an abstract automation experience with placeholders. After you create a template, you set up automations from the template with unit-specific customizations. For example, you can create a template that plays music at a placeholder time every day. And then create the automation for room 401 from the template, so that every morning at 8 AM, Alexa plays music on the Echo device in room 401. Automation templates won't invoke any operations. Instead, you must construct automations from the template to have a working automation.
An automation enables an Alexa-connected device (like an Echo device) to automatically perform tasks for users. For example, at sunset, turn on the kitchen light. An automation includes one trigger, at least one operation, and optional conditions.
A trigger is a change in state, an event, or a fact to invoke an automation. Automations in ASP supports the following triggers: Utterances, Time, Sunrise, Sunset.
An operation is an action or task that Alexa invokes when trigger conditions are met. Automations in ASP supports the following operations: Notifications, Brightness (only in Smart Home devices), Power On/Off, Set Volume, Stop Media, Set SetPoint temperature on a thermostat, Do Not Disturb On/Off.
The operation property is constructed as a tree, therefore each serial, parallel, and operation object is considered as a tree node. Each parallel node should have less than 90 nodes (including all parallel, serial, and operation nodes). Regardless of whether the operations property has parallel or serial nodes or not, there should be less than 150 nodes in total. If you have two 90 parallel nodes, then those 180 nodes exceed the 150 limit.
A condition is one or more rules that Alexa evaluates, and then if the rules are true, Alexa invokes the associated operations.
API endpoint
The endpoint of the Automation API is 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 Automation API supports the following types of operations:
- Template management – Create and manage automation templates to use in property units.
- Automation management – Create and manage automations within a unit based on a template.
Template management
Operation | HTTP Method and URI |
---|---|
| |
| |
| |
|
Automation management
Operation | HTTP Method and URI |
---|---|
| |
| |
| |
| |
|
Create automation template
Create an automation template that's owned by the user the LWA token represents. At this time, only the owner of the template can create automations from the template.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US |
US |
US |
Request
To create an automation template, you make a POST
request to the /v2/automations/templates
resource.
Request path and header example
POST /v2/automations/templates 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 |
---|---|---|---|---|
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
{
"template":{
"trigger":{
"type": "Alexa.Automation.Trigger.Voice.CustomUtterance",
"version": "1.0",
"payload": {
"utterances": ["${data.customUtterance.text}", "utterance B", "utterance C"],
"locale": "en-US"
}
},
"operations":{
"serial":[
{
"operation":{
"type": "Alexa.Automation.Operation.Notification.Notify",
"version": "1.0",
"payload": {
"notification": {
"variants": [{
"type": "Announcement",
"content": {
"variants": [{
"type": "SpokenText",
"values": [{
"locale": "en-US",
"text": "Happy hour is starting now in the pool area!"
}]
}]
}
}]
}
}
}
}
]
}
},
"dataDefinition":{
"customUtterance":{
"type":"object",
"required":[
"text"
],
"properties":{
"text":{
"type":"string",
"minLength":1
}
}
}
},
"friendlyName":{
"value":{
"text":"Test template"
}
}
}
Request body properties
Parameter | Description | Type | Required |
---|---|---|---|
|
Automation template |
Object |
Yes |
|
Trigger of the automation template. |
Trigger object |
Yes |
|
Operations of the automation template. |
Object |
Yes |
|
List of operations that Alexa invokes serially. |
Array of Operation objects |
No |
|
List of operations that Alexa invokes in parallel. |
Array of Operation objects |
No |
|
A single operation. |
Operation object |
No |
|
Definition of data parameters inside of the automation template. Each of the keys in this object is a definition of a parameter. |
Object |
No |
|
Developer-facing name of the automation template. |
Object |
No |
|
Friendly name text. |
Object |
No |
|
Name of the automation template. |
String |
No |
Response
A successful response returns HTTP 201 Created
along with the template ID.
On error, the response returns the appropriate HTTP status code and includes a response body with an Error object.
Response body example
{
"templateId": "amzn1.alexa.automation.template.1"
}
Response body parameters
Parameter | Description | Type |
---|---|---|
|
Unique identifier of the automation template. |
String |
HTTP status codes
Status | Description |
---|---|
|
Automation template successfully created. |
|
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 automation template
Deletes the automation template associated with the specified template ID. Only the automation template owner can delete the template.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US |
US |
US |
Request
To delete an automation template, you make a DELETE
request to the /v2/automations/templates/{templateId}
resource.
Request path and header example
DELETE /v2/automations/templates/{templateId} 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 |
---|---|---|---|---|
|
Path |
Identifier of the automation template 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
.
If there are automation instances based on this template, Alexa returns HTTP 400 Bad Request
.
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 parameters
The response has no body.
HTTP status codes
Status | Description |
---|---|
|
Template 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 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. |
Get automation template
Gets the automation template associated with the specified template ID.
The caller must be the owner of the automation template.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US |
US |
US |
Request
To get an automation template, you make a GET request to the /v2/automations/templates/{templateId}
resource.
Request path and header example
GET /v2/automations/templates/{templateId} HTTP/1.1
Host: api.amazonalexa.com
Accept: application/json
Authorization: Bearer {LWA Token}
Request path and header parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Path |
Identifier of the automation template. |
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 requested template.
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 response.
{
"templateId":"amzn1.alexa.automation.template.1",
"template":{
"trigger":{
"type":"CustomUtterance",
"version":"1.0",
"payload":{
"utterance":"${data.customUtterance.text}",
"locale":"en-US"
}
},
"operations":{
"serial":[
{
"operation":{
"type":"AlexaAnnouncement",
"version":1.0,
"payload":{
"content":[
{
"locale":"en-US",
"speak":{
"type":"text",
"value":"Hello"
}
}
]
}
}
}
]
}
},
"dataDefinition":{
"customUtterance":{
"type":"object",
"required":[
"text"
],
"properties":{
"text":{
"type":"string",
"minLength":1
}
}
}
},
"friendlyName":{
"value":{
"text":"Test template"
}
}
}
Response body parameters
Parameter | Description | Type |
---|---|---|
|
Identifier of the automation template. |
String |
|
Trigger of the automation template. |
Trigger object |
|
Operations of the automation template. |
Object |
|
List of operations that Alexa invokes serially. |
Array of Operation objects |
|
List of operations that Alexa invokes in parallel. |
Array of Operation objects |
|
A single operation. |
Operation object |
|
Definition of data parameters inside of the automation template. Each of the keys in this object is a definition of a parameter. |
Object |
|
Developer-facing name of the automation template. |
Object |
|
Friendly name text. |
Object |
|
Name of the automation template. |
String |
HTTP status codes
Status | Description |
---|---|
|
Response body contains the requested template. |
|
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. |
List automation templates
Lists the automation templates. Alexa returns all templates owned by the caller.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US |
US |
US |
Request
To list automation templates, you make a GET request to the /v2/automations/templates
resource.
Request path and header example
GET /v2/automations/templates?expand=all&maxResults={maxResults}&nextToken={nextToken} 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 |
---|---|---|---|---|
|
Query |
Get expanded information about each template. If |
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 templates.
On error, the response returns the appropriate HTTP status code and includes a response body with an Error object.
Response body examples
The following example shows a response without expand
set to all
.
The following example shows a response with expand
set to all
.
Response body parameters
Parameter | Description | Type |
---|---|---|
|
List of automation templates returned in response to the query. |
Array of objects |
|
Identifier of the automation template. |
String |
|
Trigger of the automation template. |
Trigger object |
|
Operations of the automation template. |
Object |
|
List of operations that Alexa invokes serially. |
Array of Operation objects |
|
List of operations that Alexa invokes in parallel. |
Array of Operation objects |
|
A single operation. |
Operation object |
|
Definition of the data parameters inside of the automation template. Each of the keys in this object is a definition of a parameter. |
Object |
|
Developer-facing name of the automation template. |
Object |
|
Friendly name text. |
Object |
|
Name of the automation template. |
String |
|
Indicates whether there are more results to return. |
Object |
|
Included when the response is truncated. |
String |
HTTP status codes
Status | Description |
---|---|
|
Response body contains a list of templates. |
|
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. |
Create automation
Creates an automation instance from the specified automation template for the specified unit.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US |
US |
US |
Request
To create an automation, you make a POST
request to the /v2/automations
resource.
Request path and header example
POST /v2/automations 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 |
---|---|---|---|---|
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
{
"associatedEntity": {
"type": "UNIT",
"id": "amzn1.alexa.unit.did.101"
},
"automation": {
"templateId": "amzn1.alexa.automation.template.1",
"data": {
"customUtterance": {
"text": "Good morning"
}
}
},
"friendlyName": {
"value": {
"text": "Test automation"
}
}
}
Request body properties
Parameter | Description | Type | Required |
---|---|---|---|
|
Associated entity, such as the unit, that Alexa runs this automation on. |
Object |
Yes |
|
Type of entity. |
String |
Yes |
|
Identifies the unit. |
String |
Yes |
|
ID of the automation template from which to create the automation instance. |
String |
Yes |
|
Key-value map of custom variables and values. |
Object |
No |
|
Requestor-defined name of the automation. You can also define this field to distinguish automation instances. |
NameValue object |
No |
Response
A successful response returns HTTP 201 Created
along with the automation ID.
On error, the response returns the appropriate HTTP status code and includes a response body with an Error object.
Response body example
{
"automationId": "amzn1.alexa.automation.123"
}
Response body parameters
Parameter | Description | Type |
---|---|---|
|
Alexa-generated automation ID for the new automation, |
String |
HTTP status codes
Status | Description |
---|---|
|
Automation 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 automation
Deletes the automation associated with the specified automation ID.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US |
US |
US |
Request
To delete an automation, you make a DELETE
request to the /v2/automations/{automationId}
resource.
Request path and header example
DELETE /v2/automations/{automationId} 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 |
---|---|---|---|---|
|
Path |
Identifies the automation to delete from the unit. |
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 parameters
The response has no body.
HTTP status codes
Status | Description |
---|---|
|
Automation 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 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. |
Get automation
Gets the attributes of the automation associated with the specified automation ID. Alexa returns the automation with all resolved parameters. The caller must be the owner of the automation.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US |
US |
US |
Request
To get an automation, you make a GET request to the /v2/automations/{automationId}
resource.
Request path and header example
GET /v2/automations/{automationId} 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 |
---|---|---|---|---|
|
Path |
Identifies the automation. |
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 automation.
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 response.
{
"automationId":"amzn1.alexa.automation.123",
"friendlyName":{
"value":{
"text":"Good morning"
}
},
"associatedEntity":{
"type":"UNIT",
"id":"amzn1.alexa.unit.did.101"
},
"automation":{
"templateId":"amzn1.alexa.automation.template.1",
"trigger":{
"type":"CustomUtterance",
"version":"1.0",
"payload":{
"utterance":"I'm home",
"locale":"en-US"
}
},
"operations":{
"serial":[
{
"operation":{
"type":"AlexaAnnouncement",
"version":1.0,
"payload":{
"content":[
{
"locale":"en-US",
"speak":{
"type":"text",
"value":"Hello"
}
}
]
}
}
}
]
}
}
}
Response body parameters
Parameter | Description | Type |
---|---|---|
|
Identifies the requested automation. |
String |
|
Associated entity, such as the unit, in which Alexa runs this automation. |
Object |
|
Type of entity. |
String |
|
Identifies the unit. |
String |
|
ID of the automation template from which you created the automation instance. |
String |
|
Trigger of the automation. |
Trigger object |
|
Operations invoked when the automation triggers. |
Object |
|
List of operations that Alexa invokes serially. |
Array of Operation objects |
|
List of operations that Alexa invokes in parallel. |
Array of Operation objects |
|
A single operation. |
Operation object |
|
(Optional) Name of the automation. You can also define this field to distinguish automation instances. |
NameValue object |
HTTP status codes
Status | Description |
---|---|
|
Response body contains the requested automation. |
|
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. |
List automations
Lists the automations associated with the given unitId
. You must have permission to view the automations in the given unit. Otherwise, Alexa returns an empty list. The caller doesn't have to be the creator of the automation.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US |
US |
US |
Request
To list automations, you make a GET request to the /v2/automations
resource.
Request path and header example
GET
/v2/automations?associatedEntity.type={type}&associatedEntity.id={id}&templateId={templateId}&maxResults={maxResults}&nextToken={nextToken}&expand=all
Request path and header parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Query |
Type of entity. |
String |
Yes |
|
Query |
Unit ID. |
String |
Yes |
|
Query |
Filters the results to the ID of the automation template. |
String |
No |
|
Query |
Get expanded information about each automation. If |
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, along with a list of automations.
Response body examples
The following example shows a response without expand
set to all
.
The following example shows a response with expand
set to all
.
Response body parameters
Parameter | Description | Type |
---|---|---|
|
List of automations filtered by the query parameters. |
Array of objects |
|
Identifies the automation. |
String |
|
(Optional) Associated entity, such as the unit, in which Alexa runs this automation. |
String |
|
Type of entity. |
String |
|
Identifies the unit. |
String |
|
(Optional) ID of the automation template from which you created the automation instance. Returned when you include the |
String |
|
(Optional) Trigger of the automation. |
Trigger object |
|
(Optional) Operations of the automation template. |
Object |
|
List of operations that Alexa invokes serially. |
Array of Operation objects |
|
List of operations that Alexa invokes in parallel. |
Array of Operation objects |
|
A single operation. |
Operation object |
|
(Optional) Name of the automation. You can also define this field to distinguish automation instances. |
NameValue object |
|
Indicates whether there are more results to return. |
Object |
|
Included when the response is truncated. |
String |
HTTP status codes
Status | Description |
---|---|
|
Response body contains list of automations. |
|
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. |
Update automation
Update the specified automation. At this time, you can update the data
object only.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US |
US |
US |
Request
To update an automation, you make a PUT
request to the /v2/automations/{automationId}
resource.
Request path and header example
PUT /v2/automations/{automationId} 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 |
---|---|---|---|---|
|
Path |
Identifies the automation. |
String |
Yes |
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
{
"automation":{
"data":{
"customUtterance":{
"text":"Good night"
}
}
}
}
Request body properties
Parameter | Description | Type | Required |
---|---|---|---|
|
Defines the data to update. |
Object |
Yes |
|
Key/value mapping of the data used to resolve the variables defined in the template. For example, |
Object |
No |
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 |
---|---|
|
Automation updated 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. |
Object definitions
The Automation 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."
}
The Error object defines the following properties.
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 |
NameValue object
The NameValue
object is a container for names of objects.
The following table defines the properties of the object.
Property | Description | Type |
---|---|---|
|
Format of the value field. At this time, the only supported type is plain text. |
String |
|
Name. |
Object |
|
Name given in plain text. |
String |
Notification object
The Notification object defines the announcements to play as part of the Alexa.Automation.Operation.Notification.Notify
operation.
Parameter | Description | Type | Required |
---|---|---|---|
|
Notification delivery type. |
String |
Yes |
|
Different variants of content for spoken and display purposes. |
Object |
Yes |
|
Notification content to deliver to the user. |
Array of objects |
Yes |
|
Localized text input. |
String |
Yes |
|
Array of content values. |
Array of objects |
Yes |
|
Locale in which the spoken text is rendered, in BCP-47 format. The locale must include both the language and country or region, for example: |
String |
Yes |
|
Spoken text in plain text format. |
String |
Yes |
Operation object
The Operation
object defines an action or task that Alexa invokes after trigger conditions are met. You choose the tasks from a set of defined operations.
Property | Description | Type |
---|---|---|
|
Type of operation. |
String |
|
Version of the operation. |
String |
|
Based on the operation type, use the payload defined in the following sections. |
Object |
Alexa.Automation.Operation.Notification.Notify object
This operation sends an announcement to the unit when the associated trigger is invoked. The default recipient is the provided unit when associating the automation. This operation is currently only available when the scope is alexa::enterprise:management
.
The following example shows an example of a notification operation.
{
"type": "Alexa.Automation.Operation.Notification.Notify",
"version": "1.0",
"payload": {
"notification": {
"variants": [{
"type": "Announcement",
"content": {
"variants": [{
"type": "SpokenText",
"values": [{
"locale": "en-US",
"text": "Happy hour is starting now in the pool area!"
}]
}]
}
}]
}
}
}
The Alexa.Automation.Operation.Notification.Notify
object defines the following properties.
Parameter | Description | Type | Required |
---|---|---|---|
|
Name of the announcement operation. |
String |
Yes |
|
Version of the announcement operation payload. |
String |
Yes |
|
Notification object. |
Object |
Yes |
|
List of announcements to play. |
Array of Notification objects |
Yes |
Alexa.Automation.Operation.Brightness.SetBrightness object
This object represents an operation that sets the brightness level of an endpoint.
The following example shows a set-brighness operation.
{
"operation": {
"type": "Alexa.Automation.Operation.Brightness.SetBrightness",
"version": "1.0",
"payload": {
"endpoints": [
{
"id": "amzn1.alexa.endpoint.1"
}
],
"payload": {
"brightness": 10
}
}
}
}
The Alexa.Automation.Operation.Brightness.SetBrightness
object defines the following properties.
Parameter | Description | Type | Required |
---|---|---|---|
|
Set of endpoints on which to perform the operation. |
Array of strings |
Yes |
|
Identifies the target endpoint on which to perform the operation. |
String |
Yes |
|
Identifies the percentage brightness to which to set the device. |
Integer |
Yes |
Alexa.Automation.Operation.Power.TurnOn object
This object represents an operation that turns on an endpoint.
The following example shows a turn-on operation.
{
"operation": {
"type": "Alexa.Automation.Operation.Power.TurnOn",
"version": "1.0",
"payload": {
"endpoints": [
{
"id": "amzn1.alexa.endpoint.1234567"
}
]
}
}
}
The Alexa.Automation.Operation.Power.TurnOn
object defines the following properties.
Parameter | Description | Type | Required |
---|---|---|---|
|
Set of endpoints on which to perform the operation. |
Array of strings |
Yes |
|
Identifies the target endpoint on which to perform the operation. |
String |
Yes |
Alexa.Automation.Operation.Power.TurnOff object
This object represents an operation that turns off an endpoint.
The following example shows a turn-off operation.
{
"operation": {
"type": "Alexa.Automation.Operation.Power.TurnOff",
"version": "1.0",
"payload": {
"endpoints": [
{
"id": "amzn1.alexa.endpoint.1234567"
}
]
}
}
}
The Alexa.Automation.Operation.Power.TurnOff
object defines the following properties.
Parameter | Description | Type | Required |
---|---|---|---|
|
Set of endpoints on which to perform the operation. |
Array of strings |
Yes |
|
Identifies the target endpoint on which to perform the operation. |
String |
Yes |
Alexa.Automation.Operation.Speaker.SetVolume object
This object represents an operation that sets the volume of an endpoint.
The following example shows a set-volume operation.
{
"operation": {
"type": "Alexa.Automation.Operation.Speaker.SetVolume",
"version": "1.0",
"payload": {
"endpoints": [
{
"id": "amzn1.alexa.endpoint.1234567"
}
],
"payload": {
"volume": 10
}
}
}
}
The Alexa.Automation.Operation.Speaker.SetVolume
object defines the following properties.
Parameter | Description | Type | Required |
---|---|---|---|
|
Set of endpoints on which to perform the operation. |
Array of strings |
Yes |
|
Identifies the target endpoint on which to perform the operation. |
String |
Yes |
|
Absolute volume to which to set the endpoint's speaker volume. |
Integer |
Yes |
Alexa.Automation.Operation.Media.Stop object
This object represents an operation that stops the media playing on an endpoint.
The following example shows a media stop operation.
{
"operation": {
"type": "Alexa.Automation.Operation.Media.Stop",
"version": "1.0",
"payload": {
"endpoints": [
{
"id": "amzn1.alexa.endpoint.1234567"
}
]
}
}
}
The Alexa.Automation.Operation.Media.Stop
object defines the following properties.
Parameter | Description | Type | Required |
---|---|---|---|
|
Name of the operation. |
String |
Yes |
|
Version of the operation schema. |
String |
Yes |
|
Set of endpoints on which to perform the operation. |
Array of strings |
Yes |
|
Identifies the target endpoint on which to perform the operation. |
String |
Yes |
Alexa.Automation.Operation.Thermostat.SetTargetSetpoint object
This object represents an operation that sets the target temperature on a single-set-point thermostat.
The following example shows an operation that sets a target temperature on a thermostat.
{
"operation": {
"type": "Alexa.Automation.Operation.Thermostat.SetTargetSetpoint",
"version": "1.0",
"payload": {
"endpoints": [
{
"id": "amzn1.alexa.endpoint.1234567"
}
],
"payload": {
"targetSetpoint": {
"value": 20,
"scale": "CELSIUS"
}
}
}
}
}
The Alexa.Automation.Operation.Thermostat.SetTargetSetpoint
object defines the following properties.
Parameter | Description | Type | Required |
---|---|---|---|
|
Target set point for a single-set-point thermostat. |
Yes |
Alexa.Automation.Operation.Settings.SetDoNotDisturbState object
This object represents an operation that puts the object in a do-not-disturb state.
The following example shows a do-not-disturb operation.
{
"operation": {
"type": "Alexa.Automation.Operation.Settings.SetDoNotDisturbState",
"version": "1.0",
"payload": {
"endpoints": [
{
"id": "amzn1.alexa.endpoint.1234567"
}
],
"value": true,
"schedule": {
"type": "DURATION",
"value": "PT2H5M"
}
}
}
}
The Alexa.Automation.Operation.Settings.SetDoNotDisturbState
object defines the following properties.
Parameter | Description | Type | Required |
---|---|---|---|
|
Name of the operation.
Valid value: |
String |
Yes |
|
Version of the operation schema. |
String |
Yes |
|
Set of endpoints on which to perform the operation. |
Array of strings |
Yes |
|
Identifies the target endpoint on which to perform the operation. |
String |
Yes |
|
Whether to enable |
Boolean |
Yes |
|
Schedule that enables and disables |
Object |
No |
|
The |
String |
Yes |
|
Time value for the duration or time, in ISO 8601 format. Examples:
|
String |
Yes |
|
Time zone, which follows the ISO 8601 standard. Example: |
String |
No |
Trigger object
The Trigger
object defines the conditions that start the automation. You choose the tasks from a set of defined trigger types.
Property | Description | Type |
---|---|---|
|
Type of trigger. |
String |
|
Version of the trigger. |
String |
|
Based on the trigger type, use the payload defined in the following subsections. |
Object |
Alexa.Automation.Trigger.Voice.CustomUtterance object
This object represents a voice phrase that triggers an automation to occur. This trigger is only available when the scope is alexa::enterprise:management
. If the unit has an automation with the same utterance as the trigger, Alexa returns HTTP 400.
The following example shows a trigger based on a voice phrase.
{
"type": "Alexa.Automation.Trigger.Voice.CustomUtterance",
"version": "1.0",
"payload": {
"utterances": ["utterance A", "utterance B", "utterance C"],
"locale": "en-US"
}
}
The Alexa.Automation.Trigger.Voice.CustomUtterance
object defines the following properties.
Parameter | Description | Type | Required |
---|---|---|---|
|
Name of the custom utterance trigger. |
String |
Yes |
|
List of triggering utterances, in order of preference. |
Array of strings |
Yes |
|
The locale in which the spoken text is rendered, in BCP-47 format. The locale must include both the language and country or region, for example: |
String |
Yes |
Alexa.Automation.Trigger.Schedule.AbsoluteTime object
This object represents a time that triggers an automation to occur.
The following example shows a trigger based on an absolute time.
{
"type": "Alexa.Automation.Trigger.Schedule.AbsoluteTime",
"version": "1.0",
"payload": {
"schedule": {
"triggerTime": "193209",
"timeZoneId": "UTC",
"recurrence": "RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=SU,MO"
}
}
}
The Alexa.Automation.Trigger.Schedule.AbsoluteTime
object defines the following properties.
Parameter | Description | Type | Required |
---|---|---|---|
|
Name of the absolute time schedule trigger. |
String |
Yes |
|
Version of the absolute time schedule trigger payload. |
String |
Yes |
|
Time to run the actions. |
String |
Yes |
|
Time zone for the automation. Required for automatically adjusting daylight saving time when it applies. |
String |
Yes |
|
Specifies the recurrence schedule, in RRULE format. |
String |
Yes |
Alexa.Automation.Trigger.Schedule.SunriseInCustomLocation object
This object represents the sunrise that triggers an automation to occur.
The following example shows a trigger based on sunrise.
{
"type": "Alexa.Automation.Trigger.Schedule.SunriseInCustomLocation",
"version": "1.0",
"payload": {
"recurrence": "RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=SU,MO,TU,WE,TH,FR,SA",
"timeZoneId": "test-timezone-id",
"latitude": 100,
"longitude": 100,
"timeOffset": 100
}
}
The Alexa.Automation.Trigger.Schedule.SunriseInCustomLocation
object defines the following properties.
Parameter | Description | Type | Required |
---|---|---|---|
|
Name of the absolute time schedule trigger. |
String |
Yes |
|
Version of the sunrise trigger. |
String |
Yes |
|
Recurring expression, which conforms to the RFC 5545 pattern. This trigger is required to recur. |
String |
Yes |
|
Latitude of the sunrise address. |
Integer |
Yes |
|
Longitude of the sunrise address. |
Integer |
Yes |
|
Time offset in minutes from the sunrise time. The default is 0. |
Long |
No |
Alexa.Automation.Trigger.Schedule.SunsetInCustomLocation object
This object represents the sunset that triggers an automation to occur.
The following example shows a trigger based on sunset.
{
"type": "Alexa.Automation.Trigger.Schedule.SunsetInCustomLocation",
"version": "1.0",
"payload": {
"recurrence": "RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=SU,MO,TU,WE,TH,FR,SA",
"timeZoneId": "test-timezone-id",
"latitude": 100,
"longitude": 100,
"timeOffset": 100
}
}
The Alexa.Automation.Trigger.Schedule.SunsetInCustomLocation
object defines the following properties.
Parameter | Description | Type | Required |
---|---|---|---|
|
Name of the absolute time schedule trigger. |
String |
Yes |
|
Version of the sunset trigger. |
String |
Yes |
|
Recurring expression, which conforms to the RFC 5545 pattern. This trigger must recur. |
String |
Yes |
|
Latitude of the sunset address. |
Integer |
Yes |
|
Longitude of the sunset address. |
Integer |
Yes |
|
Time offset in minutes from the sunset time. The default is 0. |
Long |
No |
Related topics
Last updated: Dec 04, 2024