On this page

Standing orders

Save one repeating mailing once, then turn each new list into an order with one call, or with none when the API fetches the list on a schedule. A standing order never mails the same person twice inside its window, and never prints anything a person at the dealer has not approved.

What a standing order is

Your platform keeps rolling audiences: "bought here, never serviced, last service 7 to 12 months ago", refreshed every week. Without a standing order, every mailing to such an audience is a one-off campaign: create it, import the list, generate the creative, render the proof, quote it, request approval, and submit once the dealer's approver approves on the review page (Quotes and approvals).

A standing order saves everything about one repeating mailing for one dealer: the product, the template creative and its copy, the mail class, the most one mailing may cost, who approves, how long to skip people already mailed, and optionally where to fetch each new list and when, or which emailed report brings it (Emailed lists). A run takes one list and does every step for you, through the same code the campaign endpoints run, so each run is an ordinary campaign you can read, follow by webhook and finish by hand:

  1. It reads the list and removes everyone the standing order mailed within its window (already_mailed).
  2. With nobody left, it stops: no campaign, no approval, nothing to clean up (nothing_to_mail).
  3. Otherwise it creates a campaign named "<standing order name>, <date>", imports the list, generates the creative, renders the proof, quotes it at the saved mail class and requests approval with the saved max_spend_cents and approver.
  4. The dealer's approver decides on the review page, as for any order. Nothing prints until they approve this run's order.
  5. Approved, the order submits itself (submit_on_approval, on by default), or waits for your submit.

A standing order belongs to one dealer, in the mode of the key that created it: a sandbox key's standing orders, runs and history are apart from a live key's. A key limited to some dealers sees and runs only their standing orders.

Create a standing order

POST /v1/standing-orders, with an optional Idempotency-Key that replays a retry as campaign create does.

curl -s -X POST "$API/v1/standing-orders" \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "dealer_id": "demo-motors",
    "name": "Service lapsed 7 to 12 months",
    "product_code": "postcard_6x9",
    "creative": {
      "template_code": "postcard_6x9_we_missed_you",
      "copy": {
        "message": "It has been a while since your {{recipient.vehicle|vehicle}} was in. Bring it by and we will tell you what it needs.",
        "offer": "$30 off any service",
        "signer_name": "Alex Rivera"
      }
    },
    "max_spend_cents": 50000,
    "approver_email": "gm@demomotors.example",
    "source_url": "https://exports.example.com/audiences/lapsed.csv?sig=...",
    "cadence": { "every": "month", "day": 1 },
    "column_map": { "customer_id": "external_id" },
    "external_id": "aud-lapsed-service"
  }'
Field Required Meaning
dealer_id yes Xcel's dealer id or your external id.
name yes 1 to 120 characters. Each run's campaign is named after it and the run's date.
product_code yes An offered product (Products).
creative yes The template creative each run generates, as POST /v1/campaigns/{id}/creative takes one: template_code (Xcel's or your own saved template), optional template_version (your own templates), and copy. Store details you leave out (phone, hours, web address, signer) print from the dealer's profile. AI copy from a brief, your own html and print-ready art are not offered here.
max_spend_cents yes The most one run may cost, in cents: a figure a person set in advance, such as the dealer's monthly budget in your platform, never an estimate. Each run's approval request carries it, so the approver sees it, and a run whose quote is over it fails with max_spend_too_low.
mail_class no first_class or marketing_mail, as the product offers. Absent, the product's default: first_class for the postcard (its only class), marketing_mail for the letter and the fold card.
approver_email no Live: one of the dealer's registered approvers (Approvers); leave it out when the dealer has exactly one. Sandbox: any address.
skip_mailed_within_days no 0 to 730, default 90. 0 turns the skip off. See The skip window.
submit_on_approval no Default true: an approved run's order submits itself. false: you submit it (Submitting).
source_url with cadence An https URL that serves the current list as CSV each time it is fetched.
cadence with source_url {"every": "month", "day": 1} (1 to 28) or {"every": "week", "weekday": 1} (1 Monday to 7 Sunday). See On a schedule.
column_map, vehicle_source no As the audience import takes them (Column mapping, Choosing the vehicle). A run may send its own.
external_id no Your id for the standing order, 1 to 100 characters, unique among your standing orders that are not ended. Each run's campaign carries it as external_ref. Never customer data.
inbound_subject no Take lists by email: 1 to 200 characters found in the subject of an email to the dealer's inbound address, normally the audience's title in your platform. Unique among the dealer's standing orders that are not ended. See Emailed lists.

Saving runs the checks a run would meet first, so a standing order that saves can run: the dealer is yours and in the key's scope, the product is offered, the template exists for that product, the creative passes preflight for this dealer with your copy (preflight_failed otherwise, with the first issue's fix; Preview a template shows them all), live approvers are registered (approver_not_registered, approver_email_required, no_registered_approver), source_url and cadence come together or not at all, and the column_map is valid.

