> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.brevo.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.brevo.com/_mcp/server.

# Update an automation workflow

PUT https://api.brevo.com/v3/automation/workflows/{workflowId}
Content-Type: application/json

Replaces the definition of an existing automation workflow (a draft, an active or a paused one): its name, description, re-entry, triggers and steps. A `description` or `reentry` left out is removed. The status does not change: use `PUT /automation/workflows/{workflowId}/status` for that.

Start from `GET /automation/workflows/{workflowId}?format=request`: its `request` is this body, with the `version` to send. The integer `id` of an existing trigger or step keeps it, and contacts waiting on a kept step stay on it; a text label, such as `reminder`, adds a new one; a stored trigger or step the body leaves out is removed. A label written as a whole number, such as "3", is not a label: it is the id 3, so it names the existing trigger or step 3 (refused with `unknown_trigger_id` or `unknown_step_id` when there is none). Give new triggers and steps labels that contain a letter. IDs are never reused, and a step whose type changes is replaced by a new step. A `send_email` step sent with the `template_id` it already uses keeps its copy of the template. A `call_webhook` step keeps its stored URL, auth and headers only when its `url` is sent back exactly as read (the origin); changing the URL of a webhook that has stored auth or headers without sending them again is refused with `unsupported_setting`.

To see what an edit would do without writing it, send the same body to `POST /automation/workflows/validate?workflow_id={workflowId}`.

Refusals, with nothing changed: 409 `version_conflict` (the workflow changed since it was read: read it again and redo the edit), 409 `unsupported_workflow` (it has conditions or other parts the API cannot express, listed in `unsupported`: edit it in the Brevo automation editor), 409 `contacts_would_exit` (contacts wait on steps the edit removes from an active or paused workflow: send `confirm_contact_exit: true` to accept), and 400 with every problem and its path (`unknown_step_id`: an integer ID that is not a step of this workflow).

Reference: https://developers.brevo.com/reference/update-workflow

## Authentication

- `api-key` header (required) — The API key should be passed in the request headers as `api-key` for authentication.
- `Authorization` header (bearer token, required) — OAuth 2.0 client_credentials (machine-to-machine) grant. Exchange your app's client_id/client_secret for a short-lived Bearer token.

## Request

### Path parameters

- `workflowId` (long, required) — ID of the automation workflow to edit

### Body (application/json)

This endpoint expects an object.

