Validate an automation workflow
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.
Authentication
The API key should be passed in the request headers as api-key for authentication.
OAuth 2.0 client_credentials (machine-to-machine) grant. Exchange your app’s client_id/client_secret for a short-lived Bearer token.
Query parameters
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.
Request
The whole automation, the same body as POST /automation/workflows. Unknown fields and values of the wrong JSON type are not refused with a 400: they are reported as unknown_field and invalid_value errors of a 200 with valid: false.
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).
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).
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.
Only with workflow_id, and then required. The version that GET /automation/workflows/{workflowId} returned. Refused without workflow_id.
Only with workflow_id. True to accept that the contacts waiting on the removed steps leave the automation. Refused without workflow_id.
Response
Validation result. A 200 does not mean valid; read valid.
True when POST /automation/workflows would accept this body
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.
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).
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).
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)
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
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.
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.