> 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.

# Validate an automation workflow

POST https://api.brevo.com/v3/automation/workflows/validate
Content-Type: application/json

Checks a whole automation workflow, the same body as `POST /automation/workflows`, against your account, without creating or changing anything. A 200 does not mean the workflow is valid: read `valid`. Unknown fields and values of the wrong JSON type are reported there too, as `unknown_field` and `invalid_value` errors.

The response lists every problem with its JSON path and a `code`: a wrong or missing field, an unknown template, list, segment, attribute or custom event (`template_not_found`, `list_not_found`, `segment_not_found`, `attribute_not_found`, `event_not_found`), a type your plan does not include (`restricted_by_plan`), a field not enabled for your account (`not_available`), steps that do not form valid paths (`invalid_graph`), or a `start_another_workflow` target that does not exist (`workflow_not_found`, `workflow_step_not_found`). It also lists warnings that do not block, each with a `message`, for example `reentry_recommended` (a recurring trigger without `reentry` allowed runs each contact through the workflow at most once), `destination_inactive` (a `start_another_workflow` target that is not active), `loop_without_delay` (a `go_to_step` loop with no `time_delay`), `list_name_replaced`, `segment_name_replaced`, `unicode_needed`, `us_compliance_off` and `event_data_unavailable`.

With `workflow_id`, the body is checked as an edit of that workflow, exactly as `PUT /automation/workflows/{workflowId}` would apply it: send `version` and the integer IDs of the triggers and steps the edit keeps. 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. The response then adds `changes`, `impact` (contacts waiting on steps the edit removes) and `current_version`, and a refusal of the edit (`version_conflict`, `unsupported_workflow`, `contacts_would_exit`) is returned as an error of a `valid: false` response. Without `workflow_id`, `version` and `confirm_contact_exit` are refused.

Reference: https://developers.brevo.com/reference/validate-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

### Query parameters

- `workflow_id` (long, optional) — Optional. The ID of an existing automation. The body is then checked as an edit of it, exactly as `PUT /automation/workflows/{workflowId}` would apply it (send `version` and the integer ids of the nodes it keeps), and the answer adds `changes` and `impact`. Nothing is written.

