Generates and retrieves a new action from the account

Syntax
.create(/data/)

Arguments

Field nameTypeDescription
idstringId of the new action.
data
object
Options for the new action.
name
string
The name for the action.
description
string
[optional]
Description of the action.
active
bool
[optional]
True if the action is active or not. The default is true.
when_set_bucket
string
[optional]
ID reference of the bucket.
when_set_origin
string
[optional]
ID reference of the origin.
when_set_variable
string
[optional]
Name of the variable to trigger when it arrives.
when_set_condition
string
[optional]
Condition to trigger the action. Can be * (Any), = (Equal), >= (Greater Equal) etc.
when_set_value
string
[optional]
Value to be compared by the condition. Set to Null if the condition is * (Any). 
when_reset_bucket
string
[optional]
ID reference of the bucket.
when_reset_origin
string
[optional]
ID reference of the origin.
when_reset_variable
string
[optional]
Name of the variable to trigger when it arrives.
when_reset_condition
string
[optional]
Condition to trigger the action. Can be * (Any), = (Equal), >= (Greater Equal) etc.
when_reset_value
string
[optional]
Value to be compared by the condition. Set to Null if the condition is * (Any). 
type
string
[optional]
Type of action. It can be ‘script’, ‘sms’, ‘email’ or ‘post’.
tags
array
[optional]
An array of objects with key and value.  
If type is a script
script
string
[optional]
Reference id of the analysis.
If type is sms
to
string
[optional]
Phone number to be sent to. 
message
string
[optional]
Message to be sent in sms.
If type is email


to 
string
[optional]
E-mail address to be sent to.
message
string
[optional]
Message to be sent in the e-mail.
subject
string
[optional]
The subject of the e-mail. 

Returns {Promise<JSON>}