- `name` (string, required) — Name of the automation, as shown in Brevo. 1 to 255 characters.
- `triggers` (list of AutomationWorkflowsWorkflowIdPutRequestBodyContentApplicationJsonSchemaTriggersItems, required) — The whole new list of triggers, 1 to 3 trigger objects, each type at most once. A trigger with the integer `id` that `GET /automation/workflows/{workflowId}` returned keeps that trigger; a trigger without `id` (or with a text label) is new; a stored trigger the body leaves out is removed. Ids are never reused. Each object has `type` plus the fields of that type, at the top level of the object; a field the type does not use is refused. Get the fields with `GET /automation/catalog/{type}/schema`. Types and their fields: `added_to_lists` and `removed_from_lists` (`lists`: \[`{"id", "name"}`] from `GET /contacts/lists`; removed\_from\_lists starts when a contact is removed from one of the lists, not when it is moved from one list to another); `order_created`, `cart_updated`, `page_visited` (no field); `manual_trigger` (no field: it starts only for the contacts someone adds by hand in the Brevo app once the automation is active; this API cannot add them); `custom_event` (`event_name`, one of the `event_names` that `GET /automation/catalog` lists for custom\_event); `contact_match_one_segment` (`segment`: `{"id", "name"}` from `GET /contacts/segments`, `schedule`: `{"time": "9:00" (24-hour H:MM or HH:MM), "timezone": "Europe/Paris", "interval": "daily|weekly|monthly|yearly", "day_of_week": 1=Monday ... 7=Sunday (ISO), ...}`; it runs on every scheduled date, but without `reentry` allowed a contact goes through it only once); `anniversary` (`attribute`: a date attribute from `GET /contacts/attributes`, `when`: same\_day|before\_the\_date|after\_the\_date, `offset`: `{"duration", "unit": day|week|month}` for before or after, `schedule`: `{"time", "timezone"}`; it compares day and month only, so it matches every year, and a yearly send, such as a birthday email, needs `reentry` allowed).
- `steps` (list of AutomationWorkflowsWorkflowIdPutRequestBodyContentApplicationJsonSchemaStepsItems, required) — The whole new chain of steps, 1 to 50 step objects: `{"id": <id or label>, "type": "<step type>", "<step type>": {<fields>}, "next": <id or label of the next step> or null}`. `id`: the integer id of an existing step, as `GET /automation/workflows/{workflowId}` returned it, keeps that step and the contacts waiting on it; a text label (letters, digits, \_ or -, such as "reminder") adds a new step; a stored step the body leaves out is removed, and contacts waiting on it leave the automation. Ids are never reused: a new step always gets a new id, and a step sent with another type than the stored one is replaced by a new step. A send\_email step sent with the template\_id it already uses (as `GET /automation/workflows/{workflowId}` returns it) keeps its copy of the template; another template\_id is copied again. Changing only the tags, frequency\_cap, send\_window, cc or bcc of a send\_email step keeps its copy and updates those settings; this is refused (`unsupported_setting`) when the step's template is a saved template rather than the automation's own copy, or when it would overwrite a stored setting that `GET /automation/workflows/{workflowId}` does not return. A send\_sms step sent with the template\_id it already uses (as `GET /automation/workflows/{workflowId}` returns it) also keeps its copy. Unique ids; a step follows at most one other step, so paths never join again; every path ends with a step whose next is null; the only paths are the variants of a percentage\_split and the only loop is a go\_to\_step. At least one step must not be a time\_delay, and the last step cannot be a time\_delay. A delete\_contact step must be the last step (next null). The fields of each type go in the object named after the type; get them with `GET /automation/catalog/{type}/schema`. Types and their object: `send_email` `{"template_id", optional "tags", "frequency_cap", "send_window", "cc", "bcc", "event_data"}` (an email template from `GET /smtp/templates`, or one made with `POST /smtp/templates` with the `senderId` of an active sender from `GET /senders`, which the automation sends from; it is copied for the automation; "tags": a non-empty array of unique, non-empty strings; "frequency\_cap": true applies the account's email frequency cap to this email; "cc" and "bcc": `{"contact_attribute"}`, the exact name of a text attribute from `GET /contacts/attributes` that holds an email address, matched as for update\_contact\_attribute, fixed addresses are not supported; "send\_window": see below); `time_delay` `{"duration": ISO 8601 such as P2D, PT2H30M, P1M, P2W}`; `add_to_list` and `remove_from_list` `{"lists": [{"id", "name"}]}` from `GET /contacts/lists`; `update_contact_attribute` `{"attribute", "action": set|clear, "type": text|boolean|category|date|number|multiple_choice, "value", "index", "date_mode": custom|dynamic, "operation": replace|add|subtract}` from `GET /contacts/attributes` (send the exact name: an exact match wins, a unique case-insensitive match is rewritten to the account's name, and names that differ only in case are refused with invalid\_value listing them; an attribute that Brevo maintains itself, such as *LAST\_EMAIL\_OPEN\_DATE, is refused with not\_available, while Brevo default attributes such as OPT\_IN, DOUBLE\_OPT-IN or JOB\_TITLE, and user attributes whose name starts with "*", are accepted, as in the editor; a category needs both "index", the option's `value` in the attribute's enumeration, which is what is written to the contact, and "value", that option's label, shown in the editor; they must name the same option, otherwise the step is refused with invalid\_value; a custom date is YYYY-MM-DD, other formats are refused; a number attribute (the float type of `GET /contacts/attributes`) needs "operation" with set, and "operation" is refused on any other type: replace writes "value", a JSON number, and add or subtract change the contact's current value by it (not negative); a multiple\_choice "value" is a non-empty array of option labels from the attribute's `multiCategoryOptions`; clear works for both and takes no value); `call_webhook` `{"url", "include_contact_attributes", "include_event_data", "auth", "headers"}` (include\_event\_data when not every trigger is an event is accepted with an event\_data\_unavailable warning; send `auth` or `headers` only when call\_webhook in `GET /automation/catalog` has no `unavailable_fields` listing them: they are refused with `not_available` when webhook authentication is not enabled for the account); `send_sms` `{"sender", "content" or "template_id", "sms_type": transactional|marketing, optional "unicode", "send_window", "event_data", "link_tracking" (true shortens and tracks the links of the SMS, as the editor's link shortener does), and for a text SMS "manage_us_compliance", "organisation_prefix", "unsubscribe_instructions"}` ("template\_id": an SMS template from `GET /transactionalSMS/templates`, copied for the automation, instead of "content"; it is not allowed with content or the US compliance fields, and it is refused with `not_available` when send\_sms in `GET /automation/catalog` lists it in `unavailable_fields`; warnings: unicode\_needed, us\_compliance\_off and event\_data\_unavailable, see the send\_sms object); `delete_contact` `{}` (deletes the contact and its data, which cannot be undone; it must be the last step); `blocklist_contact` `{"scope": transactional|marketing|both, "senders": [sender email addresses]}` ("senders" is required with transactional, optional with both and refused with marketing; take them from `GET /senders`, as they are not checked against the account). `start_another_workflow` `{"workflow_id", optional "step_id"}` (moves the contact into another automation of the account, from `GET /automation/workflows`, at its first step or at "step\_id", a step id of that automation as `GET /automation/workflows/{workflowId}` returns it; never this automation itself, use go\_to\_step for that; the target must be active when contacts reach the step, otherwise they skip it: an inactive target gives the warning destination\_inactive, and an unknown one is refused with workflow\_not\_found or workflow\_step\_not\_found); `go_to_step` `{"step"}` (jumps back to another step of this automation, by its id or label, not to itself or to another go\_to\_step; it ends its path, so its own next is null; the engine sends a contact through the same go\_to\_step at most 5 times; a loop with no time\_delay in it gives the warning loop\_without\_delay); `percentage_split` `{"variants": [{"percentage", "next"}]}` (divides contacts at random between 2 or more paths: each variant has a percentage, above 0 with at most one decimal, all of them summing to 100, and "next", the id of the first step of its path or null to end that path at the split; the split's own next is null; 2 variants on any plan and up to 10 on Enterprise and Pro plans, more is refused with restricted\_by\_plan). "send\_window" (send\_email and send\_sms) is `{"timezone": IANA such as Europe/Paris, required, and exactly one of "days": [{"day": monday ... sunday, "from": "HH:MM", "to": "HH:MM"}] (each day at most once, two-digit 24-hour times from 00:00 to 23:59, from before to; outside them the message waits for the next allowed time) or "exact_date_time": RFC 3339 such as 2026-12-24T09:00:00+01:00, in the future and at most 2 years ahead}`; without it the message is sent as soon as the contact reaches the step. "event\_data" (send\_email and send\_sms, optional) is `{"mode": "event_triggered_automation"}` (the event that started the run) or `{"mode": "latest_event_instance", "source", "event_name"}` (the contact's latest event of that kind, whatever started the run; source and event\_name are required and must be an event the account has, as in `GET /automation/catalog`); it is what the `{{ params.* }}` variables of the message read. Without it, a step of a workflow whose triggers are all events uses the triggering event (reading the workflow back shows it as event\_triggered\_automation), and other workflows get no event data. event\_triggered\_automation with no event trigger is accepted with the warning event\_data\_unavailable (the variables stay empty).
- `version` (string, required) — Required. The `version` that `GET /automation/workflows/{workflowId}` returned for this automation (with `format` request it is also inside `request`). An automation changed since that read is refused with 409 `version_conflict`.
- `description` (string, optional) — Optional internal description of the automation. The edit is a full replace, so leaving it out removes the stored description; `GET /automation/workflows/{workflowId}` with `format` request includes it in `request` when the automation has one, so keep it to keep it.
- `reentry` (AutomationWorkflowsWorkflowIdPutRequestBodyContentApplicationJsonSchemaReentry, optional) — Optional. Whether a contact can enter the automation again: `{"allowed": true, "delay": "P1D"}`. Omitted = each contact runs this workflow at most once, ever. Set allowed:true (optionally delay) for recurring intents like every order/visit/week/year. `delay` is one ISO 8601 unit (P1M, P2W, P3D, PT5H, PT30M, at most 12 months), the minimum time before the same contact can enter again. Send `delay` only with `allowed: true`; it is refused otherwise. Without `allowed: true`, validate and create return a `reentry_recommended` warning for each order\_created, cart\_updated, page\_visited, contact\_match\_one\_segment or anniversary trigger.
- `confirm_contact_exit` (boolean, optional) — Optional. True to accept that the contacts waiting on the steps this edit removes leave the automation (the count is in `impact` of a dry run). Without it, such an edit of an active or paused automation is refused with 409 `contacts_would_exit`.

## Response

### 200

Automation updated

- `id` (long, optional) — ID of the automation
- `status` (string, optional) — Status of the automation, unchanged by the edit
- `version` (string, optional) — The new version, the one `GET /automation/workflows/{workflowId}` now returns; send it with the next edit
- `warnings` (list of AutomationWorkflowsWorkflowIdPutResponsesContentApplicationJsonSchemaWarningsItems, optional) — Problems that do not block, each with `path`, `code`, `message` and, for template warnings, `template_id`. The codes of validation with `workflow_id`, plus: `template_already_copied` (a step kept its copy of a template, so later edits of the source are not used); `contacts_may_exit` (steps of an active or paused workflow were removed, returned even when no contact was waiting on them); `restricted_by_plan`, `not_available`, `event_not_found`, `list_not_found`, `segment_not_found`, `attribute_not_found`, `workflow_not_found` and `workflow_step_not_found` on a trigger or step the edit kept unchanged (create would refuse them); and `propagation_incomplete` (the change is saved but may take up to an hour to reach running contacts; sending the same edit again repairs it).
- `changes` (map from string to any, optional) — What the edit did: `workflow` `{"name_changed", "description_changed", "reentry_changed"}`; `triggers` and `steps` each `{"kept", "changed", "added" [{ref, id, type}], "replaced" [{old_id, old_type, id, type}], "removed", "moved"}` (`moved` is a subset of `kept`: kept nodes now at another place in the chain); and `templates` `{"copied" [{step_id, source_template_id, template_id}], "kept" [{step_id, template_id}]}`
- `impact` (map from string to any, optional) — `{"waiting_contacts", "steps": [{id, type, waiting_contacts}]}`: the contacts that were waiting on removed steps of an active or paused automation
- `definition` (automationWorkflowDefinition, optional) — The workflow after the edit, as `GET /automation/workflows/{workflowId}` returns it

## Errors

### 400 Bad Request Error

The edit is not valid. Nothing was changed. Fix every item of `errors` and send the request again.

- `message` (string, required) — Readable message associated to the failure
- `code` (string, optional) — Error code displayed in case of a failure
- `errors` (list of AutomationWorkflowsWorkflowIdPutResponsesContentApplicationJsonSchemaErrorsItems, optional) — Every problem found, each with the JSON `path` in the request, a `code` (the validate codes including unknown_field, plus version_required, unknown_step_id, unknown_trigger_id and unsupported_setting) and a `message`. Nothing was changed.

### 401 Unauthorized Error

Authentication failed

- `message` (string, required) — Readable message associated to the failure
- `code` (string, optional) — Error code displayed in case of a failure

### 403 Forbidden Error

The API key or OAuth token is not allowed to edit automations: the OAuth token lacks the `automation:write` scope, the user lacks the automation permission, or the API key is restricted.

- `message` (string, required) — Readable message associated to the failure
- `code` (string, optional) — Error code displayed in case of a failure

### 404 Not Found Error

No automation with this ID in the account

- `message` (string, required) — Readable message associated to the failure
- `code` (string, optional) — Error code displayed in case of a failure

### 409 Conflict Error

Nothing was changed. `version_conflict`: the automation changed since it was read; read it again with `GET /automation/workflows/{workflowId}` format request and redo the edit on it. `unsupported_workflow`: it has parts the API cannot express; it can only be edited in the Brevo automation editor. `contacts_would_exit`: contacts wait on steps the edit removes; resend with `confirm_contact_exit: true` to accept that they leave the automation.

- `message` (string, required) — Readable message associated to the failure
- `code` (string, optional) — Error code displayed in case of a failure
- `current_version` (string, optional) — version_conflict only. The automation's current version.
- `unsupported` (list of map from string to any, optional) — unsupported\_workflow only. The parts the public API cannot express, each `{kind (trigger, step or workflow), id, type, reason}`.
- `impact` (map from string to any, optional) — contacts\_would\_exit only. `{"waiting_contacts", "steps": [{id, type, waiting_contacts}]}`

### 424 Failed Dependency Error

An email template could not be copied for the automation (code `failed_dependency`). Nothing was changed.

- `message` (string, required) — Readable message associated to the failure
- `code` (string, optional) — Error code displayed in case of a failure

### 503 Service Unavailable Error

A lookup or a write was unavailable. Try again later.

- `message` (string, required) — Readable message associated to the failure
- `code` (string, optional) — Error code displayed in case of a failure

## Types

### AutomationWorkflowsWorkflowIdPutRequestBodyContentApplicationJsonSchemaTriggersItems

- `type` (enum, required) — Trigger type, as listed by `GET /automation/catalog`
  - Allowed values: `added_to_lists`, `order_created`, `cart_updated`, `custom_event`, `contact_match_one_segment`, `anniversary`, `page_visited`, `removed_from_lists`, `manual_trigger`
- `id` (AutomationWorkflowsWorkflowIdPutRequestBodyContentApplicationJsonSchemaTriggersItemsId, optional) — Optional. The integer id of an existing trigger, as `GET /automation/workflows/{workflowId}` returns it, keeps that trigger. Without an id, or with a text label, the trigger is new. A label written as a whole number, such as "3", is the id 3: it names the existing trigger 3, or is refused with `unknown_trigger_id`.
- `lists` (list of AutomationWorkflowsWorkflowIdPutRequestBodyContentApplicationJsonSchemaTriggersItemsListsItems, optional) — added\_to\_lists and removed\_from\_lists only. Lists that start the automation when a contact is added to one of them (added\_to\_lists) or removed from one of them (removed\_from\_lists), each `{"id", "name"}` from `GET /contacts/lists`.
- `event_name` (string, optional) — custom_event only. Name of the custom event, at most 100 characters; one of `event_names` from `GET /automation/catalog`.
- `segment` (AutomationWorkflowsWorkflowIdPutRequestBodyContentApplicationJsonSchemaTriggersItemsSegment, optional) — contact\_match\_one\_segment only. The segment, `{"id", "name"}` from `GET /contacts/segments`.
- `schedule` (map from string to any, optional) — contact_match_one_segment and anniversary. When the trigger runs. `time` (24-hour H:MM or HH:MM, for example 9:00, 09:00 or 14:30) and `timezone` (IANA, for example Europe/Paris) are required. contact_match_one_segment also takes `interval` (daily, weekly, monthly, yearly; daily when omitted) and only the fields that interval uses: daily `weekdays_only`; weekly `day_of_week` (required, ISO 1=Monday ... 7=Sunday); monthly `repeat_on` (required: first_day_of_month, last_day_of_month, specific_date_of_month or specific_day_of_week); yearly `month` (required, 1 to 12) and `repeat_on`. With repeat_on specific_date_of_month, `date_of_month` (1 to 31) is required; with specific_day_of_week, `week_of_month` (first, second, third, fourth, last) and `day_of_week` are; first_day_of_month and last_day_of_month take neither. A field the interval does not use is refused with invalid_value, an explicit 0 included, and in a yearly schedule date_of_month must exist in month (at most 29 in February, 30 in April, June, September and November). Errors point at the field, for example triggers[0].schedule.day_of_week. anniversary takes only time and timezone.
- `attribute` (string, optional) — anniversary only. Name of a date attribute, from `GET /contacts/attributes`; send the exact name: an exact match wins, a unique case-insensitive match is rewritten to the account's name, and names that differ only in case are refused with invalid_value listing them.
- `when` (enum, optional) — anniversary only. On the date, or before or after it by `offset`. Only the day and month are compared, so the trigger matches every year; a yearly send needs `reentry` allowed.
  - Allowed values: `same_day`, `before_the_date`, `after_the_date`
- `offset` (AutomationWorkflowsWorkflowIdPutRequestBodyContentApplicationJsonSchemaTriggersItemsOffset, optional) — anniversary only. Required with before_the_date and after_the_date, not used with same_day.

### AutomationWorkflowsWorkflowIdPutRequestBodyContentApplicationJsonSchemaStepsItems

- `id` (AutomationWorkflowsWorkflowIdPutRequestBodyContentApplicationJsonSchemaStepsItemsId, required) — The integer id of an existing step, as `GET /automation/workflows/{workflowId}` returns it, keeps that step; a text label (1 to 32 letters, digits, \_ or -) adds a new step. Unique in the request. A label written as a whole number, such as "3", is not a label: it is the id 3, which names the existing step 3, or is refused with `unknown_step_id` when the workflow has no step 3.
- `type` (enum, required) — Step type, as listed by `GET /automation/catalog`
  - Allowed values: `send_email`, `time_delay`, `add_to_list`, `remove_from_list`, `update_contact_attribute`, `call_webhook`, `send_sms`, `delete_contact`, `blocklist_contact`, `start_another_workflow`, `go_to_step`, `percentage_split`
- `next` (AutomationWorkflowsWorkflowIdPutRequestBodyContentApplicationJsonSchemaStepsItemsNext, required) — The id (integer) or label (text) of the step that runs after this one, or null for the last step. Always send it.
- `send_email` (map from string to any, optional) — send\_email steps only: `{"template_id": <ID of an email template>}`, plus optional "tags" (a non-empty array of unique, non-empty strings), "frequency\_cap" (true applies the account's email frequency cap), "send\_window" (`{"timezone", "days": [{"day", "from", "to"}]}` or `{"timezone", "exact_date_time"}`) and "cc" and "bcc" (`{"contact_attribute": <exact name of a text attribute that holds an email address>}`; a unique case-insensitive match is rewritten to the account's name, names that differ only in case are refused with invalid\_value). The template is copied for this automation.
- `time_delay` (map from string to any, optional) — time\_delay steps only: `{"duration": "P2D"}`. ISO 8601 duration in months, weeks, days, hours and minutes; at least 1 minute, at most 999 minutes, hours or days and 60 months.
- `add_to_list` (map from string to any, optional) — add\_to\_list steps only: `{"lists": [{"id": <list ID>, "name": "<list name>"}]}`.
- `remove_from_list` (map from string to any, optional) — remove\_from\_list steps only: `{"lists": [{"id": <list ID>, "name": "<list name>"}]}`.
- `update_contact_attribute` (map from string to any, optional) — update\_contact\_attribute steps only: `{"attribute", "action": "set" or "clear", "type": "text", "boolean", "category", "date", "number" or "multiple_choice"}`. "attribute" is the exact name from `GET /contacts/attributes`: an exact match wins, a unique case-insensitive match is rewritten to the account's name, and names that differ only in case are refused with invalid\_value listing them. An attribute that Brevo maintains itself, such as *LAST\_EMAIL\_OPEN\_DATE, is refused with not\_available; Brevo default attributes such as OPT\_IN or DOUBLE\_OPT-IN, and user attributes starting with "*", are accepted. With set: "value" (a string for text, true or false for boolean; for category both "index", the integer option value from the attribute's enumeration in `GET /contacts/attributes`, which is what is written to the contact, and "value", that option's label, shown in the editor (if they name different options, the contact gets the index's option); for date with "date\_mode": "custom" a date YYYY-MM-DD such as 2026-12-25, any other format is refused); "date\_mode": "dynamic" writes the date the step runs and takes no value. For number, set needs "operation": "replace", "add" or "subtract" and a JSON number "value" (not negative with add or subtract); "operation" is refused on other types. For multiple\_choice, set takes a non-empty array of option labels from the attribute's multiCategoryOptions. clear takes no value.
- `call_webhook` (map from string to any, optional) — call\_webhook steps only: `{"url" (public http or https URL, at most 2048 characters, no credentials in it; localhost, private IP and cluster-internal hosts are refused), "include_contact_attributes": bool, "include_event_data": bool (sends the triggering event; when not every trigger is an event (order_created, cart_updated, custom_event, page_visited) it is accepted with an event_data_unavailable warning, and contacts that did not start from an event send no event data), "auth": {"type": "none", "basic" (username, password) or "token" (token)}, "headers": [{"key", "value"}] (at most 20; keys unique, compared ignoring case; no Authorization header with auth basic or token, which sets it)}`. Errors point at the field: auth.type, auth.username, auth.password, auth.token or headers\[i].key. auth and headers are refused (not\_available) when `GET /automation/catalog` lists them in call\_webhook's `unavailable_fields`: webhook authentication is not enabled for this account. They are never returned by `GET /automation/workflows/{workflowId}`.
- `send_sms` (map from string to any, optional) — send\_sms steps only: `{"sender", "content", "sms_type": "transactional" or "marketing", "unicode": bool}`, or "template\_id" (an SMS template from `GET /transactionalSMS/templates`, copied for the automation) instead of "content". Optional "send\_window", as for send\_email. Optional US compliance, text SMS only: "manage\_us\_compliance", "organisation\_prefix", "unsubscribe\_instructions" (the last two are used only with manage\_us\_compliance true). Warnings: unicode\_needed when content has characters outside the GSM 7-bit alphabet and unicode is not true; us\_compliance\_off when organisation\_prefix or unsubscribe\_instructions are sent without manage\_us\_compliance true (they are not stored); event\_data\_unavailable when content uses event variables (`{{ params.* }}`) while not every trigger is an event and no event\_data is set (they stay empty).
- `delete_contact` (map from string to any, optional) — delete\_contact steps only: `{}` (no fields). Deletes the contact and its data from the account, which cannot be undone. It must be the last step (next null).
- `blocklist_contact` (map from string to any, optional) — blocklist\_contact steps only: `{"scope": "transactional", "marketing" or "both", "senders": [sender email addresses]}`. transactional blocks transactional emails from the senders listed, marketing every marketing email, both both of them. senders is required with transactional, optional with both and refused with marketing; take them from `GET /senders`, as they are not checked against the account.
- `start_another_workflow` (map from string to any, optional) — start\_another\_workflow steps only: `{"workflow_id": <ID of another automation of the account>, "step_id": <optional step ID of that automation>}`. The contact moves into that automation, at its first step or at `step_id`. The target must be active when contacts reach the step, otherwise they skip it.
- `go_to_step` (map from string to any, optional) — go\_to\_step steps only: `{"step": <id or label of another step of this automation>}`. Jumps back to that step; it ends its path, so its own `next` is null. A contact goes through the same go\_to\_step at most 5 times.
- `percentage_split` (map from string to any, optional) — percentage\_split steps only: `{"variants": [{"percentage": <above 0, at most one decimal>, "next": <first step of the path, or null>}]}`. Divides contacts at random between 2 or more paths whose percentages sum to 100; its own `next` is null. 2 variants on any plan, up to 10 on Enterprise and Pro plans.

### AutomationWorkflowsWorkflowIdPutRequestBodyContentApplicationJsonSchemaReentry

Optional. Whether a contact can enter the automation again: `{"allowed": true, "delay": "P1D"}`. Omitted = each contact runs this workflow at most once, ever. Set allowed:true (optionally delay) for recurring intents like every order/visit/week/year. `delay` is one ISO 8601 unit (P1M, P2W, P3D, PT5H, PT30M, at most 12 months), the minimum time before the same contact can enter again. Send `delay` only with `allowed: true`; it is refused otherwise. Without `allowed: true`, validate and create return a `reentry_recommended` warning for each order\_created, cart\_updated, page\_visited, contact\_match\_one\_segment or anniversary trigger.

- `allowed` (boolean, optional) — Contacts can enter the automation again. Omitted or false = each contact runs this workflow at most once, ever.
- `delay` (string, optional) — Minimum time before a contact can enter again, one ISO 8601 unit such as P1D

### AutomationWorkflowsWorkflowIdPutResponsesContentApplicationJsonSchemaWarningsItems

- `path` (string, optional)
- `code` (string, optional)
- `message` (string, optional)
- `template_id` (integer, optional)

### automationWorkflowDefinition

An automation workflow as `GET /automation/workflows/{workflowId}` returns it

- `id` (long, required) — ID of the automation
- `name` (string, required) — Name of the automation
- `version` (string, required) — Identifies the current content of the automation; `PUT /automation/workflows/{workflowId}` needs it
- `status` (enum, required) — active, pause, or inactive (a draft or a stopped automation)
  - Allowed values: `active`, `pause`, `inactive`
- `triggers` (list of AutomationWorkflowDefinitionTriggersItems, required) — Entry triggers, each with `id`, `type`, `source` and `reentry` `{"allowed", "delay"}`, plus the trigger's settings with the same names as in `POST /automation/workflows`, when they are stored: `lists` \[`{"id", "name"}`], `segment` `{"id", "name"}`, `schedule` `{"time", "timezone", "interval", "day_of_week", ...}`, `attribute`, `when` and `offset` `{"duration", "unit"}` for anniversary, `event_name` for a custom event. A custom event trigger has type `custom_event`, whatever editor made it. A setting that is not stored is left out.
- `steps` (list of AutomationWorkflowDefinitionStepsItems, required) — Steps in path order, each with `id`, `type` and `next` (the following step id, or null). A delay reads back as `wait` `{"mode", "duration"}`; an email, SMS, WhatsApp or push message as `message` `{"channel", "template_id"}`, and an email `message` also has `template_name` and `subject`, the name and subject of the template the step sends (its copy; left out when the template is missing), and `source_template_id` when known. Conditions and splits carry their branches, and their own `next` is null. A `percentage_split` reads back both as `split.variants` and as a `percentage_split` object, in the shape create and update take. The settings of a step are in the object named after its type, with the same names as in `POST /automation/workflows`, when they are stored: `add_to_list` and `remove_from_list` `{"lists"}`, `update_contact_attribute` `{"attribute", "action", "type", "value", "index", "date_mode", "operation"}`, `call_webhook` `{"url", "include_contact_attributes", "include_event_data"}`, `send_sms` `{"sender", "content" or "template_id", "sms_type", "send_window", "event_data", ...}`, `send_email` `{"tags", "frequency_cap", "send_window", "cc", "bcc", "event_data"}` next to its `message`, `blocklist_contact` `{"scope", "senders"}`, `delete_contact` `{}`, `start_another_workflow` `{"workflow_id", "step_id", "workflow_name", "step_name"}` and `go_to_step` `{"step"}`. Webhook auth and headers are never returned, and a webhook `url` reads back as its origin only (`https://host`): its path and query can hold a secret. A setting that is not stored is left out.
- `description` (string, optional) — Internal description of the automation, when it has one
- `editor` (string, optional) — Editor the automation was built with
- `editor_url` (string, optional) — Link that opens the automation in the Brevo automation editor; left out when not available

