Action object

Describes the Array object of the Action key within an Event object.

Events support a wide variety of types for the action object based on a: email, sms, web-hook, set-variable, slack-webhook, voice, ubifunction, user and incident. This causes the JSON action object to be highly nested and have many variants in order to support all the above types.

In its base form, the action object follows this structure:

{
	  "data": {},
    "name": "", // String
    "type": "Type of action", // Options: ["email", "sms", "web-hook", "set-variable", "slack-webhook", "voice", "ubifunction", "user", "incident"]
    "isGeneric": true, // Options: [true, false]. Defaults to true
    "repeatAction": false, // Options: [true, false]. Defaults to false
    "idGroupAction": "", // String. Recommendation: at least 5 characters
    "back_to_normal": false, // Options: [true, false]. Defaults to false
    "maxRepetitions": "", // String or Integer. Defaults to none
    "repeatInterval": {} // Object containing value and unit for the repeated action
}

Each key represents the following:

PropertyTypeDescription
dataObjectObject containing data about the action (please see below)
nameStringName of Action
typeStringType of action, valid values are: email, sms, web-hook, set-variable, slack-webhook, voice, ubifunction, user and incident
isGenericBooleanTrue if Action is generic
repeatActionBooleanTrue if Action should be repeated. If repeatAction is False, maxRepetitions and repeatInterval are hidden
maxRepetitionsNumberNumber of maximum repetitions of the Action. Required when repeatAction is active
repeatIntervalObjectObject containing value and unit for the repeated action. Required when repeatAction is active. unit: can be T (minutes), H (hours) or D (days). The maximum values per unit are as follows: {"T": 43200, "H": 168, "D": 90}
idGroupActionStringID of the Group Action
back_to_normalBooleanTrue if action has a "Back to Normal" action configured

data Object - Attribute of actions Array

The data key within an action object holds an object as well, which has the below structure based on the value of the type key:

📘

Fields marked Bookmarks: Yes in the tables below accept template variables. See Bookmarks for the full reference.

Email

{
  "emails": [], // Array or string separated by ",". Defaults to []
  "message": "", // String
  "subject": "" // String
}
PropertyTypeBookmarksDescription
emailsArrayYesArray of email addresses the email should be sent to
messageStringYesContent of the email
subjectStringYesSubject line of the email
{
  "emails": [
    "[email protected]"
  ],
  "message": "Hey there, {{variable.name}} was {{last_value}} at {{trigger_timestamp|timestampformat('America/Bogota')}}.",
  "subject": "{{variable.name}} alert!"
}

SMS

{
  "message": "", // String
  "numbers": [
    {
      "number": "", // String. Defaults to ""
      "country": {
        "id": "", // String. Defaults to ""
        "label": "", // String. Defaults to ""
        "value": "" // Required field. Country indicative
      }
    }
  ]
}
PropertyTypeBookmarksDescription
messageStringYesContent of the SMS
numbersArrayYesContains objects with information about the phone number. Each object includes number and country fields
{
  "message": "Hey there, {{variable.name}} was {{last_value}} at {{trigger_timestamp|timestampformat('America/Bogota')}}.",
  "numbers": [
    {
      "number": "+57 3123456789",
      "country": {
        "id": "CO",
        "label": "Colombia",
        "value": "+57"
      }
    }
  ]
}

Webhook

{
  "url": "", // String. URL required field
  "method": "", // Options: ["GET", "HEAD", "POST", "PUT", "PATCH", "DELETE"]
  "headers": {}, // Object for request headers
  "payload": "{}" // String. Decoded payload
}
PropertyTypeBookmarksDescription
urlStringNoURL of the webhook endpoint. Required
methodStringNoHTTP method. Options: GET, HEAD, POST, PUT, PATCH, DELETE
headersObjectYesRequest headers object
payloadStringYesJSON payload in string format
{
  "url": "http://example.com/?do=foobar",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json"
  },
  "payload": "{ \"name\": \"{{device.name}}\", \"value\": \"{{last_value}}\", \"datetime\": \"{{timestamp|timestampformat('America/Bogota')}}\" }"
}

Set Variable

{
  "value": "", // String or Integer. Defaults to None
  "context": {}, // Object with variable context. Defaults to {}
  "variables": [{}], // Array of objects
  "device_groups": [{}] // Array of objects
}
PropertyTypeBookmarksDescription
valueNumberYesValue to send to the Variable
contextObjectYesContext of the value to send to the Variable
timestampStringYesTimestamp in milliseconds of the Variable value to send
variablesArrayNoContains objects with the id and name of the Variable
device_groupsArrayNoContains objects with information about the id of the device group, variable_label, isMultipleGlobalEvent, and deviceGroup_name
{
  "value": "100",
  "context": {},
  "variables": [
    {
      "id": "64beb73a404ca2000ddf41d0",
      "name": "Variable 1"
    }
  ]
}

Slack Webhook

