{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"Create an automation","properties":{"body":{"$ref":"#/definitions/CreateAutomationRequest"}},"required":[],"additionalProperties":false,"definitions":{"CreateAutomationRequest":{"type":"object","required":["name","steps","connections"],"properties":{"name":{"type":"string","minLength":1,"description":"The name of the automation."},"status":{"type":"string","enum":["enabled","disabled"],"default":"disabled","description":"The initial status of the automation. Defaults to `disabled`."},"steps":{"type":"array","minItems":1,"maxItems":150,"description":"The steps that compose the automation workflow. Must include at least one `trigger` step.","items":{"$ref":"#/definitions/AutomationStep"}},"connections":{"type":"array","description":"The connections between steps in the automation graph.","items":{"$ref":"#/definitions/AutomationConnection"}}}},"AutomationStep":{"type":"object","description":"A step in an automation workflow. The `config` object varies based on the step `type`.","required":["key","type","config"],"properties":{"key":{"type":"string","description":"A unique key for this step within the automation graph."},"type":{"type":"string","enum":["trigger","send_email","delay","wait_for_event","condition","contact_update","contact_delete","add_to_segment"],"description":"The type of automation step."},"config":{"type":"object","description":"Configuration for the step. Shape depends on `type`: - **trigger**: `{ event_name: string }` - **send_email**: `{ template: { id: string, variables?: object }, subject?: string, from?: string, reply_to?: string }` - **delay**: `{ duration: string }` — a human-readable duration (e.g. `\"30 minutes\"`) - **wait_for_event**: `{ event_name: string, timeout?: string, filter_rule?: object }` — `timeout` is a human-readable duration (e.g. `\"1 hour\"`) - **condition**: A rule tree with `type` (`rule`, `and`, `or`), `field`, `operator`, and `value` - **contact_update**: `{ first_name?: string|object, last_name?: string|object, unsubscribed?: boolean|object, properties?: object }` - **contact_delete**: `{}` - **add_to_segment**: `{ segment_id: string }`\n"}}},"AutomationConnection":{"type":"object","description":"A connection between two steps in the automation graph.","required":["from","to"],"properties":{"from":{"type":"string","description":"The `key` of the source step."},"to":{"type":"string","description":"The `key` of the target step."},"type":{"type":"string","enum":["default","condition_met","condition_not_met","timeout","event_received"],"default":"default","description":"The type of connection. Defaults to `default`."}}}}},"name":"Create an automation","id":"resend.automations.create","example":{},"maxRequests":1,"summary":false}}