The answer, 201:

{
  "standing_order": {
    "id": "4e195151-fda0-4416-bf46-868e89282465",
    "dealer_id": "b5e4e7f5-dc7b-4ca8-97ca-1386702476fb",
    "dealer_external_id": "demo-motors",
    "mode": "test",
    "name": "Service lapsed 7 to 12 months",
    "status": "active",
    "product_code": "postcard_6x9",
    "mail_class": "first_class",
    "creative": { "template_code": "postcard_6x9_we_missed_you", "template_version": null, "copy": { "message": "It has been a while since your {{recipient.vehicle|vehicle}} was in. Bring it by and we will tell you what it needs.", "offer": "$30 off any service", "signer_name": "Alex Rivera" } },
    "approver_email": "g***@demomotors.example",
    "max_spend_cents": 50000,
    "skip_mailed_within_days": 90,
    "submit_on_approval": true,
    "source_url": "https://exports.example.com/audiences/lapsed.csv",
    "cadence": { "every": "month", "day": 1 },
    "column_map": { "customer_id": "external_id" },
    "vehicle_source": null,
    "external_id": "aud-lapsed-service",
    "next_run_at": "2026-12-01T00:00:00.000Z",
    "last_run_at": null,
    "created_at": "2026-11-02T15:00:00.000Z",
    "updated_at": "2026-11-02T15:00:00.000Z"
  },
  "next_step": "The daily job fetches source_url and starts the next run on 2026-12-01. ..."
}

source_url comes back without its query string, where a signing token often travels, and is never written to a log. approver_email is masked.

Start a run

POST /v1/standing-orders/{id}/runs with the list, in the same forms and under the same limits and errors as the audience import:

Body Means
The CSV itself, Content-Type: text/csv This run's list, up to 4.5 MB. column_map (URL-encoded JSON) and vehicle_source go in the query.
JSON {"source_url": "https://..."} A list Xcel fetches once (public address, no redirects, at most 50 MB). column_map and vehicle_source may go in the body.
JSON {} The standing order's own source_url, now.

A run's column_map and vehicle_source, when sent, replace the standing order's for that run only.

curl -s -X POST "$API/v1/standing-orders/$SO/runs" \
  -H "Authorization: Bearer $KEY" -H "Content-Type: text/csv" --data-binary @lapsed-this-week.csv

The answer, 201, holds the run, its counts and the approval request, as POST /v1/campaigns/{id}/approval answers it (in the sandbox with review_url and sandbox_only: true; live, the link goes by email to the approver and is never returned):

