Mega icon

Mega

Work with Mega API

Automation Rule → Create

AI-generated

Summary

Create a new Mega automation rule by specifying its name, description, triggering event, active status, conditions, and actions to execute.

Inputs

  • automationRuleName (required) — Defines the unique name of the automation rule.
  • automationRuleDescription — Optional detailed explanation of what the automation rule does.
  • automationRuleEventName — Specifies the event that triggers the automation rule; defaults to 'message_created'. Options include 'conversation_created', 'conversation_resolved', 'conversation_updated', and 'message_created'.
  • automationRuleActive — Boolean flag to enable or disable the automation rule; defaults to true (enabled).
  • automationRuleActions (required) — A JSON array defining the actions to execute whenever the rule's conditions are met.
  • automationRuleConditions (required) — A JSON array specifying the conditions under which the automation rule applies.

Output shape

a single JSON object representing the created automation rule, including its ID, name, event trigger, conditions, actions, and active status

The output includes all provided inputs plus any system-generated identifiers. Errors will be returned if required inputs are missing or invalid.

Links

Discussion