Skip to main content
Resend Docs

Search documentation

Type to search this documentation.

Update an automation

PATCH/automations/{automation_id}Update an automation

Parameters

automation_idstring · uuidpathrequired

The ID of the automation.

Request body

application/json
objectPatchAutomationRequest

At least one of `name`, `status`, or `steps` and `connections` must be provided. When updating the workflow graph, both `steps` and `connections` must be provided together.

connectionsarray of object

The connections between steps in the automation graph. Must be provided together with `steps`.

Show child attributes
Show array items

A connection between two steps in the automation graph.

fromstringrequired

The `key` of the source step.

tostringrequired

The `key` of the target step.

typestring

The type of connection. Defaults to `default`.

one of "default", "condition_met", "condition_not_met", "timeout", "event_received" · default "default"

namestring

The name of the automation.

minLength 1

statusstring

The status of the automation.

one of "enabled", "disabled"

stepsarray of object

The steps that compose the automation workflow. Must be provided together with `connections`.

maxItems 150 · minItems 1

Show child attributes

maxItems 150 · minItems 1

Show array items

A step in an automation workflow. The `config` object varies based on the step `type`.

configobjectrequired

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 }`

keystringrequired

A unique key for this step within the automation graph.

typestringrequired

The type of automation step.

one of "trigger", "send_email", "delay", "wait_for_event", "condition", "contact_update", "contact_delete", "add_to_segment"

Example request
{
  "connections": [
    {
      "from": "string",
      "to": "string",
      "type": "default"
    }
  ],
  "name": "string",
  "status": "disabled",
  "steps": [
    {
      "config": {},
      "key": "string",
      "type": "add_to_segment"
    }
  ]
}

Responses

200OKapplication/json
objectPatchAutomationResponse
idstring

The ID of the updated automation.

objectstring

Type of the response object.

Example response
{
  "id": "string",
  "object": "automation"
}
Documentation menu