{
  "run": {
    "id": "f2fbfe77-606c-465d-b6a3-339e03d6cc78",
    "standing_order_id": "4e195151-fda0-4416-bf46-868e89282465",
    "campaign_id": "968eeb0d-3a36-45ae-8868-409a4ea101a2",
    "status": "awaiting_approval",
    "trigger": "request",
    "counts": { "rows": 4, "mailable": 1, "skipped_already_mailed": 3 },
    "approval_id": "64848b53-b41f-46f8-8e09-1d09201fa81f",
    "source_label": null,
    "error": null,
    "created_at": "2026-11-09T15:00:00.000Z",
    "updated_at": "2026-11-09T15:00:00.000Z"
  },
  "approval": {
    "approval_id": "64848b53-b41f-46f8-8e09-1d09201fa81f",
    "status": "pending",
    "approver_email": "g***@demomotors.example",
    "total_cents": 103,
    "expires_at": "2026-11-16T15:00:00.000Z",
    "prescreen_attestation": null,
    "review_url": "https://api.updash.com/review/...",
    "sandbox_only": true
  },
  "next_step": "Sandbox: open approval.review_url ... Once approved, the order submits itself, and the run's status turns submitted. ..."
}

counts.rows is the list's data rows, mailable what the order mails, and skipped_already_mailed the rows removed by the skip window. The campaign's audience report has the rest: every reason code, each rejected row with your external_id (Reconciliation report). The campaign's metadata holds standing_order_id and standing_order_run_id, so every campaign webhook names the run it came from.

One run of a standing order builds at a time: a second while the first is still building is 409 standing_order_run_in_progress. A run that has built its order and waits on its approver does not block the next one: the next run skips the people it holds (The skip window).

GET /v1/standing-orders/{id}/runs lists the runs, newest first (limit, starting_after); GET /v1/standing-orders/{id} answers the standing order with its last ten runs.

The run lifecycle

Diagram: The run lifecycleRegistered approverUpDash Mail APIPartner or your platformRegistered approverUpDash Mail APIPartner or your platformalt[approved and submit_on_approval][approved, submit_on_approval false][rejected]alt[nobody left to mail][people to mail]POST /v1/standing-orders/{id}/runs (CSV, or source_url)read the list, skip people mailed within the windowrun nothing_to_mail (no campaign, no approval)campaign, audience, creative, proof, quotereview link (live: by email)run awaiting_approval, campaign_id, counts, approvalapprove or reject on the review pagesubmit the order (spend cap and every submit check)campaign.status_changed to submitted (webhook)POST /v1/campaigns/{campaign_id}/submitrun rejected, approval.decided (webhook)
Diagram source (Mermaid)
sequenceDiagram
    participant P as Partner or your platform
    participant API as UpDash Mail API
    participant A as Registered approver
    P->>API: POST /v1/standing-orders/{id}/runs (CSV, or source_url)
    API->>API: read the list, skip people mailed within the window
    alt nobody left to mail
        API-->>P: run nothing_to_mail (no campaign, no approval)
    else people to mail
        API->>API: campaign, audience, creative, proof, quote
        API->>A: review link (live: by email)
        API-->>P: run awaiting_approval, campaign_id, counts, approval
        A->>API: approve or reject on the review page
        alt approved and submit_on_approval
            API->>API: submit the order (spend cap and every submit check)
            API-->>P: campaign.status_changed to submitted (webhook)
        else approved, submit_on_approval false
            P->>API: POST /v1/campaigns/{campaign_id}/submit
        else rejected
            API-->>P: run rejected, approval.decided (webhook)
        end
    end
status Meaning
building The run is making its order.
awaiting_approval Its order waits on the dealer's approver, or on your submit after approval.
submitted Its order was submitted, by itself or by you. Its people now count as mailed.
rejected The approver rejected it. Its people do not count as mailed.
expired Its approval (or the quote under it) ran out before the order was submitted.
nothing_to_mail Nobody on the list was left to mail. No campaign was made.
failed A step failed: error.code and error.message are that step's error.

A failed run answers the step's error, with the status and code the campaign endpoint would have given (for example 400 max_spend_too_low when the quote is over max_spend_cents, 422 preflight_failed, 422 audience_url_unreachable, 429 proof_render_rate_limited). A run that failed after making its campaign leaves that campaign as it stood: campaign_id names it, and you can finish it by hand like any campaign or leave it. A list that fails before anything is made (a file the intake refuses, a fetch that fails) makes no campaign.

The daily job also settles runs: one whose approval expired becomes expired, and a run still building long after its process stopped becomes failed with run_interrupted.

