Update a automation

PUT/api/v1/automations/{automation}
Requires anorganization API keywith the scopeautomations:write

Parameters

NameInTypeDescription
automationrequiredpathstringThe automation identifier.

Request body

  • namestring

    A name for your team, like Welcome series.

  • entry_rulestringonce | every_time | cooldown

    Whether a contact can go through it more than once: once ever, every_time the trigger happens, or cooldown (again only after settings.cooldown_hours).

  • graphobject

    The steps, as {"nodes": [...], "edges": [...]}. The easiest way to get a valid one is to build it in the dashboard, or start from a recipe (GET /automations/recipes), and read it back with GET /automations/{id}. GET /automations/node-types lists the step types and their settings.

    • nodesarray

      The steps, each {"id", "type", "config"}. GET /automations/node-types lists the types and what goes in config.

    • edgesarray

      How the steps connect, each {"from", "to"} with step IDs, plus "branch" after a step that splits.

  • settingsobject

    Optional. When contacts leave early (exit_events, exits), the goals, the stream (marketing or transactional) and, for entry_rule: cooldown, the cooldown_hours between entries. Read the current values with GET /automations/{id}.

    • exit_eventsarray<string>

      Events that take a contact out early, by name, like order_completed.

    • exitsobject

      When a contact leaves early.

      • eventsarray<object>

        Events that take a contact out early, each {"event": "order_completed"}, optionally only when the event's properties match where.

        • eventstringrequired

          Which delivery event to pretend happened.

        • wherearray

          Optional. Conditions on the event's properties, like a segment's rules.

        • matchstringall | any

          all conditions in where must match, or any one.

      • on_unsubscribeboolean

        Take the contact out when they unsubscribe.

      • on_replyboolean

        Take the contact out when they reply to one of its emails.

      • segments_enteredarray<string>

        Take the contact out when they join one of these segments, by segment ID.

    • goalsarray

      What counts as success, shown in the automation's report.

    • streamstringmarketing | transactional

      transactional for emails your app sends one at a time, like receipts and sign-in codes; marketing for newsletters and promotions. They go out from different addresses so one cannot harm the other.

    • cooldown_hoursinteger

      With entry_rule: cooldown: how many hours before a contact may go through again.

Request

PUT/api/v1/automations/{automation}
curl -X PUT 'https://app.mailyte.com/api/v1/automations/01JBT8XQ2M9WYC3K4F6R7S8T9V' \
  -H 'Authorization: Bearer mk_live_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Welcome series"
  }'
The key names its own organization, so no X-Organization-ID header is needed.

Response

Success.

  • dataobject
    • idstring
    • namestring
    • statestringdraft | live | paused | archived
    • entry_rulestringonce | every_time | cooldown

      Whether a contact may enter more than once.

    • settingsobject
      • exit_eventsarray<string>

        Event names that end a run early, checked before every step.

      • exitsobject

        The full exit rules: events (with optional property filters), whether unsubscribing exits, and segments whose entry exits.

        • eventsarray<object>
        • on_unsubscribeboolean
        • on_replyboolean

          Leave the journey when the contact replies to any of its emails (auto-replies ignored).

        • segments_enteredarray<string>
      • streamstringmarketing | transactional
      • cooldown_hoursinteger
    • graphobject

      The editable draft: {nodes[{id,type,config}], edges[{from,to,branch?}]}. Publishing snapshots it into a version.

    • validationobject
      • okboolean
      • errorsobject

        Problems keyed by node id (nodes.<id>.<field>) or graph/settings.

    • live_versionobject
      • idstring
      • numberinteger
      • published_atstring
    • paused_bystringuser | breaker
    • countsobject
      • in_flightinteger

        Runs that have not finished.

      • completedinteger
      • exitedinteger
      • failedinteger
      • emails_sentinteger

        Emails this automation has actually sent, across every version. Only counted on the list; 0 elsewhere.

    • published_atstring
    • paused_atstring
    • archived_atstring
    • created_atstring
    • updated_atstring

Returned inside the standard envelope.

Errors

StatusWhen
401The API key is missing, unknown, revoked or expired. All four answer identically, on purpose: distinguishing them would confirm which keys exist.
403The key is valid but may not do this: it lacks the required scope, its IP allowlist does not include you, or this endpoint does not accept API keys.
404No such resource in this organization.
422The request was understood but the values were not acceptable.
429Too many requests, or the organization has spent its sending allowance. `Retry-After` says how long to wait.

Every status, with what causes it and what to do, is on the error reference.