Workflows and event types
A workflow is a rule: a condition plus the steps to run when it matches. See Rules and workflows for conditions, steps and placeholders.
Reading endpoints work for operators and admins. Endpoints that change workflows or event types need the admin role. Workflow changes take effect within about 30 seconds.
Operators see secrets in workflows masked as ********: webhook and API call headers, tokens in URLs and similar values. Admins get the real values. When an admin saves a workflow back with a masked value unchanged, Argus keeps the stored secret. Sending ******** in a new workflow or a changed field returns 422.
The workflow object
idintegeroptionalnamestringoptionalconditionobjectoptionalcamera, classes, zone (the name of one of the camera's zones), schedule ({"start": "22:00", "end": "06:00"}, in the site's time zone) and min_dwell_seconds. See Conditions.stepsarrayoptional{"action_type": "...", "params": {...}}. See Step parameters.actionobjectoptional{}.enabledbooleanoptionalevent_type_idinteger or nulloptionalevent_type_keystring or nulloptionalStep parameters
action_type | params |
|---|---|
create_alert | severity (info, medium or high) and message, both optional. Recorded in the run log. |
send_webhook | url (required) and payload_template, a JSON object. Sent as POST. |
api_call | url (required), method (GET by default, or POST, PUT, PATCH, DELETE), headers and payload_template, both JSON objects. |
tag_event | tag. Defaults to flagged. |
send_email | channel_id (required, an email notification channel), to (required, one address or a list), subject and body. |
send_sms | channel_id (required, an SMS notification channel), to (required, one number or a list) and message. |
Webhook, API call, email and SMS text can use the placeholders {{event_id}}, {{camera_name}}, {{caption}}, {{severity}} and {{ts}}. Webhook and API call URLs may not point at the site node itself (loopback), link-local or cloud metadata addresses.
List workflows
Create a workflow
/workflowsCreates an enabled workflow. Requires the admin role.
Body
namestringrequiredconditionobjectrequired{} to match every detection that passes the camera's profile.stepsarrayrequiredactionobjectrequired{}.event_type_idinteger or nulloptionalResponse fields
idintegeroptionalnamestringoptionalenabledbooleanoptionaltrue.Responses
******** value.Change a workflow
/workflows/{workflow_id}Changes one or more fields. Send only the fields you want to change. condition and steps are replaced as a whole. Requires the admin role.
Path parameters
workflow_idintegerrequiredBody
namestringoptionalconditionobjectoptionalstepsarrayoptionalevent_type_idintegeroptionalenabledbooleanoptionalfalse to stop the workflow, true to start it again.Responses
{"status": "updated"}, or {"status": "unchanged"} if the body had no fields.Delete a workflow
List workflow runs
/workflow-runsLists workflow runs, newest first. Argus records a run each time a workflow matches.
Query parameters
limitintegeroptional50.Response fields
An array of runs:
idintegeroptionalworkflow_idintegeroptionalworkflow_namestringoptionalevent_idintegeroptionalstatusstringoptionalsuccess, partial or failed.logarrayoptionalaction, status and either result or error.started_atstringoptionalfinished_atstring or nulloptionalResponses
Event types
An event type names a kind of event, such as perimeter-breach. A detection profile stamps its events with an event type, and a workflow with an event type only fires for events of that type. An event type's default_severity is used for alerts when neither the workflow step nor the profile sets one. See Event types.
Each event type has id, key, display_name, description, category (security, safety or operational), default_severity (info, medium or high), enabled and created_at.
List event types
/event-typesLists every event type, sorted by category and display name.
Responses
Create an event type
/event-typesCreates an event type. Requires the admin role.
Body
keystringrequiredperimeter-breach. Must be unique. Can't be changed later.display_namestringrequireddescriptionstringoptionalcategorystringoptionalsecurity (the default), safety or operational.default_severitystringoptionalmedium (the default), info or high.Responses
Change an event type
/event-types/{event_type_id}Changes one or more fields. The key can't be changed. Requires the admin role.
Path parameters
event_type_idintegerrequiredBody
display_namestringoptionaldescriptionstringoptionalcategorystringoptionalsecurity, safety or operational.default_severitystringoptionalinfo, medium or high.enabledbooleanoptionalResponses
Delete an event type
/event-types/{event_type_id}Deletes an event type that no workflow or detection profile uses. Otherwise set enabled to false. Requires the admin role.
Path parameters
event_type_idintegerrequiredResponses
{"status": "deleted"}.