Rule Webhooks

Rule request bodies

{
  "unit21_id": 11533652,
  "rule_id": null,
  "change": "CREATED",
  "object_type": "RULE",
  "title": "Webhook test",
  "description": "Test",
  "changed_by": "[email protected]",
  "change_time": 1661966004,
  "created_by": "[email protected]",
  "flagged_entities": [],
  "flagged_events": [],
  "flagged_instruments": [],
  "tags": []
}

For the webhook CREATED, the following fields are sent:

Field NameValue TypeDetails
unit21_idNumberA Unit21 internally-assigned unique identifier for the alert within our system
rule_idStringA non-Unit21 identifier for the rule
changeStringA Unit21-defined value describing the nature of the change to this rule. For more details on this, see above section Change trigger types
object_typeStringRULE
titleStringTitle assigned to the rule
descriptionStringA high level descriptive phrase about the rule
changed_byStringEmail address of the agent that triggered the status change (if applicable)
change_timeNumberTime the change was triggered in Epoch time format (number of seconds elapsed since 1 Jan 1970 00:00:00 UTC)
created_byStringEmail address of the agent that created this rule initially
flagged_entitiesObject[]An object list of entities flagged by the rule. Each object contains a Unit21 ID, the entity type (user or business), a non-Unit21 identifier, and a resolution
flagged_eventsObject[]An object list of events flagged by the rule. Each object contains a Unit21 ID, the event type (transaction or action), a non-Unit21 identifier, and a resolution
flagged_instrumentsObject[]An object list of instruments flagged by the rule. Each object contains a Unit21 ID, the instrument type, a non-Unit21 identifier, and a resolution
tagsString[]A list of tags that are associated with this rule, always of the format key:value
{
  "unit21_id": 11484957,
  "rule_id": null,
  "change": "TRIGGERED",
  "object_type": "RULE",
  "title": "RTR $5k amount threshold",
  "description": "sample real time rule",
  "changed_by": null,
  "change_time": 1661967668,
  "created_by": "[email protected]",
  "flagged_entities": [
    {
      "entity_id": "u-d8e1d453-c205-4996-a935-ff08be01bcd1",
      "entity_type": null,
      "unit21_id": 625240968,
      "resolution": null
    }
  ],
  "flagged_events": [
    {
      "event_id": "re5terg54g4",
      "event_type": "transaction",
      "unit21_id": 2492941026,
      "resolution": null
    }
  ],
  "flagged_instruments": [],
  "tags": [],
  "deploy_start_date": 1661967668,
  "deploy_end_date": 1661967668
}

For the webhook TRIGGERED, the following fields are sent in addition to the ones above:

Field NameValue TypeDetails
deploy_start_dateNumberStart datetime of the rule deployment in Epoch time format (number of seconds elapsed since 1 Jan 1970 00:00:00 UTC)
deploy_end_dateNumberEnd datetime of the rule deployment in Epoch time format (number of seconds elapsed since 1 Jan 1970 00:00:00 UTC)