PATCH
cURL
Renames an automation or replaces its trigger or steps. Steps replace the whole list. Steps saved on an enabled automation run from the next event, so they are checked as enabling would be.
Needs an API key with full access. Not available to a key limited to one domain.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

automationId
string
required
Minimum string length: 1
Example:

"clx1234567890"

Body

application/json
name
string
Required string length: 1 - 100
trigger
object

What starts a run. Either {"type":"event","event":} for something that happens in Ozi (contact.created, email.opened, mailbox.message.received and the rest of the enum), optionally with "contactBookId" to only start for contacts in that book (needed to add existing contacts); or {"type":"custom","name":"signed_up"} for an event your app posts to POST /v1/events.

steps
object[]

Run in order for each person. Each step has a "type": send_email {id, from (on a verified domain), subject, html or text or templateId, replyTo?}, with {{firstName}}, {{email}}, {{firstName,fallback=there}} and {{ozi_unsubscribe_url}} filled in; delay {amount, unit: minutes|hours|days}, at most 30 days; add_to_contact_book and remove_from_contact_book {contactBookId}; update_contact_property {property, value}; unsubscribe_contact; notify_team (emails the team's admins); webhook {url}; condition {check, yes: [steps], no: [steps]}, where yes and no are lists of these same steps and check is {kind:"email_opened"|"email_clicked", stepId: the id of an earlier send_email} or {kind:"contact_property", property, operator:"equals"|"contains", value} or {kind:"topic_subscribed", topicId}. At most 25 steps per list, 50 in all, conditions 3 deep. A mailbox event trigger can't be followed by steps that change a contact.

Response

The updated automation. Steps replace the whole list. On an enabled automation they are checked as enabling would.

id
string
required
name
string
required
status
enum<string>
required
Available options:
DRAFT,
ENABLED,
DISABLED
triggerEvent
string | null
required
createdAt
string
required
updatedAt
string
required
trigger
object
steps
object[]
_count
object

How many runs it has had (list and get)