Skip to content

Action

Manage Automated Actions.

Actions implement automated responses for specific device and cloud conditions. Actions are invoked by triggers to respond and implement a specific remedy or notification. .

Find

Find actions by matching properties and query parameters.

Endpoint

HTTP
POST /action/find

Authorized User Role

user

Request Body

FieldTypeRequiredNotes
cloudIdstringyesFilter by cloud ID.
typestringFilter by action type. Valid types are: alert, builder-alert, builder-metric, database, delay, device, email, eventbridge, http, lambda, metric, mqtt, and sms.

Query String Options

FieldTypeNotes
filterstringFull text string to filter for.
nextobjectPagination token for the next page.
prevobjectPagination token for the previous page.
limitnumberNumber of items to retrieve.
indexstringDatabase index to use.
existsbooleanSet to true to require the item exists, otherwise set to null to perform an upsert.

Response

Paged response.

FieldTypeNotes
dataarrayArray of items.
nextstringPaged cursor to use for the next page of items.
prevstringPages cursor to use for the previous page of items.

Action

An array of Action items.

FieldTypeNotes
argsobjectAction args.
bufferobjectBuffer optimizations for metrics.
cloudIdstringOwning device cloud ID.
contextobjectTrigger expression context, merged with user params.
descriptionstringAction description.
destinationstringURL, email address, function name, topic, phone number.
duenumberWhen the action is next due.
enablebooleanEnable or disable the action.
errorstringError message from last invocation.
expressionstringTrigger expression.
formatstringMessage format.
idstringUnique action ID.
messagestringMessage template/properties.
namestringAction name.
pollnumberDelay between pollng the trigger.
rearmnumberTime period to suppress triggering.
severitystringAlert severity.
triggerstringSource of action trigger.
typestringAction type.

Get

Get an action by ID for a cloud.

Endpoint

HTTP
POST /action/get

Authorized User Role

admin

Request Body

FieldTypeRequiredNotes
idstringAction ID.
cloudIdstringyesFilter by cloud ID.
typestringyesFilter by action type. Valid types are: alert, builder-alert, builder-metric, database, delay, device, email, eventbridge, http, lambda, metric, mqtt, and sms.

Response

FieldTypeNotes
argsobjectAction args.
bufferobjectBuffer optimizations for metrics.
cloudIdstringOwning device cloud ID.
contextobjectTrigger expression context, merged with user params.
descriptionstringAction description.
destinationstringURL, email address, function name, topic, phone number.
duenumberWhen the action is next due.
enablebooleanEnable or disable the action.
errorstringError message from last invocation.
expressionstringTrigger expression.
formatstringMessage format.
idstringUnique action ID.
messagestringMessage template/properties.
namestringAction name.
pollnumberDelay between pollng the trigger.
rearmnumberTime period to suppress triggering.
severitystringAlert severity.
triggerstringSource of action trigger.
typestringAction type.

Invoke

Invoke an action by ID or name.

Endpoint

HTTP
POST /action/invoke

Authorized User Role

user

Request Body

FieldTypeNotes
idstringAction ID.
namestringAction name if ID not provided.
paramsobjectParameters for the action.
contextobjectContext for the action.

Response

FieldTypeNotes
*stringDescription saying the action was invoked.

Example

Example action invocation using curl to invoke an action by name.

curl
curl -X POST \
     https://xrp7t2deqh.execute-api.ap-southeast-1.amazonaws.com/tok/action/invoke \
     -H 'Authorization: 1234567990XXXXXXXXXXXXXXXX' \
     -H 'Content-Type: application/json' \
     -d '{"name":"myAction", "params":{"deviceId": "ZXXXXXXXXX"}, "context":{}}'