### AutomationWorkflowsWorkflowIdPutResponsesContentApplicationJsonSchemaErrorsItems

- `path` (string, optional)
- `code` (string, optional)
- `message` (string, optional)

### AutomationWorkflowsWorkflowIdPutRequestBodyContentApplicationJsonSchemaTriggersItemsId

Optional. The integer id of an existing trigger, as `GET /automation/workflows/{workflowId}` returns it, keeps that trigger. Without an id, or with a text label, the trigger is new. A label written as a whole number, such as "3", is the id 3: it names the existing trigger 3, or is refused with `unknown_trigger_id`.

- integer
- string

### AutomationWorkflowsWorkflowIdPutRequestBodyContentApplicationJsonSchemaTriggersItemsListsItems

- `id` (integer, required) — List ID
- `name` (string, required) — List name. When it differs from the account's name, the account's name is stored and a list_name_replaced warning is returned.

### AutomationWorkflowsWorkflowIdPutRequestBodyContentApplicationJsonSchemaTriggersItemsSegment

contact\_match\_one\_segment only. The segment, `{"id", "name"}` from `GET /contacts/segments`.

- `id` (integer, required) — Segment ID
- `name` (string, required) — Segment name

### AutomationWorkflowsWorkflowIdPutRequestBodyContentApplicationJsonSchemaTriggersItemsOffset