The skip window

skip_mailed_within_days (default 90) keeps a standing order from mailing the same person twice inside the window. A run removes from its list:

  • everyone a submitted run of this standing order mailed within the last skip_mailed_within_days days, counted from that order's submit, and
  • everyone another run of this standing order holds while its order waits on its approver (or was submitted a moment ago), so two runs that overlap never both mail one person.

Each removed row is rejected with the reason code already_mailed in the campaign's audience report, with its external_id in rejected_rows, and counted in the run's skipped_already_mailed.

A person is known two ways: by name and address, as dedupe compares them, and, when the row has one, by its external_id. So someone who moved but keeps your platform's id is still known, and so is someone whose id changed but who still lives at the same address. Only a run's mailable rows count: rows the intake rejected, suppressed or skipped are not recorded. A rejected, expired or failed run's people do not count, so the next run mails them.

What is kept is hashes only, one or two per person per run, never a name or an address; each covers the standing order, so nothing joins one standing order's history to another's. The skip applies to every audience the run's campaign completes, including one you upload to it by hand, and that audience's people become the run's. 0 turns the skip off; changing the window applies to the next run.

On a schedule

Give a standing order a source_url and a cadence, and Xcel's daily job (about 03:17 UTC) fetches the list and starts a run on each scheduled day:

cadence Runs
{"every": "month", "day": 1} On that day of every month, 1 to 28, so every month has it.
{"every": "week", "weekday": 1} On that day of every week, 1 Monday to 7 Sunday.

next_run_at says when the next run is due (midnight UTC of that day), and last_run_at when the job last started one. The job moves next_run_at on by the cadence before it runs, whether the run then works or not, so a failed fetch waits for the next scheduled day rather than retrying all day; start a run yourself with {} to retry at once. Each scheduled run has trigger: "schedule". A paused standing order is skipped; setting it active again, or changing its cadence or source_url, counts the next run from that moment, so a day missed while paused never runs late.

The URL must serve the current list to anyone who has it, as CSV, each time it is fetched: a link that expires after one use only works once. Keep any token in the URL's path or query; the query is never returned or logged.

Emailed lists

Many CDPs and CRMs email an audience report on a schedule, and some can do nothing else. Each dealer has one inbound address per mode, and an email to it starts a run of the standing order its subject names: no code on your side, no URL to host.

1. Turn the dealer's address on. PUT /v1/dealers/{id}/inbound-email:

curl -s -X PUT "$API/v1/dealers/demo-motors/inbound-email" \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" -H "Idempotency-Key: $(uuidgen)" \
  -d '{ "enabled": true, "senders": ["reports@your-platform.example", "@demomotors.example"] }'
{
  "dealer_id": "a6936215-660a-4e91-8ed2-1256ac37136c",
  "external_id": "demo-motors",
  "mode": "test",
  "enabled": true,
  "address": "list-sampleinboundaddressnotreal23456@mg.updash.com",
  "senders": ["reports@your-platform.example", "@demomotors.example"],
  "standing_orders": [],
  "pending_forwarding_confirmation": null,
  "updated_at": "2026-11-09T15:00:00.000Z",
  "next_step": "Give a standing order an inbound_subject ..."
}
Field Meaning
enabled true takes emailed lists; false refuses them and keeps the address. The first true gives the dealer its address.
senders Who may email lists: full addresses or @domain entries, up to 50, matched against the envelope sender and the From address. Replaces the list. Empty allows any sender.
rotate true gives the dealer a new address. The old one stops at once.

The address is a secret: anyone who has it can email the dealer a list. Only your own answers for that dealer hold it, never a webhook, a log or an error. Set senders too: a From address is easy to forge, and the list narrows who can start a run even when the address leaks. A sandbox key's address is its own and starts sandbox runs only. GET /v1/dealers/{id}/inbound-email answers the same, with the standing orders that take email. The Idempotency-Key is optional: a retried rotation with the same key rotates once.

