# UpDash Mail API

Order automotive direct mail (postcards, letters and fold cards) for a car dealer through one REST API and one remote MCP server.

## What it is

Xcel Media Group is an automotive direct-mail agency. The UpDash Mail API lets software order mail from Xcel without a phone call or a spreadsheet:

- **REST API** under `/v1`, described by [`/openapi.json`](../openapi.json) (OpenAPI 3.1).
- **Remote MCP server** at `/api/mcp` (Streamable HTTP) with forty-two tools that run the same code as the REST routes, and a proof view in which the approver can see and decide the order inside ChatGPT or Claude. Clients connect by OAuth 2.1 from the URL alone, or with the API key as a header. Webhooks, `GET /v1/account`, the dealer import, profile versions, a template's layout regions, a saved template's versions listing, the artwork upload starts, keys limited to some dealers, a shopper's campaigns (`GET /v1/leads`), a campaign's mailable rows, the event list, a dealer's do-not-mail list, deleting an audience version, renaming a photo of the asset library and the sandbox approval route are REST only.
- **Twenty-four templates**: fourteen 6 x 9 postcards, five tri-fold letters and five fold cards, for birthdays, trade-ins, service, declined work, lease ends, loans almost paid off, open recalls, thanks after service, upcoming service appointments, buyers who never came back for service, accessories for recent buyers, shoppers, showroom visits that didn't end in a sale, conquest, anniversaries, warranties, payment reviews, unsold leads, service customers who bought elsewhere, new owners and the holidays, found by product, use case or a query, with the dealer's logo, brand colors and the piece's PIN and QR code. Image merge fields print the dealer's make logos, vehicle photos and QR codes. Preview a template with your copy, and send the person a **preview link** that opens in a browser for an hour ([Creative](creative.md#templates)). Save your own HTML as a template with typed slots and immutable versions, and use it the same way ([Your own templates](creative.md#your-own-templates)), or send a designer's print-ready PDF, or a PNG or JPEG per side, as static art, and check it with an artwork preview before you create a campaign ([Print-ready artwork](creative.md#print-ready-artwork)).
- **[Template gallery](templates.md)**, every template with images of its front and back, or a card's cover, inside and envelope; **[the designer](console.md#the-designer)** in the partner console, which lays out a piece in the browser, or from a few words for the AI, checks it against the print rules as you work and saves it as one of your templates; and **[Design your own](design-your-own.md)**, a blank file and a ready prompt per product for bringing your own design with ChatGPT or Claude.
- **Review page** at `/review/{token}`, where a human approves the spend.
- **Partner console** at `/console`, where a partner's own staff follow orders and results, keep dealer profiles current and manage keys, webhooks and their team. See [Partner console](console.md).
- **Ops dashboard** at `/ops`, where Xcel staff work the queue of live orders.

REST and MCP call the same service functions, so a request returns the same JSON and the same errors through either one.

## Who it is for

| Reader | Start here |
| --- | --- |
| Developers at a CDP, agency or other partner | [Quickstart](quickstart.md), then [Concepts](concepts.md) and the [API reference](api-reference.md) |
| Developers who know Lob | [Coming from Lob](coming-from-lob.md) |
| A partner's account, operations and support staff | [Partner console](console.md) |
| A platform that serves many dealers | [Running many dealers](partners.md) |
| AI agents and the people who build them | [MCP server](mcp.md) and [`/llms.txt`](../llms.txt) |
| Security and procurement reviewers | [For a vendor review](vendor-review.md), then [Security](security.md) |

## Phase 1 status

Phase 1 is a pilot with people behind the API.

- **Live orders go to the Xcel production team that already mails for dealers.** The sandbox runs end to end.

- A submitted live order goes to the ops queue. Xcel staff run address processing, send the files to the printer and move the order through its statuses by hand.
- Prices are per piece, by product, mail class and your monthly volume tier, with no monthly fee. Signed-in partners see them on the console's [Pricing](/console/pricing) page. Quotes say `placeholder_pricing: false`; quotes made before 0.9.36 said `true`.
- Product specs are researched from USPS rules and print-house templates. The printer has not confirmed them yet (`confirmed_by_printer: false`).
- The hosted service prints proofs to PDF: a review proof with guides for the approver and a print-ready PDF for the printer (`pdf_available: true`). The printer has not confirmed the specs, so a proof is a content and layout check, not a press proof.
- Copy can come from you or from Claude, drafted from a brief, under code-enforced checks ([AI-written copy](creative.md#ai-written-copy)). Every compliance check is a pattern check, not legal review.
- Results come from Xcel's tracking platform (UpDash): responses and matched sales or service, in aggregate and per lead by your `external_id`. A live order reports them only after Xcel staff link it to its UpDash campaign; sandbox orders get simulated results ([Results and attribution](concepts.md#results-and-attribution)).
- The API is live at `https://api.updash.com`. Sandbox access is self-serve: request it at [www.updash.com/developers/agents](https://www.updash.com/developers/agents) (or with the form on [www.updash.com/developers](https://www.updash.com/developers)), sign in to the partner console from the link we email you, and create your sandbox key there ([Get sandbox access](console.md#get-sandbox-access)). Live ordering stays off until Xcel turns it on for your company: [Going live](going-live.md) lists what you do, what Xcel does and how to ask.
- Examples in these docs use `$API` for the base URL: `https://api.updash.com`.
- Some names still say Xcel: the `X-Xcel-*` headers, the MCP server name `xcel-mail-api` and the `XcelMailAPI-Webhooks/1` user agent. They are stable; the product is UpDash Mail API, and Xcel Media Group is the company behind it.

## The mental model

A **partner** (a CDP, an agency or an agent operator) holds API keys. The partner creates its **dealers** (or Xcel does), keeps each dealer's **profile** current (name, address, phones, hours, links, makes, logo and colors) and names its **approvers**, who confirm by email. Xcel keeps each dealer's disclosures, license number and optional monthly spend cap, and reviews approvers whose address is off the dealer's own domain. The partner chooses a **template** and previews it, creates a **campaign** for one dealer and one **product** (tagged with its own `external_ref`), uploads an **audience** CSV (renaming its columns with `column_map` when they differ), fills the template with copy, renders a **proof**, gets a **quote** and asks for **approval**. A human at the dealer approves on the review page. Only then can the partner **submit** the order. Xcel produces it, reports status changes as **events** and signed **webhooks**, and brings back **results** (responses and matched sales or service) per lead, keyed by the partner's `external_id`.

Three rules hold everywhere:

1. Customer rows never come back from the API or MCP and never reach a log. You send the file itself: to a signed storage URL, as a link Xcel fetches once, or as a `text/csv` request body, which goes straight to private storage. Rows never go in a JSON field or a tool argument, and responses carry ids, counts, reason codes and row numbers only.
2. Brand values are locked in a creative. Logo, colors, phone, dealer name and address come from the dealer profile version the creative was made with, and disclosures from Xcel. A creative request that tries to set them is refused; change the profile instead. The one exception is the printed phone: send your own number for a campaign as `cta_phone`. (Print-ready artwork is static and carries its own; only the return address prints from the profile.)
3. Only a human approves spend. An API caller or agent cannot approve a live order, and nothing it says counts as approval. A sandbox key can decide its own sandbox order, where nothing prints or bills.

## Campaign lifecycle

```mermaid
flowchart TD
    A[Create campaign] --> B[Upload audience CSV<br/>signed URL, then complete]
    B --> C[Generate creative<br/>template + copy]
    C --> D{Preflight errors?}
    D -- yes --> C
    D -- no --> E[Render proof<br/>status: proof_ready]
    E --> F[Get quote]
    F --> G[Request approval<br/>status: awaiting_approval]
    G --> H{Human decision<br/>on the review page}
    H -- reject --> I[status: proof_ready<br/>change and ask again]
    I --> C
    H -- approve --> J[status: approved]
    J --> K[Submit with Idempotency-Key<br/>status: submitted]
    K --> L[in_production]
    L --> M[at_usps]
    M --> N[in_postal_network]
    N --> O[delivery_estimated]
    O --> P[completed]
```

Changing the creative or the audience at any point before submission sends the campaign back to `draft` and voids the proof, quote and approval for the old versions. See [Concepts](concepts.md#campaign-state-machine) for every allowed transition, including `cancelled`.

`at_usps`, `in_postal_network`, `delivery_estimated` and `completed` rest on USPS processing scans. They show mail moving through postal facilities. They are not proof of delivery to a mailbox.

## Test and live

| | Sandbox (`xm_test_...`) | Live (`xm_live_...`) |
| --- | --- | --- |
| Data | Separate from live; a test key never sees live campaigns | Separate from test |
| Address processing | Simulated; every address passes at once | Xcel runs CASS and NCOA by hand; the audience waits in `pending_address_processing` |
| Approval link | Returned as `review_url` with `sandbox_only: true` | Emailed only to a registered approver; never returned |
| Approver registry | Not checked; any `approver_email` or none | `approver_email` must be a registered approver |
| Ordering switch | Not checked | The partner needs `ordering_enabled` |
| Spend cap | Counts sandbox submissions only | Counts live submissions only |
| After submit | Nothing prints. `POST /v1/test/campaigns/{id}/advance` (MCP `advance_test_campaign`) simulates production; from `in_postal_network` on it also simulates results | The order lands in Xcel's ops queue; results come from UpDash once ops links the order |

Start in the sandbox. A sandbox key creates its own [test dealers](dealers.md#test-dealers), up to 25, and its writes to them save. Dealers your live key or Xcel created are shared by both modes, so a sandbox key only validates changes to those ([Test keys only validate](dealers.md#test-keys-only-validate)). Campaigns, quotes, approvals, submissions and webhooks are separate per mode. A live key works before live ordering is on, for everything except submit ([Going live](going-live.md)).

## All pages

| Page | What it covers |
| --- | --- |
| [Quickstart](quickstart.md) | Sandbox key to a simulated submission with `curl` |
| [Going live](going-live.md) | What you do, what Xcel does, in what order, how to ask, and what is still undecided |
| [Running many dealers](partners.md) | One key across dealers, keys for one dealer, your own ids, the dealer CSV, approvers, limits, results by your id, the first dealer and the hundredth, and what is still by hand |
| [Changelog](changelog.md) | Versioning, what changed in each release, and what to do about it |
| [Coming from Lob](coming-from-lob.md) | Lob's concepts and field names mapped to this API, with REST examples |
| [TypeScript SDK](sdk/typescript.md) | The pre-release typed client: the sandbox flow, errors, retries, webhooks and every method |
| [Concepts](concepts.md) | Partners, dealers and profiles, brand values, campaigns and your reference on them, versions, quotes, approvals, idempotency, spend caps, results and attribution |
| [Dealers](dealers.md) | Creating dealers, the profile and its versions, If-Match, logos, signatures and photos, the CSV import, what Xcel manages, UpDash |
| [Products](products.md) | The offered products, their geometry and design rules, spec sheets and starter files, the artwork spec for print-ready PDFs and images |
| [Audiences](audiences.md) | CSV columns and `external_id`, column mapping and column warnings, upload flow, dedupe, suppression, reconciliation, row keys, address processing, when a person asks, retention |
| [Template gallery](templates.md) | Every template with images of its front and back, or a card's cover, inside and envelope, by size. No key needed. |
| [Design your own](design-your-own.md) | A blank HTML file and a prompt per product for ChatGPT or Claude, a prompt for finished art, and how to send the result. |
| [Creative](creative.md) | Finding templates, use cases, template previews and preview links, your own saved templates and their versions, print-ready artwork (a PDF or images) and artwork previews, copy slots, merge fields (make logos, vehicle photos, QR codes) and conditional blocks, locked brand inputs, preflight, proofs |
| [Quotes and approvals](quotes-and-approvals.md) | How quotes are built, small runs, the approval flow, submit refusals |
| [Billing](billing.md) | Who pays for live orders, setting up a bank account or card, when each order is charged, and terms |
| [Standing orders](standing-orders.md) | One repeating mailing saved once: each new list (sent, fetched on a schedule, or emailed by your platform's report) becomes an order, nobody is mailed twice inside a window, and each run still waits on the dealer's approver |
| [Webhooks](webhooks.md) | Event types, payloads, signature verification, retries |
| [Partner console](console.md) | The website for your staff: sign-in, roles, orders, per-lead data, dealers, keys, webhooks, team, usage |
| [Errors](errors.md) | The error shape and every error code |
| [MCP server](mcp.md) | Connecting an agent, every tool, safety rules |
| [API reference](api-reference.md) | Every REST endpoint |
| [For a vendor review](vendor-review.md) | The company's security program, SOC 2, the Mail API's controls, UpDash production and print partners, what is on request and what is not done yet |
| [Security](security.md) | Keys, scoping, PII, results and dealer data, approvals, retention |
| [Glossary](glossary.md) | Direct-mail and automotive terms |

Machine-readable entry points: [`/llms.txt`](../llms.txt) (index for agents), [`/llms-full.txt`](../llms-full.txt) (every page in one file), [`/openapi.json`](../openapi.json) and [`/mcp-tools.json`](../mcp-tools.json) (the MCP tool list, without a key).