anniversary only. Required with before_the_date and after_the_date, not used with same_day.

- `duration` (integer, required) — How many units before or after the date
- `unit` (enum, required) — Unit of duration
  - Allowed values: `day`, `week`, `month`

### AutomationWorkflowsWorkflowIdPutRequestBodyContentApplicationJsonSchemaStepsItemsId

The integer id of an existing step, as `GET /automation/workflows/{workflowId}` returns it, keeps that step; a text label (1 to 32 letters, digits, \_ or -) adds a new step. Unique in the request. A label written as a whole number, such as "3", is not a label: it is the id 3, which names the existing step 3, or is refused with `unknown_step_id` when the workflow has no step 3.

- integer
- string

### AutomationWorkflowsWorkflowIdPutRequestBodyContentApplicationJsonSchemaStepsItemsNext

The id (integer) or label (text) of the step that runs after this one, or null for the last step. Always send it.

- integer
- string

### AutomationWorkflowDefinitionTriggersItems

- `id` (integer, optional) — Trigger id. Send it back as the trigger's `id` in `PUT /automation/workflows/{workflowId}` to keep the trigger.
- `type` (string, optional) — Trigger type; `custom_event` for a custom event, whatever editor made it
- `source` (string, optional) — Where the event comes from, for example custom
- `reentry` (AutomationWorkflowDefinitionTriggersItemsReentry, optional) — Whether a contact can enter the automation again. The same for every trigger of the workflow.
- `event_name` (string, optional) — custom_event only. The custom event's name.
- `lists` (list of map from string to any, optional) — Lists that start the automation, each `{"id", "name"}`
- `segment` (map from string to any, optional) — The segment `{"id", "name"}`
- `schedule` (map from string to any, optional) — When the trigger runs, as written to `POST /automation/workflows` (day_of_week is ISO, 1=Monday ... 7=Sunday)
- `attribute` (string, optional) — anniversary only. The date attribute.
- `when` (string, optional) — anniversary only. same_day, before_the_date or after_the_date.
- `offset` (map from string to any, optional) — anniversary only. `{"duration", "unit"}`.
- `incomplete` (boolean, optional) — True when the trigger was saved in the editor without its required choice (a custom event with no event, a list trigger with no list). It starts nothing, and the workflow cannot be edited through the API until it is completed in the editor.