2. Name the report on each standing order. Set inbound_subject to the audience's title as the report's subject shows it, on create or with a PATCH. A report whose subject is Daily Digest: "Lapsed service 7-12 months" runs the standing order with "inbound_subject": "Lapsed service 7-12 months".

3. Send the report to the address. In your platform, add a user whose email is the dealer's inbound address, and subscribe that user to each audience's scheduled report, so the report arrives from your platform's own sending address. A report a person forwards works too, from an address or @domain in senders.

What the email carries

  • A CSV attachment. The first attached CSV is the list, read as an import reads one, with the standing order's column_map and vehicle_source, under the same limits (the hosted API takes an email of up to 4.5 MB).
  • Or tables in the body. A report of a few people often comes as an HTML table in the body instead. Every table whose header row matches the first one's is read, their rows together. A report broken down by salesperson, with a heading such as "Shoppers currently assigned to | Ryan, Thomas" above each table, gets a salesperson column with that name (Thomas Ryan), for a custom merge field.
  • With an address. A list must carry each person's address. A body list without an address column fails with inbound_list_missing_address: add Name and Address to the report's columns in your platform, since a list small enough to arrive in the body must carry them too. One column for the whole name and one for the whole address are split (A CDP export as it comes).

An email with neither a CSV attachment nor a table fails the run with inbound_no_list. Each email starts one run: a message your platform or the mail relay sends again, with the same Message-Id, answers the run it started.

Which standing order runs

The subject's audience title is its quoted part ("Lapsed service 7-12 months"), or else the whole subject without Fwd: or Re:. The standing order whose inbound_subject is in that title runs; when none is, one whose inbound_subject is elsewhere in the subject. Case, accents, spacing and punctuation do not count, and only whole words count: Lapsed is in LAPSED service, not in Relapsed. When several match, the longest inbound_subject wins, so Lapsed service 7-12 months beats Lapsed service. So inbound_subject is unique among the dealer's standing orders that are not ended (409 inbound_subject_taken).

The run has trigger: "email" and source_label, the audience's title from the subject. It runs as any run: the skip window, the approval, and nothing prints until the dealer's approver approves.

What arrived What happens
No standing order's inbound_subject in the subject Nothing of the email is kept. inbound_email.unmatched names the dealer, the subject and when it arrived, so you can give the right standing order that subject.
The matching standing order is paused No run starts. standing_order.run_failed with standing_order_paused and run_id null.
A sender not in senders No run starts. standing_order.run_failed with inbound_sender_not_allowed and run_id null, when the subject named a standing order. Nothing about the sender is kept.
An address that is off, rotated or unknown Refused, and nothing is kept.
Another run of the standing order still building The relay sends the email again later.
A list the intake refuses The run fails with the import's error, and standing_order.run_failed names it.

A Gmail mailbox that forwards

When the report lands in a Gmail mailbox and the dealer's staff set it to forward to the inbound address, Gmail first emails the address a confirmation code. The address keeps it: GET /v1/dealers/{id}/inbound-email shows it for 7 days as pending_forwarding_confirmation (code, from, the Gmail address asking, and received_at). Enter the code in that mailbox's forwarding settings. The confirmation starts no run, and a rotation drops it.

Submitting

Nothing prints until a person at the dealer approves each run's order on the review page. Live, the link goes by email only to a registered approver; an API caller, a script or your platform can never approve, and a run's own credentials cannot either.

With submit_on_approval on (the default), an approved run's order submits itself at once, with an idempotency key of its own, under every check a submit makes: the approval's versions and quote, max_spend_cents, the dealer's monthly spend cap and, live, your account's live ordering. A refused submit fails the run with the refusal's code (dealer_spend_cap_exceeded, ordering_disabled, quote_expired, ...) and sends standing_order.run_failed; the order stays approved, so you can submit it yourself once the cause is fixed. The order submits itself only while the standing order is active: a paused or ended standing order's approved orders wait for your submit.

With submit_on_approval: false, submit each approved order yourself, as any campaign: POST /v1/campaigns/{campaign_id}/submit with approval_id and an Idempotency-Key. Either way, the submit records the run's people as mailed.