{
  "url": "", // String. URL required field
  "message": "", // String
  "icon_url": "", // Optional
  "username": "", // String required
  "icon_emoji": "", // Optional
  "channel_label": "" // String
}
PropertyTypeBookmarksDescription
urlStringNoSlack app webhook URL. Required
messageStringYesContent of the Slack message
icon_urlStringYesURL of the Slack app icon. Optional
usernameStringYesSlack username. Required
icon_emojiStringYesEmoji icon for the Slack app. Optional
channel_labelStringNoChannel the message should be sent to
{
  "url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX",
  "message": "Hey there, {{variable.name}} was {{last_value}} at {{trigger_timestamp|timestampformat('America/Bogota')}}.",
  "icon_url": "",
  "username": "test-ubidots",
  "icon_emoji": "",
  "channel_label": "#example-channel"
}

Voice

{
  "voice": "alice", // String. Defaults to "alice"
  "message": "", // String
  "numbers": [
    {
      "number": "", // String. Defaults to ""
      "country": {
        "id": "", // String. Defaults to ""
        "label": "", // String. Defaults to ""
        "value": "" // Required field. Country indicative
      }
    }
  ],
  "language": "en" // String. Minimum length = 2 and maximum length = 5. Defaults to "en"
}
PropertyTypeBookmarksDescription
voiceStringNoVoice type for the phone call. Defaults to "alice"
messageStringYesContent of the voice message
numbersArrayYesContains objects with information about the phone number. Each object includes number and country fields
languageStringNo2-letter language code for the phone call. Defaults to "en"
{
  "voice": "alice",
  "message": "Hey there, {{variable.name}} was {{last_value}} at {{trigger_timestamp|timestampformat('America/Bogota')}}.",
  "numbers": [
    {
      "number": "+57 3123456789",
      "country": {
        "id": "CO",
        "label": "Colombia",
        "value": "+57"
      }
    }
  ],
  "language": "en"
}

UbiFunction

{
  "method": "", // Options: ["get", "post"]
  "headers": {}, // Object for request headers
  "message": "", // String. Required field
  "ubi_function": {
    "id": "", // String
    "url": "" // String. URL required field
  }
}
PropertyTypeBookmarksDescription
methodStringNoHTTP method for the UbiFunction request. Options: get, post
headersObjectYesRequest headers object
messageStringYesPayload content sent to the UbiFunction. Required
ubi_functionObjectNoContains the id and url of the UbiFunction
{
  "method": "post",
  "headers": {
    "Content-Type": "application/json"
  },
  "message": "{ \"name\": \"{{device.name}}\", \"value\": \"{{last_value}}\", \"datetime\": \"{{timestamp|timestampformat('America/Bogota')}}\" }",
  "ubi_function": {
    "id": "64bec5dc3abcb1000e327b2a",
    "url": "https://parse.ubidots.com/prv/username/test"
  }
}

User

{
  "message": "", // String
  "subject": "", // String
  "userIds": [], // Array containing user ids
  "contactMethods": [] // Options: ["voice", "sms", "email"]. Defaults to []. Choose one or more
}
PropertyTypeBookmarksDescription
messageStringYesContent of the notification
subjectStringYesSubject line of the notification
userIdsArrayNoContains all the user IDs to notify. Defaults to []
contactMethodsArrayNoDelivery methods. Options: "email", "sms", "voice". Defaults to []
{
  "message": "Hey there, {{variable.name}} was {{last_value}} at {{trigger_timestamp|timestampformat('America/Bogota')}}.",
  "subject": "{{variable.name}} alert!",
  "userIds": [
    "64d3e8a0433e82000e773bfa"
  ],
  "contactMethods": [
    "voice",
    "sms",
    "email"
  ]
}

Incident

{
  "name": "", // String
  "title": "", // String
  "description": "", // String
  "message": "", // String
  "severity": "", // String. Typical values: "P1", "P2", "P3", "P4"
  "escalationPolicyLabel": "", // String. Label of the escalation policy to trigger
  "autoResolve": false // Boolean. Defaults to false
}
PropertyTypeBookmarksDescription
nameStringYesIncident message displayed in the Incidents widget — the primary label users see in the widget list
titleStringYesUsed in escalation policy notifications (e.g. PagerDuty alert title, email subject). Distinct from name
descriptionStringYesExtended description shown in the incident detail view
messageStringYesNotification body sent through the escalation policy (e.g. email/SMS body)
severityStringNoSeverity level passed to the escalation policy. Typical values: P1, P2, P3, P4
escalationPolicyLabelStringNoLabel of the escalation policy to trigger. If empty or not found, no escalation policy runs
autoResolveBooleanNoIf true, the incident is automatically resolved when the trigger deactivates (requires a paired back_to_normal action)

Auto-resolving incidents

To create a self-resolving incident, define two actions sharing the same idGroupAction:

  • One with back_to_normal: false — fires when the trigger activates
  • One with back_to_normal: true — fires when the trigger deactivates (returns to normal)

Set autoResolve: true on both to have the system automatically close the incident when the condition clears.

{
  "type": "incident",
  "name": "Create Incident",
  "data": {
    "name": "",
    "title": "{{variable.name}} alert!",
    "message": "Hi there,\n{{variable.name}} was {{'%0.2f'|format(last_value|float)}} at {{trigger_timestamp|timestampformat('America/Bogota')}}.",
    "severity": "P2",
    "autoResolve": true,
    "description": "",
    "escalationPolicyLabel": "escalation-policy-label"
  },
  "back_to_normal": false,
  "idGroupAction": "1EZX9Np"
}