### AutomationWorkflowDefinitionStepsItems

- `id` (integer, required) — Step id assigned by Brevo
- `type` (string, required) — Step type. Besides the types `POST /automation/workflows` accepts, the read view returns the types set in the Brevo editor: wait_until_event, conditional_split, smart_split, send_whatsapp, send_push, notify_by_email, send_one_to_one_email, assign_user, update_company_attribute, create_task, create_deal, duplicate_deal, update_deal_attribute, and `other` for any other type. More types may be added.
- `next` (integer, required, nullable) — Id of the step that runs after this one; null at the end of a path, and for a step that branches

### AutomationWorkflowDefinitionTriggersItemsReentry

Whether a contact can enter the automation again. The same for every trigger of the workflow.

- `allowed` (boolean, optional) — False: each contact runs the workflow at most once, ever
- `delay` (string, optional) — Minimum time before a contact can enter again, ISO 8601; left out when none

## Examples

**Request**

```json
{
  "name": "Welcome series",
  "triggers": [
    {
      "type": "added_to_lists"
    }
  ],
  "steps": [
    {
      "id": 3,
      "type": "send_email",
      "next": 1
    }
  ],
  "version": "v1.b8ae68c34cca6767f93e7a371b35a9ec"
}
```

**Response**

```json
{
  "id": 1,
  "status": "string",
  "version": "string",
  "warnings": [
    {
      "path": "string",
      "code": "string",
      "message": "string",
      "template_id": 1
    }
  ],
  "changes": {},
  "impact": {},
  "definition": {
    "id": 1,
    "name": "string",
    "version": "string",
    "status": "active",
    "triggers": [
      {
        "id": 1,
        "type": "string",
        "source": "string",
        "reentry": {
          "allowed": true,
          "delay": "string"
        },
        "event_name": "string",
        "lists": [
          {}
        ],
        "segment": {},
        "schedule": {},
        "attribute": "string",
        "when": "string",
        "offset": {},
        "incomplete": true
      }
    ],
    "steps": [
      {
        "id": 1,
        "type": "string",
        "next": 1
      }
    ],
    "description": "string",
    "editor": "string",
    "editor_url": "string"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.brevo.com/v3/automation/workflows/1"

payload = {
    "name": "Welcome series",
    "triggers": [{ "type": "added_to_lists" }],
    "steps": [
        {
            "id": 3,
            "type": "send_email",
            "next": 1
        }
    ],
    "version": "v1.b8ae68c34cca6767f93e7a371b35a9ec"
}
headers = {
    "api-key": "<api-key>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.brevo.com/v3/automation/workflows/1';
const options = {
  method: 'PUT',
  headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
  body: '{"name":"Welcome series","triggers":[{"type":"added_to_lists"}],"steps":[{"id":3,"type":"send_email","next":1}],"version":"v1.b8ae68c34cca6767f93e7a371b35a9ec"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.brevo.com/v3/automation/workflows/1"

	payload := strings.NewReader("{\n  \"name\": \"Welcome series\",\n  \"triggers\": [\n    {\n      \"type\": \"added_to_lists\"\n    }\n  ],\n  \"steps\": [\n    {\n      \"id\": 3,\n      \"type\": \"send_email\",\n      \"next\": 1\n    }\n  ],\n  \"version\": \"v1.b8ae68c34cca6767f93e7a371b35a9ec\"\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("api-key", "<api-key>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.brevo.com/v3/automation/workflows/1")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Welcome series\",\n  \"triggers\": [\n    {\n      \"type\": \"added_to_lists\"\n    }\n  ],\n  \"steps\": [\n    {\n      \"id\": 3,\n      \"type\": \"send_email\",\n      \"next\": 1\n    }\n  ],\n  \"version\": \"v1.b8ae68c34cca6767f93e7a371b35a9ec\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.brevo.com/v3/automation/workflows/1")
  .header("api-key", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Welcome series\",\n  \"triggers\": [\n    {\n      \"type\": \"added_to_lists\"\n    }\n  ],\n  \"steps\": [\n    {\n      \"id\": 3,\n      \"type\": \"send_email\",\n      \"next\": 1\n    }\n  ],\n  \"version\": \"v1.b8ae68c34cca6767f93e7a371b35a9ec\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.brevo.com/v3/automation/workflows/1', [
  'body' => '{
  "name": "Welcome series",
  "triggers": [
    {
      "type": "added_to_lists"
    }
  ],
  "steps": [
    {
      "id": 3,
      "type": "send_email",
      "next": 1
    }
  ],
  "version": "v1.b8ae68c34cca6767f93e7a371b35a9ec"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'api-key' => '<api-key>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.brevo.com/v3/automation/workflows/1");
var request = new RestRequest(Method.PUT);
request.AddHeader("api-key", "<api-key>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Welcome series\",\n  \"triggers\": [\n    {\n      \"type\": \"added_to_lists\"\n    }\n  ],\n  \"steps\": [\n    {\n      \"id\": 3,\n      \"type\": \"send_email\",\n      \"next\": 1\n    }\n  ],\n  \"version\": \"v1.b8ae68c34cca6767f93e7a371b35a9ec\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "api-key": "<api-key>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Welcome series",
  "triggers": [["type": "added_to_lists"]],
  "steps": [
    [
      "id": 3,
      "type": "send_email",
      "next": 1
    ]
  ],
  "version": "v1.b8ae68c34cca6767f93e7a371b35a9ec"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.brevo.com/v3/automation/workflows/1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```