In the sandbox, decide a run's approval with its review_url, or from a script with POST /v1/test/campaigns/{campaign_id}/approval and the run's approval_id (Sandbox approvals). A scheduled sandbox run has no caller to give review_url to: decide it through that route.

Change, pause or end

PATCH /v1/standing-orders/{id} changes name, status (active or paused), creative, max_spend_cents, approver_email, skip_mailed_within_days, submit_on_approval, source_url, cadence, column_map, vehicle_source and inbound_subject, under the checks create makes. Send null to clear approver_email, source_url with cadence, column_map, vehicle_source or inbound_subject. A change applies to the next run: a run that has made its order keeps the creative, list and spend it was made with. The dealer, product, mail class and external_id are set once; for another, create a new standing order.

DELETE /v1/standing-orders/{id} ends it: no run starts again, its runs and history stay, and a second call answers the same. An ended standing order cannot change. GET /v1/standing-orders lists yours, newest first (dealer_id, status, external_id, limit, starting_after).

Over MCP

An agent runs the same standing orders through seven tools of the MCP server, each calling the code these endpoints call:

Tool Does
save_standing_order Creates a standing order (POST /v1/standing-orders), or with standing_order_id changes one (PATCH /v1/standing-orders/{id}), pause included.
list_standing_orders GET /v1/standing-orders.
get_standing_order The standing order, with its runs ten at a time (runs_after pages to older ones).
end_standing_order DELETE /v1/standing-orders/{id}.
start_standing_order_run POST /v1/standing-orders/{id}/runs with a source_url, or none for the standing order's own. A tool never takes the list's rows, so the CSV body is REST only.
get_dealer_inbound_email, update_dealer_inbound_email GET and PUT /v1/dealers/{id}/inbound-email.

The rules are the same: max_spend_cents is a budget a person set, never the agent's estimate, and nothing prints until a person at the dealer approves each run's order on the review page.

Webhooks

Type When data
standing_order.run_created A run built its order and asked the approver, or found nobody left to mail standing_order_id, standing_order_external_id, mode, dealer_id, dealer_external_id, run_id, campaign_id (null for nothing_to_mail), status, trigger, counts
standing_order.run_failed A run failed, its own submit included, or an emailed list started none The same, with error_code and error_message
inbound_email.unmatched An email reached a dealer's inbound address, and no standing order's inbound_subject is in its subject mode, dealer_id, dealer_external_id, subject, received_at

They go to your endpoints of the standing order's (or the address's) mode, and GET /v1/events lists them in that mode only (Webhooks). The run's campaign sends its own events as any campaign does, each with the run's ids in metadata.

Errors

Code Status Cause
standing_order_paused 409 A run of a paused standing order. Set it active first.
standing_order_ended 409 A run of, or a change to, an ended standing order.
standing_order_run_in_progress 409 Another run of this standing order is still building. Wait for it.
standing_order_external_id_taken 409 Another standing order of yours that is not ended has this external_id.
inbound_subject_taken 409 Another standing order of the dealer that is not ended has this inbound_subject, ignoring case, spacing and punctuation.
inbound_email_unavailable 503 Turning on or rotating a dealer's inbound address where this server takes no email.
inbound_no_list 422 On an emailed run: the email had no CSV attachment and no table with a header row.
inbound_list_missing_address 422 On an emailed run: the list has no address column. Add Name and Address to the report's columns.
inbound_sender_not_allowed 403 On standing_order.run_failed: an email came from a sender not in the dealer's senders, and no run started.
standing_order_changed 409 The standing order changed while the request ran. Fetch it and retry.
run_interrupted 409 On a run: it stopped before it finished, and a newer run or the daily job took its place.
invalid_request 400 A run with no list, or source_url without cadence (or the reverse), a source_url that is not https, or an inbound_subject with no letters or digits.
preflight_failed 422 The creative fails preflight for this dealer.

A run's own failures are the campaign steps' errors (Errors), recorded on the run and sent as standing_order.run_failed.