### 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 AutomationWorkflowsValidatePostRequestBodyContentApplicationJsonSchemaTriggersItems, required) — What starts the automation: 1 to 3 trigger objects, each type at most once. 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 AutomationWorkflowsValidatePostRequestBodyContentApplicationJsonSchemaStepsItems, required) — What the automation does, 1 to 50 step objects, one after the other, divided into paths by a percentage\_split: `{"id": "<your label>", "type": "<step type>", "<step type>": {<fields>}, "next": "<label of the next step>" or null}`. `id` is your own label (letters, digits, \_ or -, unique), `next` is required: another step's id, or null for the last step of a path. 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).
- `description` (string, optional) — Optional internal description of the automation
- `reentry` (AutomationWorkflowsValidatePostRequestBodyContentApplicationJsonSchemaReentry, 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.
- `version` (string, optional) — Only with `workflow_id`, and then required. The `version` that `GET /automation/workflows/{workflowId}` returned. Refused without `workflow_id`.
- `confirm_contact_exit` (boolean, optional) — Only with `workflow_id`. True to accept that the contacts waiting on the removed steps leave the automation. Refused without `workflow_id`.

## Response

### 200

Validation result. A 200 does not mean valid; read `valid`.

- `valid` (boolean, optional) — True when `POST /automation/workflows` would accept this body
- `errors` (list of AutomationWorkflowsValidatePostResponsesContentApplicationJsonSchemaErrorsItems, optional) — Every problem found, each with the JSON `path` in the request (for example steps[2].time_delay.duration), a `code` (required, invalid_value, invalid_graph, unknown_field (a key the request does not have; `version` or `confirm_contact_exit` without `workflow_id` means an update body: validate it with `workflow_id`), unknown_step, unsupported_type, restricted_by_plan, not_available, event_not_found, template_not_found; with `workflow_id` also version_required, version_conflict, unsupported_workflow, unknown_step_id, unknown_trigger_id, unsupported_setting and contacts_would_exit) and a `message`. Empty when valid.
- `warnings` (list of AutomationWorkflowsValidatePostResponsesContentApplicationJsonSchemaWarningsItems, optional) — Problems that do not block the draft but should be resolved before activating it, each with `path`, `code` and `message`: template\_inactive and template\_no\_sender (with `template_id`; a template made with `POST /smtp/templates` sends from the sender of its `senderId`, so pass an active sender from `GET /senders` when you make one), reentry\_recommended (path triggers\[i]) for an order\_created, cart\_updated, page\_visited, contact\_match\_one\_segment or anniversary trigger when `reentry` is not allowed, because each contact will then run the workflow at most once, ever; list\_name\_replaced and segment\_name\_replaced (a list or segment name differs from the account's; the account's name is stored); unicode\_needed (SMS content with characters outside the GSM 7-bit alphabet and unicode false); us\_compliance\_off (organisation\_prefix or unsubscribe\_instructions sent with manage\_us\_compliance false; they are not stored); event\_data\_unavailable (a call\_webhook include\_event\_data, or SMS content with `{{ params.* }}` and no event\_data, when not every trigger is an event: the event variables stay empty).
- `definition` (automationWorkflowDefinition, optional) — When valid, the automation as it would be created or, with `workflow_id`, as it would be after the edit. Its `version` is only a preview of the version after the edit; never send it as `version` (send `current_version`).
- `changes` (map from string to any, optional) — With `workflow_id` only. What the edit would do, as `PUT /automation/workflows/{workflowId}` returns it (workflow name\_changed, description\_changed and reentry\_changed; triggers and steps kept, changed, added, replaced, removed, moved, where moved is a subset of kept; templates copied and kept)
- `impact` (map from string to any, optional) — With `workflow_id` only. `{"waiting_contacts", "steps": [{id, type, waiting_contacts}]}`: the contacts waiting on steps the edit removes from an active or paused automation; they would leave it
- `current_version` (string, optional) — With `workflow_id`, always (valid or not). The automation's stored version, the one to send as `version` to `PUT /automation/workflows/{workflowId}`; when it differs from the `version` you sent, the answer has a version\_conflict error.
- `unsupported` (list of map from string to any, optional) — With `workflow_id`, on an unsupported\_workflow error only. The parts the public API cannot express, each `{kind (trigger, step, condition or workflow, as for more than 3 entry triggers), id, type, reason}`; the automation can only be edited in the Brevo editor.

## Errors

### 400 Bad Request Error

The body is not JSON (malformed, empty or truncated) or has data after the JSON value; a `next` is not a whole number, a text label or null, or an id or `next` is above 2147483647; or `workflow_id` is not a positive integer. Unknown fields and values of the wrong JSON type are not a 400: they come back as `unknown_field` and `invalid_value` errors of a 200 with `valid: false`.

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

### 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 create 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 `workflow_id` in the account

- `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 the validation needs is 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

### AutomationWorkflowsValidatePostRequestBodyContentApplicationJsonSchemaTriggersItems

- `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` (AutomationWorkflowsValidatePostRequestBodyContentApplicationJsonSchemaTriggersItemsId, optional) — Only with `workflow_id` (a dry run of an edit). 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. With `workflow_id`, 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 AutomationWorkflowsValidatePostRequestBodyContentApplicationJsonSchemaTriggersItemsListsItems, 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` (AutomationWorkflowsValidatePostRequestBodyContentApplicationJsonSchemaTriggersItemsSegment, 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` (AutomationWorkflowsValidatePostRequestBodyContentApplicationJsonSchemaTriggersItemsOffset, optional) — anniversary only. Required with before_the_date and after_the_date, not used with same_day.

### AutomationWorkflowsValidatePostRequestBodyContentApplicationJsonSchemaStepsItems

- `id` (AutomationWorkflowsValidatePostRequestBodyContentApplicationJsonSchemaStepsItemsId, required) — Your label for this step, unique in the request. 1 to 32 letters, digits, \_ or -. Not stored; Brevo assigns the real step IDs. With `workflow_id` (a dry run of an edit), the integer id of an existing step, as `GET /automation/workflows/{workflowId}` returns it, keeps that step; a text label adds a new step. With `workflow_id`, 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 of `workflow_id`, 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` (AutomationWorkflowsValidatePostRequestBodyContentApplicationJsonSchemaStepsItemsNext, required) — The id or label of the step that runs after this one, or null for the last step. Always send it. With `workflow_id`, an integer refers to an existing step.
- `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.

### AutomationWorkflowsValidatePostRequestBodyContentApplicationJsonSchemaReentry

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

### AutomationWorkflowsValidatePostResponsesContentApplicationJsonSchemaErrorsItems

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

### AutomationWorkflowsValidatePostResponsesContentApplicationJsonSchemaWarningsItems

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

### AutomationWorkflowsValidatePostRequestBodyContentApplicationJsonSchemaTriggersItemsId

Only with `workflow_id` (a dry run of an edit). 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. With `workflow_id`, 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

### AutomationWorkflowsValidatePostRequestBodyContentApplicationJsonSchemaTriggersItemsListsItems

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

### AutomationWorkflowsValidatePostRequestBodyContentApplicationJsonSchemaTriggersItemsSegment

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

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

### AutomationWorkflowsValidatePostRequestBodyContentApplicationJsonSchemaTriggersItemsOffset

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`

### AutomationWorkflowsValidatePostRequestBodyContentApplicationJsonSchemaStepsItemsId

Your label for this step, unique in the request. 1 to 32 letters, digits, \_ or -. Not stored; Brevo assigns the real step IDs. With `workflow_id` (a dry run of an edit), the integer id of an existing step, as `GET /automation/workflows/{workflowId}` returns it, keeps that step; a text label adds a new step. With `workflow_id`, 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 of `workflow_id`, or is refused with `unknown_step_id` when the workflow has no step 3.

- integer
- string

### AutomationWorkflowsValidatePostRequestBodyContentApplicationJsonSchemaStepsItemsNext

The id or label of the step that runs after this one, or null for the last step. Always send it. With `workflow_id`, an integer refers to an existing step.

- 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": "mail",
      "type": "send_email",
      "next": 1
    }
  ]
}
```

**Response**

```json
{
  "valid": false,
  "errors": [
    {
      "path": "steps[1].time_delay.duration",
      "code": "invalid_value",
      "message": "duration \"2 days\" is not an ISO 8601 duration such as P2D, PT2H30M, P1M or P2W"
    }
  ],
  "warnings": []
}
```

**SDK Code**

```python response
import requests

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

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

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

print(response.json())
```

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

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

```go response
package main

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

func main() {

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

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

	req, _ := http.NewRequest("POST", 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 response
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Post.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\": \"mail\",\n      \"type\": \"send_email\",\n      \"next\": 1\n    }\n  ]\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.brevo.com/v3/automation/workflows/validate")
  .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\": \"mail\",\n      \"type\": \"send_email\",\n      \"next\": 1\n    }\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

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

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

```csharp response
using RestSharp;

var client = new RestClient("https://api.brevo.com/v3/automation/workflows/validate");
var request = new RestRequest(Method.POST);
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\": \"mail\",\n      \"type\": \"send_email\",\n      \"next\": 1\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift response
import Foundation

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

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.brevo.com/v3/automation/workflows/validate")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```