# Create a single custom rule Creates a single custom Universal Alert rule. Endpoint: POST /api/v1/universal-alert Security: ApiKey ## Query parameters: - `network_id` (integer, required) Unique identifier of the network whose configuration should be managed ## Request fields (application/json): - `enabled` (boolean) - `alert_name` (string) Defaults to an empty string if no value is provided. - `rrule` (string) The RRULE string which can be generated here: https://jakubroztocil.github.io/rrule/ Note that new lines must be explicitly escaped with . Note that providing the RRULE string without the RRULE will result in a yearly alert. For a single occurrence, COUNT=1 must be provided Example: - `monitor` (object, required) Motion monitor object. Specifies the type of monitoring. : Ignore motion and triggers actions at specified time. : Checks period between alert trigger and . : checks for inactivity in the given period. specifies the length of the inactivity. specifies if the alert should continue after inactivity was detected - `monitor.monitor_mode` (string) Enum: "NONE", "SIMPLE", "INACTIVITY" - `monitor.duration_minutes` (integer) The length of time in minutes of the monitored duration. The cloud will determine the start time per the timezone in the rrule field by subtracting this from the targeted time of the monitor completion (in which the result is sent). - `monitor.inactive_minutes` (integer) Required if the is "INACTIVITY" - `monitor.repeat_monitoring` (boolean) If the is "INACTIVITY", this boolean determines if the alert should continue monitoring if inactivity is detected. Defaults to true - `monitor.stop_event_filter` (object) Not yet supported - 1/1/2022 The keys of the object will compare to keys of MQTT events as they are from core. All key value pairs placed in this object will be expected on the event from core. - `meta` (object) The contents of this object are decided by the client and will not persist if the alert is deleted. - `analytics_tag` (string) Any string that can be used for analytics tracing. Defaults to "" if the field is not included. - `no_motion_actions` (array) Actions to perform when no motion is detected - `no_motion_actions.action` (string, required) Supported actions are - `no_motion_actions.user_ids` (array) Array of user ids - `no_motion_actions.payload` (object) Payload to add to the action. Data in payload should match API input for MNS /network/{network_id}/events/create Data in payload should match API input for FireBase push API - `motion_actions` (array) Actions to perform when motion is detected - `unknown_actions` (array) Actions to perform when there is no record of past motion on the network - `error_actions` (array) Actions to perform when an error occurs ## Response 201 fields (application/json): - `id` (string) internal unique identifier of the alert Example: 2255 - `enabled` (boolean, required) the active status of the alert Example: true - `target` (string) Date string of next notification Example: "2021-12-13T16:00:00.000+00:00" - `timezone` (string) Example: "America/New_York" - `alert_name` (string) Example: "client decided label" - `rrule` (string) Example: "DTSTART;TZID=America/New_York:20211201T163000\nRRULE:FREQ=WEEKLY;COUNT=30;INTERVAL=1;WKST=MO" - `monitor` (object) Example: {"monitor_mode":"INACTIVITY","duration_minutes":10,"inactive_minutes":2,"repeat_monitoring":true} - `monitor.monitor_mode` (string) Example: "INACTIVITY" - `monitor.duration_minutes` (integer) Example: 10 - `monitor.inactive_minutes` (integer) Example: 2 - `monitor.repeat_monitoring` (boolean) Example: true - `meta` (object) Example: {"anything":"client controlled writable space"} - `meta.anything` (string) Example: "client controlled writable space" - `analytics_tag` (string) Example: "caregiver_alert_trace" - `no_motion_actions` (array) Example: [{"action":"fcm_push","user_ids":[5,9],"payload":{"apns":{"headers":{"apns-push-type":"alert","apns-topic":"com.csc.HaloHome"},"payload":{"aps":{"alert":{"title":"no motion","body":"123"},"sound":"Aura_Push_Final.wav","category":"User"}}}}}] - `no_motion_actions.action` (string, required) Supported actions are - `no_motion_actions.user_ids` (array) Array of user ids - `no_motion_actions.payload` (object) Payload to add to the action. Data in payload should match API input for MNS /network/{network_id}/events/create Data in payload should match API input for FireBase push API - `motion_actions` (array) Example: [{"action":"fcm_push","payload":{"data":{"click_action":"CustomAlertEvent","title":"NO Motion Ua","body":"No Motion was detected during Now","sound":"Aura_Push_Final.wav"},"apns":{"headers":{"apns-push-type":"alert","apns-topic":"com.csc.HaloHome"},"payload":{"aps":{"alert":{"title":"motion","body":"123"},"sound":"Aura_Push_Final.wav","category":"User"}}}}}] - `unknown_actions` (array) Example: [] - `error_actions` (array) Example: [] - `uuid` (string) Unique id Example: "Unique alert identifier" - `external_id` (string) External network id - `window_end` (number) - `window_start` (integer) Timestamp showing when monitoring will start - `created_at` (integer) Alert creation timestamp - `next_run` (any) Timestamp of the next alert trigger. Can be used to monitor the execution of alerts inside the inactivity window.