{
  "info": {
    "_postman_id": "aaa2c38e-7d2a-5bf6-a324-613c6ceca2d1",
    "name": "UpDash Mail API",
    "description": "The UpDash Mail API's REST endpoints in the order of the [Quickstart](https://api.updash.com/docs/quickstart), generated from [/openapi.json](https://api.updash.com/openapi.json). Coming from Lob: the key works as the Basic auth user name with an empty password, as on Lob, or as a Bearer token, and one order is a campaign with an audience file, not a call per piece ([Coming from Lob](https://api.updash.com/docs/coming-from-lob)).\n\n## Walk the sandbox flow\n\n1. Get a sandbox key: request sandbox access at https://www.updash.com/developers/agents, sign in to the partner console from the emailed link, and create a test key (`xm_test_...`) under **Developers**, then **API keys**. A sandbox key never prints, mails or spends.\n2. Import this collection and its environment, `updash-mail-api.postman_environment.json` (next to this file under https://api.updash.com/docs/postman/), and select the environment.\n3. Set `apiKey` to your key. It is a secret variable, sent as `Authorization: Bearer {{apiKey}}`. To use Basic auth instead, set the collection's **Authorization** to **Basic Auth** with `{{apiKey}}` as the username and the password empty. `baseUrl` is `https://api.updash.com`.\n4. Run the folders in order, one request at a time. Each request's tests check the status and save the ids the next requests need (`campaignId`, `audienceId`, `uploadUrl`, `quoteId`, `approvalId` and more) into the environment.\n\n- **Audience upload.** *Start an audience upload* saves the signed `uploadUrl`. *PUT the CSV to the signed upload URL* is a separate request to that URL, sent without your API key, with the quickstart's sample file. One PUT per URL: to send a corrected file, start a new upload.\n- **Creatives.** The Creative folder makes one from your saved template (before retiring it), one from a PDF uploaded to a signed URL (*PUT the PDF to the signed artwork upload URL*, a small sample postcard; send your own file instead), and last one from Xcel's template, which the Proof folder renders.\n- **Approval.** *Request approval* saves `reviewUrl`: open it in a browser and approve the order. Only a person approves spend.\n- **Results.** Sandbox results are simulated. The Sandbox folder runs before Results: *Advance a sandbox campaign* sends `{\"to\": \"completed\"}`, so *Get results* then shows the timeline, quantities and per-lead results.\n- **Store details.** The creative and preview bodies leave out the phone, web address, QR link and signer, so they print from the dealer's profile. Send them only with the dealer's own values: preflight flags Demo Motors' sample values (`sample_store_value`) on another dealer, and refuses them on a live order.\n- **Dealers.** A sandbox key reads the sample dealer `demo-motors` and only validates writes to it (`\"validated_only\": true`); the dealers it creates are test dealers, whose writes save.\n- **Idempotency.** Postman sends a new `Idempotency-Key` (`{{$guid}}`) each time. In your integration, keep one key per order and reuse it only to retry the same request.\n\nEvery error is `{\"error\":{\"code\",\"message\",\"fix\",\"field\"}}`, and a failed status test prints it: do what `fix` says.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "version": "0.9.75"
  },
  "item": [
    {
      "name": "Catalog and templates",
      "description": "Check the API is up, list the products and find a template. Preview it with your copy before a campaign exists, and save your own HTML as a template; the Creative folder makes a creative from it, then retires it. `templateCode` starts as `postcard_6x9_birthday`, the template the Creative folder fills.",
      "item": [
        {
          "name": "Check the API is up",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "auth": {
              "type": "noauth"
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/health",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "health"
              ],
              "query": [
                {
                  "key": "deep",
                  "value": "1",
                  "disabled": true,
                  "description": "1: also check the database and storage. Needs the health secret as the Bearer token."
                }
              ]
            },
            "description": "**Liveness for an uptime monitor.**\n\nNo API key. Answers {status: \"ok\", version} and nothing else. With ?deep=1 and Xcel's health token it also times a database query and a storage read, and answers 503 with status \"degraded\" if either fails. Deep checks without the health token answer 401.\n\nOpenAPI: `getHealth`, `GET /v1/health`."
          },
          "response": []
        },
        {
          "name": "List products",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/products?detail=compact",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "products"
              ],
              "query": [
                {
                  "key": "detail",
                  "value": "compact",
                  "description": "compact: the short form. full (or omitted): the full listing."
                }
              ]
            },
            "description": "**List mail products, specs and templates.**\n\nThe products Xcel offers with their print specs and templates. Without detail, the full listing (every template with its slots); detail=compact answers each product's size, sides, fold, envelope, mail classes and presort minimums with its templates' codes and names only, the form MCP list_mail_products answers by default. MCP: list_mail_products.\n\nOpenAPI: `listMailProducts`, `GET /v1/products`."
          },
          "response": []
        },
        {
          "name": "List the dealer's make logos",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/makes?dealer_id={{dealerId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "makes"
              ],
              "query": [
                {
                  "key": "dealer_id",
                  "value": "{{dealerId}}",
                  "description": "Only this dealer's records: the Xcel dealer id or your external dealer id. An unknown dealer is 404 `not_found` with `field: \"dealer_id\"`."
                }
              ]
            },
            "description": "**List the make logos.**\n\nEvery OEM make in the logo library, or with `dealer_id` only the makes that dealer's current profile lists, in its order. Each make has three variants: `color` (its color art), `white` (for dark backgrounds: its one-color form in white, or for a make that allows no one-color logo, its color logo on a white plate) and `black` (its one-color form in black, or such a make's greyscale logo), each as a PNG and, where the art traces true, the one-color forms as an SVG. `on_light` and `on_dark` say which variant prints on each background: white on dark, and on light the color art, or black for a make whose rules allow only a flat logo (Cadillac, Genesis, Mercedes-Benz). Merge fields print a dealer's own makes for you (`{{dealer.make_logos}}`); fetch a file with `GET /v1/makes/{make}/logo` to place one yourself. Any key.\n\nOpenAPI: `listMakes`, `GET /v1/makes`."
          },
          "response": []
        },
        {
          "name": "Get a make logo for a dark background",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/makes/:make/logo?tone=dark&format=svg",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "makes",
                ":make",
                "logo"
              ],
              "query": [
                {
                  "key": "variant",
                  "value": "white",
                  "disabled": true,
                  "description": "`color`, `white` (for dark backgrounds) or `black`. Not with `tone`."
                },
                {
                  "key": "tone",
                  "value": "dark",
                  "description": "The background the logo goes on: the answer is the variant the make's rules call for there (`on_light` or `on_dark` of `GET /v1/makes`). Default `light`. Not with `variant`."
                },
                {
                  "key": "format",
                  "value": "svg",
                  "description": "`png` (default; every variant has one) or `svg` (the white and black one-color forms of a make whose art traces true: `variants.<variant>.svg` of `GET /v1/makes` is not null). Another is 404 `not_found` with `field: \"format\"`."
                }
              ],
              "variable": [
                {
                  "key": "make",
                  "value": "{{make}}",
                  "description": "A make or alias, ignoring case, spaces and punctuation: `ford`, `Chevy`, `land-rover`, `VW`. The `make` of `GET /v1/makes`."
                }
              ]
            },
            "description": "**Get a make logo file.**\n\nAnswers the SVG itself. Paste it into your HTML as a data: URL; {{dealer.make_logos}} prints the dealer's own make logos for you.\n\nOne make's logo as an image: the `variant` asked for, or the one `tone` calls for under the make's rules (default: the variant for a light background), as a PNG or, for the white and black one-color forms of a make with a vector, an SVG. Paste it into your HTML as a `data:` URL: a piece prints nothing it would have to fetch. A make logo belongs only on a piece for a dealer that sells the make: merge fields print only the dealer's makes, and preflight warns `make_logo_not_dealer_make` when a pasted one is another make's. Any key.\n\nOpenAPI: `getMakeLogo`, `GET /v1/makes/{make}/logo`."
          },
          "response": []
        },
        {
          "name": "Find templates",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/templates?product_code=postcard_6x9&detail=compact",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "templates"
              ],
              "query": [
                {
                  "key": "product_code",
                  "value": "postcard_6x9",
                  "description": "Only this product's templates. A product that is not offered is 400 unknown_product."
                },
                {
                  "key": "use_case",
                  "value": "",
                  "disabled": true,
                  "description": "Only the templates tagged with this use case, e.g. lease_pull_ahead. Matched in lower-case snake_case; use_cases in a compact or full answer lists every tag in use."
                },
                {
                  "key": "query",
                  "value": "",
                  "disabled": true,
                  "description": "Words matched against template names, descriptions and use cases, and common phrasings matched to use cases (\"haven't been in\" to service_retention, \"pull-ahead\" to lease_pull_ahead, \"buy your car\" to buyback); best matches first, templates that match nothing left out."
                },
                {
                  "key": "source_audience",
                  "value": "",
                  "disabled": true,
                  "description": "Your audience's ID or name on your CDP or CRM. When Xcel has loaded your platform's audience map for your account, the audience is matched by its exact ID, then by name (case, spaces and punctuation do not matter), and its templates that pass the other filters come first, in the map's order; the rest keep their order. Without a map or a match, a name that is not all digits searches like query when query is not set. An unknown audience is never an error: the answer's source_audience says what happened."
                },
                {
                  "key": "owner",
                  "value": "xcel",
                  "disabled": true,
                  "description": "xcel: only Xcel's templates. partner: only your own saved templates. Omitted: both."
                },
                {
                  "key": "prescreened",
                  "value": "",
                  "disabled": true,
                  "description": "false: leave out the prescreened credit offers (requires_prescreened_list), as for any CDP, CRM or DMS customer list. true: only those. Omitted: both, with prescreened offers after every other template unless query or use_case asks for credit."
                },
                {
                  "key": "detail",
                  "value": "compact",
                  "description": "compact (the default) or full."
                }
              ]
            },
            "description": "**List templates.**\n\nThe active templates of the products Xcel offers, each at its current version: Xcel's (owner xcel) and your own saved templates (owner partner; first within each product). Filter by product_code, use_case and query. source_audience (your audience's ID or name on your platform) leads with the templates for that audience when Xcel has loaded your platform's audience map for your account. Compact by default: one line per template (summary, use_cases, required_slots, audience_columns, requires_prescreened_list) with a preview_url a person can open in a browser for one hour. detail=full adds every slot, the compliance rules, the description and formats. Any key, test or live. MCP: list_templates (compact by default too).\n\nOpenAPI: `listTemplates`, `GET /v1/templates`."
          },
          "response": []
        },
        {
          "name": "Get a template",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/templates/:code",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "templates",
                ":code"
              ],
              "query": [
                {
                  "key": "version",
                  "value": "",
                  "disabled": true,
                  "description": "Your own saved templates only: a version that is not retired. Xcel's templates: only their current version (400 template_version_unavailable otherwise)."
                }
              ],
              "variable": [
                {
                  "key": "code",
                  "value": "{{templateCode}}",
                  "description": "Template code: one of Xcel's, e.g. postcard_6x9_birthday, or one of your own saved templates, e.g. p_spring_service."
                }
              ]
            },
            "description": "**Get one template with its layout regions.**\n\nThe list item plus what the template is for (use_cases, audience_columns, requires_prescreened_list, formats), the layout regions in inches (for designers; none on your own templates) and the sample copy. Xcel's templates answer their current version; your own saved templates answer the current version or ?version=, with their stored HTML and created_at. Any key, test or live. MCP: get_template, without the regions and with a preview_url a person can open.\n\nOpenAPI: `getTemplate`, `GET /v1/templates/{code}`."
          },
          "response": []
        },
        {
          "name": "List a template's versions",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/templates/:code/versions",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "templates",
                ":code",
                "versions"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "20",
                  "disabled": true,
                  "description": "Versions per page."
                },
                {
                  "key": "before",
                  "value": "",
                  "disabled": true,
                  "description": "The previous page's next_before. Omit for the first page. A number no version of this list has is refused with 400 `invalid_request`."
                }
              ],
              "variable": [
                {
                  "key": "code",
                  "value": "{{templateCode}}",
                  "description": "Template code: one of Xcel's, e.g. postcard_6x9_birthday, or one of your own saved templates, e.g. p_spring_service."
                }
              ]
            },
            "description": "**List a template's versions, newest first.**\n\nYour own saved template: every version, retired ones too, without the HTML (read one with GET /v1/templates/{code}?version=). Xcel's template: its current version only, the one it serves.\n\nOpenAPI: `listTemplateVersions`, `GET /v1/templates/{code}/versions`."
          },
          "response": []
        },
        {
          "name": "Preview a template with your copy",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});",
                  "if (pm.response.code < 300) {",
                  "  const body = pm.response.json();",
                  "  if (body.preview_url) pm.environment.set(\"previewToken\", body.preview_url.split(\"/preview/\")[1]);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"copy\": {\n    \"note\": \"Happy birthday from all of us at {{dealer.name}}! Thank you for trusting us with your {{recipient.vehicle|vehicle}}.\\n\\nYour gift is on the other side. Stop by any time this month and we will take care of it for you.\",\n    \"gift_offer\": \"$50 toward any service\",\n    \"expires\": \"12/31/2026\"\n  },\n  \"dealer_id\": \"{{dealerId}}\",\n  \"format\": \"json\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/templates/:code/preview",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "templates",
                ":code",
                "preview"
              ],
              "variable": [
                {
                  "key": "code",
                  "value": "{{templateCode}}",
                  "description": "Template code: one of Xcel's, e.g. postcard_6x9_birthday, or one of your own saved templates, e.g. p_spring_service."
                }
              ]
            },
            "description": "**Render a template without a campaign.**\n\nSaves the token of `preview_url` as `previewToken` for the next request. Open `preview_url` in a browser: it shows the piece for one hour, with no key.\n\nRenders the template for one recipient through the same composition, locked brand values, preflight (compliance checks), logo check and address fitting as generate_creative and render_proof, so what you preview is what prints. Slots you leave out print their samples, except store details (phones, hours, web addresses, QR links, the signer), which come from the dealer's profile (without dealer_id, Demo Motors' sample profile), and for a real dealer (dealer_id): dealer facts print their default or nothing, and once you send any copy, optional slots you leave out print their default or nothing, as the creative does. Without dealer_id it prints the sample dealer Demo Motors, without recipient a fictional sample recipient. Answers the review proof PDF (format pdf, the default where PDF rendering is on), the proof page as sandboxed HTML (format html, the default elsewhere) or JSON (format json). The pdf and html bodies carry the preflight summary in X-Xcel-Preflight-* headers; json carries every issue with its fix. Every answer carries preview_url (json) or X-Xcel-Preview-Url (pdf, html): a link a person can open in a browser for one hour with no API key, rendering this template with your copy and dealer and the fictional sample recipient (never the recipient you sent). Saves nothing. Any key, test or live. Counts one render against render_proof's hourly limits: the dealer's (30 by default; dealer_id) and the partner's across its dealers (300; a preview without dealer_id counts here only), sandbox and live together (429 proof_render_rate_limited names the limit and when it resets). Opening preview_url counts nothing. MCP: preview_template.\n\nOpenAPI: `previewTemplate`, `POST /v1/templates/{code}/preview`."
          },
          "response": []
        },
        {
          "name": "Open the preview link",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "auth": {
              "type": "noauth"
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/preview/:token",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "preview",
                ":token"
              ],
              "query": [
                {
                  "key": "format",
                  "value": "html",
                  "disabled": true,
                  "description": "pdf: the review proof PDF. Omitted or html: the proof page as HTML."
                }
              ],
              "variable": [
                {
                  "key": "token",
                  "value": "{{previewToken}}",
                  "description": "The signed token from preview_url."
                }
              ]
            },
            "description": "**Open a template preview link (no API key).**\n\nThe preview_url from list_templates, get_template, preview_template or POST /v1/templates/{code}/preview: a page for a person, not an API call. The signed token is the capability and expires one hour after it was made; a revoked key's links stop working. It renders one template with the copy and dealer the preview named and the fictional sample recipient, so it shows no customer data. HTML (the proof page with guides, under the proof pages' sandboxed Content-Security-Policy) by default, the review proof PDF with ?format=pdf. Never cached or indexed (X-Robots-Tag noindex). It renders on the first opening in each format and serves that stored render for the rest of the link's hour, so opening it counts against no render limit.\n\nOpenAPI: `openTemplatePreview`, `GET /preview/{token}`."
          },
          "response": []
        },
        {
          "name": "Save your own template",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200 or 201\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200, 201]);",
                  "});",
                  "if (pm.response.code < 300) {",
                  "  const body = pm.response.json();",
                  "  pm.environment.set(\"savedTemplateCode\", body.template.code);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": "Optional. One key per request you may retry (a UUID): 1 to 255 printable ASCII characters, no spaces. The same request with the same key replays the stored result for 24 hours (`Idempotent-Replayed: true`). Send it again only to retry the same request. A key starting `scoped:` is refused."
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"code\": \"spring_service\",\n  \"product_code\": \"postcard_6x9\",\n  \"name\": \"Spring service card\",\n  \"description\": \"Spring service postcard for the dealer's service customers. Our own layout, from the postcard_6x9 starter.\",\n  \"html\": \"<!-- UpDash Mail API starter creative for postcard_6x9 (6 x 9 postcard). Send this file as the html field of POST /v1/campaigns/{id}/creative. Written by npm run docs:specs from src/catalog/products.json, geometry sha256 4c904ced2da0295f2ef614379d7b964013c691e941a9982c2f4a2820ac04060e. -->\\n<section class=\\\"xm-panel\\\" data-side=\\\"front\\\" style=\\\"--brand:{{brand.primary_color}};--brand2:{{brand.secondary_color}};--brand-ink:{{brand.primary_ink}};--brand-text:{{brand.primary_text}};--brand2-text:{{brand.secondary_text}}\\\">\\n  <div class=\\\"sx-bleed\\\"></div>\\n  <div class=\\\"sx-front\\\">\\n    <div class=\\\"sx-logo\\\">{{brand.logo}}</div>\\n    <h1 class=\\\"sx-headline\\\">Hi {{recipient.first_name|there}}, it's time for a <span class=\\\"sx-nowrap\\\">check-up</span></h1>\\n    <p class=\\\"sx-lede\\\">Service for {{recipient.vehicle|your vehicle}} at {{dealer.name}}: a multi-point inspection, and we tell you what we find before we do any work.</p>\\n    <p class=\\\"sx-cta\\\">Book today: <span class=\\\"sx-nowrap\\\">{{copy.cta_phone|@brand.phone}}</span></p>\\n  </div>\\n</section>\\n<section class=\\\"xm-panel\\\" data-side=\\\"back\\\" style=\\\"--brand:{{brand.primary_color}};--brand2:{{brand.secondary_color}};--brand-ink:{{brand.primary_ink}};--brand-text:{{brand.primary_text}};--brand2-text:{{brand.secondary_text}}\\\">\\n  <div class=\\\"sx-message\\\">\\n    <p class=\\\"sx-greet\\\">Hi {{recipient.first_name|there}},</p>\\n    <p>Regular service keeps your vehicle safe and saves money down the road. Our certified technicians check the brakes, tires, battery, fluids and lights.</p>\\n    <p class=\\\"sx-call\\\">Call <span class=\\\"sx-nowrap\\\">{{copy.cta_phone|@brand.phone}}</span> to book a time that suits you.</p>\\n    <div class=\\\"sx-fine\\\">{{brand.disclaimers}}</div>\\n  </div>\\n  <div class=\\\"sx-visit\\\">\\n    <p class=\\\"sx-label\\\">Service department</p>\\n    <p><strong>{{dealer.name}}</strong><br>{{dealer.address_line1}}<br>{{dealer.city_state_zip}}</p>\\n    <p class=\\\"sx-phone sx-nowrap\\\">{{copy.cta_phone|@brand.phone}}</p>\\n  </div>\\n  <div class=\\\"xm-address\\\">\\n    <div class=\\\"xm-return\\\">{{dealer.name}}<br>{{dealer.address_line1}}<br>{{dealer.city_state_zip}}</div>\\n    <div class=\\\"xm-to\\\">{{recipient.address_block}}</div>\\n  </div>\\n</section>\\n<style>\\n/* postcard_6x9 starter (6 x 9 postcard).\\n   Coordinates inside each .xm-panel are inches from the panel's top-left corner, which is the bleed\\n   edge: the server sizes every panel to the file, 9.25 x 6.25 in (trim 9 x 6 in plus 0.125 in\\n   bleed on each side), so the trim line runs 0.125 in inside the panel edge.\\n   Bleed: background color and images may run to the panel edge; the outer 0.125 in is cut off.\\n   Safe area: keep text, logos and phone numbers at least 0.25 in from the panel edge (0.125 in\\n   bleed plus 0.125 in safe margin): x 0.25 to 9 in, y 0.25 to 6 in.\\n   Ink-free on the back (the address side), in panel inches:\\n   - the address block, x 4.975 to 8.975 in, y 3.625 to 6 in (4 x 2.375 in).\\n     The printer prints a white box there with the indicia, the return address, the recipient\\n     address and the Intelligent Mail barcode. The server places .xm-address on it: do not move or\\n     size .xm-address, and put nothing else there.\\n   - the USPS barcode clear zone, x 4.375 to 9.125 in, y 5.5 to 6.125 in (4.75 x 0.625 in,\\n     the lower right of the back). Keep it free of all ink, background color included, so the back\\n     stays white.\\n   Front: keep address-like text out of the bottom 2.375 in (panel y 3.75 in and below);\\n   USPS scanners may read it as the delivery address.\\n   Images must be data:image URLs; the logo comes from the brand logo field. Helvetica and Arial print in Arimo. */\\n.xm-panel{font-family:Helvetica,Arial,sans-serif;color:#1b1b1b}\\n.xm-panel p{margin:0 0 .1in}\\n.sx-nowrap{white-space:nowrap}\\n.xm-logo{display:block;max-width:100%;max-height:100%;object-fit:contain}\\n.xm-logo-fallback{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:100%;height:100%;padding:.04in .1in;border:1.5pt dashed #8a96a3;background:#fff;color:#1b1b1b;font:700 13pt/1.1 Helvetica,Arial,sans-serif;text-align:center}\\n.sx-fine{font-size:7pt;line-height:1.3;color:#444}\\n.sx-fine p{margin:0 0 .04in}\\n/* Front: the brand color runs into the bleed; the content box sits .375in from each panel edge, inside the safe area. */\\n.sx-bleed{position:absolute;left:0;top:0;width:9.25in;height:6.25in;background:var(--brand)}\\n.sx-front{position:absolute;left:.375in;top:.375in;width:8.5in;height:5.5in;display:flex;flex-direction:column;color:var(--brand-ink);overflow:hidden}\\n.sx-logo{width:2.75in;height:.9in;box-sizing:border-box;padding:.08in .14in;background:#fff;border-radius:.08in}\\n.sx-headline{margin:.35in 0 .14in;font:800 30pt/1.05 Helvetica,Arial,sans-serif;max-width:7.25in}\\n.sx-lede{font-size:14pt;line-height:1.3;max-width:6.25in}\\n.sx-front .sx-cta{margin:auto 0 0;font:700 18pt/1.2 Helvetica,Arial,sans-serif}\\n/* Back: the message column ends .15in short of the barcode clear zone (panel x 4.375 in); the visit box ends .35in above the address block. */\\n.sx-message{position:absolute;left:.375in;top:.375in;width:3.85in;height:5.5in;display:flex;flex-direction:column;font-size:10.5pt;line-height:1.35;overflow:hidden}\\n.sx-greet{font-weight:700;font-size:13pt}\\n.sx-call{font-weight:700;color:var(--brand-text)}\\n.sx-message .sx-fine{margin-top:auto}\\n.sx-visit{position:absolute;left:4.975in;top:.375in;width:3.9in;max-height:2.9in;box-sizing:border-box;padding:.04in 0 0 .16in;border-left:3pt solid var(--brand2);font-size:10pt;line-height:1.35;overflow:hidden}\\n.sx-label{font-size:7.5pt;letter-spacing:.12em;text-transform:uppercase;color:#555}\\n.sx-phone{font-size:16pt;font-weight:800;color:var(--brand-text)}\\n/* Inside the address block: the return address top-left, the recipient lines below the indicia. */\\n.xm-return{position:absolute;left:.12in;top:.1in;font:7.5pt/1.2 Helvetica,Arial,sans-serif;text-transform:none}\\n.xm-to{position:absolute;left:.12in;right:.12in;top:.85in}\\n</style>\\n\",\n  \"slots\": [\n    {\n      \"name\": \"cta_phone\",\n      \"kind\": \"phone\",\n      \"max_length\": 20,\n      \"sample\": \"(555) 010-0100\"\n    }\n  ],\n  \"use_cases\": [\n    \"service_retention\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/templates",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "templates"
              ]
            },
            "description": "**Save your own template (a new version).**\n\nSends the postcard_6x9 starter from /docs/specs/ with its phone slot. Test and live keys share your templates. Saves the code as `savedTemplateCode`.\n\nStores your HTML with typed copy slots under your own code, p_<code>. A code you have saved before gets its next immutable version; the same content as the current version saves nothing (200, result unchanged). Creatives record the version they used, and template_version on POST /v1/campaigns/{id}/creative or the preview pins one. The HTML is cleaned exactly like an html creative's and must pass preflight with every slot's sample for the sample dealer Demo Motors, or nothing is saved (422 template_invalid lists the errors and their fixes). A template that prints your record id ({{recipient.external_id}} or an id column) or a contact column (email, phone) is refused: they never print on mail. You may keep 100 active templates and 50 active versions of each (409 template_limit_reached, template_version_limit_reached); retire the ones you no longer use. Templates are creative, not spend: test and live keys of a partner share them (unlike Lob, where test and live templates are separate), and no other partner can see them. A saved template prints Xcel's licensed vehicle photos, as Xcel's templates do. `Idempotency-Key` is optional and honored as on POST /v1/campaigns. MCP: save_template.\n\nOpenAPI: `saveTemplate`, `POST /v1/templates`."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Dealers",
      "description": "Read the sample dealer `demo-motors` (`dealerId`). Test and live keys share it, so a sandbox key's writes to it only validate: they answer `\"validated_only\": true` and save nothing. Make those changes with your live key. A dealer the sandbox key creates is a test dealer (`test_only: true`), for sandbox orders only, and its changes save.",
      "item": [
        {
          "name": "List dealers",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/dealers",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dealers"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "50",
                  "disabled": true,
                  "description": "Dealers per page."
                },
                {
                  "key": "after",
                  "value": "",
                  "disabled": true,
                  "description": "The previous page's next_after: a dealer id. Omit for the first page. Anything but one of your dealers is refused with 400 `invalid_request`."
                },
                {
                  "key": "query",
                  "value": "lakeside",
                  "disabled": true,
                  "description": "Only dealers whose name or external id contains this, ignoring case."
                },
                {
                  "key": "dealer_group",
                  "value": "Lakeside Auto Group",
                  "disabled": true,
                  "description": "Only dealers whose profile has this dealer_group: the whole value, ignoring case."
                }
              ]
            },
            "description": "**List or find your dealers, a page at a time.**\n\nOldest first (created_at, then id), so a dealer created while you walk the list lands on a later page and is never skipped. `after` is still a dealer id: a cursor saved before this order keeps working and goes on from that dealer's place in it, so a walk in flight when the order changed can repeat or miss a dealer once; start that walk again. A dealer id that is not yours is 400 `invalid_request` (field `after`). `query` and `dealer_group` combine with AND; send them on every page. `total` counts every dealer that matches, whatever page you are on. MCP: list_dealers shows `limit` and `after` in its tool list.\n\nOpenAPI: `listDealers`, `GET /v1/dealers`."
          },
          "response": []
        },
        {
          "name": "Get a dealer",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/dealers/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dealers",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{dealerId}}",
                  "description": "Xcel dealer id or your own external dealer id."
                }
              ]
            },
            "description": "**Get one dealer.**\n\nOne dealer by Xcel id or your external id, with the approvers you named (`approver_invitations`). Another partner's dealer answers 404, and so does a test dealer asked for with a live key.\n\nOpenAPI: `getDealer`, `GET /v1/dealers/{id}`."
          },
          "response": []
        },
        {
          "name": "Get what a creative prints for the dealer",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/dealers/:id/brand",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dealers",
                ":id",
                "brand"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{dealerId}}",
                  "description": "Xcel dealer id or your own external dealer id."
                }
              ]
            },
            "description": "**What a new creative prints for the dealer.**\n\nWhat a new creative prints for this dealer: name, address, logo, colors and phone from the profile, with Xcel's disclosures and the masked approvers.\n\nOpenAPI: `getDealerBrand`, `GET /v1/dealers/{id}/brand`."
          },
          "response": []
        },
        {
          "name": "List the dealer's approvers",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/dealers/:id/approvers",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dealers",
                ":id",
                "approvers"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{dealerId}}",
                  "description": "Xcel dealer id or your own external dealer id."
                }
              ]
            },
            "description": "**The dealer's registered approvers and the people you named.**\n\nThe dealer's registered approvers (masked) and the people you named, with where each stands. Xcel keeps the registered list: name a person with POST /v1/dealers/{id}/approvers, and they confirm by email.\n\nOpenAPI: `listDealerApprovers`, `GET /v1/dealers/{id}/approvers`."
          },
          "response": []
        },
        {
          "name": "Add to the dealer's do-not-mail list",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "text/csv"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "first_name,last_name,address1,zip\nPRIYA,SHAH,1200 West Main Street,61606\n,,5 Elm Court,61761\nJo,Rivera,9 Pine Rd,\n",
              "options": {
                "raw": {
                  "language": "text"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/dealers/:id/suppressions",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dealers",
                ":id",
                "suppressions"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{dealerId}}",
                  "description": "Xcel dealer id or your own external dealer id."
                }
              ]
            },
            "description": "**Add a do-not-mail CSV to the dealer's lasting list.**\n\nEvery audience upload for this dealer then removes these people. Answers counts only. A sandbox key's list is its own: it saves, and never reaches the live list.\n\nAdds to the dealer's lasting do-not-mail list, which every audience intake for the dealer applies from then on, beside any list sent with that upload. JSON `{\"source_url\": \"https://...\"}`: Xcel fetches the URL once, by the rules of the audience import. Or send the CSV itself with `Content-Type: text/csv`; the hosted API takes request bodies up to 4.5 MB, so send a larger file by `source_url`. Columns: `address1` and `zip`, with optional `first_name`, `last_name` and `address2`, as on a per-upload suppression list. A row with a name covers that person at that address; a row without a name covers everyone at that address. Rows without `address1` or a valid ZIP are ignored. Matching uses the keys dedupe uses, so `12 Elm Street, Apt 4` and `12 ELM ST. #4` are the same address. Only keyed hashes are stored, and the answer holds counts only. An audience already processed is not touched: upload it again for the list to apply. A submitted order is not recalled. Sending the same file again adds nothing. Each mode has its own list, so a test key's writes save and never reach the live list. `suppression_list_unavailable` (503): the list exists and this server cannot read it, so nothing was added; retry, or contact Xcel.\n\nOpenAPI: `addDealerSuppressions`, `POST /v1/dealers/{id}/suppressions`."
          },
          "response": []
        },
        {
          "name": "Read the do-not-mail list's size",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/dealers/:id/suppressions",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dealers",
                ":id",
                "suppressions"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{dealerId}}",
                  "description": "Xcel dealer id or your own external dealer id."
                }
              ]
            },
            "description": "**The size of the dealer's do-not-mail list and its last change.**\n\nThe number of entries on the dealer's do-not-mail list in this key's mode and when the list last changed. The API has no call that returns an entry or says whether one person is on the list. `suppression_list_unavailable` (503): the list exists and this server cannot read it, so nothing is mailed past it; retry, or contact Xcel.\n\nOpenAPI: `getDealerSuppressions`, `GET /v1/dealers/{id}/suppressions`."
          },
          "response": []
        },
        {
          "name": "Clear the do-not-mail list",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": "Optional. One key per request you may retry (a UUID): 1 to 255 printable ASCII characters, no spaces. The same request with the same key replays the stored result for 24 hours (`Idempotent-Replayed: true`). Send it again only to retry the same request. A key starting `scoped:` is refused."
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/dealers/:id/suppressions?confirm=true",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dealers",
                ":id",
                "suppressions"
              ],
              "query": [
                {
                  "key": "confirm",
                  "value": "true",
                  "description": "`true` says you mean to clear the list, when you send no Idempotency-Key."
                }
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{dealerId}}",
                  "description": "Xcel dealer id or your own external dealer id."
                }
              ]
            },
            "description": "**Clear the dealer's do-not-mail list.**\n\nMail can then go to the people it held, so it needs `confirm=true` or an `Idempotency-Key`.\n\nEmpties the dealer's do-not-mail list in this key's mode. New uploads then remove nobody by it, so mail can go to a person who asked not to get it: it needs an `Idempotency-Key` header or `confirm=true`, and answers 400 `invalid_request` with neither. With a key, a retry within 24 hours replays the first answer and clears nothing new. An audience already processed keeps the rows it removed. A clear that removed something records `dealer.suppressions_cleared`, with the mode and the key that did it, on Xcel's records; it is not sent to webhooks or the event feed. A list that was already empty answers `removed: 0` and records nothing.\n\nOpenAPI: `clearDealerSuppressions`, `DELETE /v1/dealers/{id}/suppressions`."
          },
          "response": []
        },
        {
          "name": "Name an approver",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200 or 201\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200, 201]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"approver@demomotors.example\",\n  \"name\": \"Alex Rivera\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/dealers/:id/approvers",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dealers",
                ":id",
                "approvers"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{dealerId}}",
                  "description": "Xcel dealer id or your own external dealer id."
                }
              ]
            },
            "description": "**Name an approver: Xcel emails them a confirm link.**\n\nWith a sandbox key it only validates: nobody is emailed. With a live key the person gets a confirm link.\n\nThe email carries the dealer's name and a single-use link that works for 7 days (stored only as a hash). When they confirm, an address at the dealer's website domain or a dealer-group domain Xcel listed for you is registered at once; any other (and any free mail address) waits for Xcel's review. Every status change sends dealer.updated with changed_fields [\"approvers\"]. Naming an address again replaces its unconfirmed link. Refused: approver_already_registered and approver_pending_review (409), approver_invitations_pending_limit (409, three waiting), approver_invite_rate_limited (429, five emails per dealer per UTC day). With a test (xm_test_) key it only validates: 200, validated_only true, nobody emailed.\n\nOpenAPI: `inviteDealerApprover`, `POST /v1/dealers/{id}/approvers`."
          },
          "response": []
        },
        {
          "name": "Get the dealer profile",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});",
                  "if (pm.response.code < 300) {",
                  "  pm.environment.set(\"profileEtag\", pm.response.headers.get(\"ETag\"));",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/dealers/:id/profile",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dealers",
                ":id",
                "profile"
              ],
              "query": [
                {
                  "key": "version",
                  "value": "",
                  "disabled": true,
                  "description": "An older version; omit for the current one."
                }
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{dealerId}}",
                  "description": "Xcel dealer id or your own external dealer id."
                }
              ]
            },
            "description": "**Get the dealer's profile.**\n\nSaves the `ETag` as `profileEtag`; turn on the `If-Match` header of a write to send it back.\n\nThe current profile, or an older one with `?version=N`. `etag` and the ETag header are the version: send it back as `If-Match` on a write. The answer adds the dealer's logos and creative assets, the fields Xcel manages and whether the dealer is ready for a live order.\n\nOpenAPI: `getDealerProfile`, `GET /v1/dealers/{id}/profile`."
          },
          "response": []
        },
        {
          "name": "List profile versions",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/dealers/:id/profile/versions",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dealers",
                ":id",
                "profile",
                "versions"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "20",
                  "disabled": true,
                  "description": "Versions per page."
                },
                {
                  "key": "before",
                  "value": "",
                  "disabled": true,
                  "description": "The previous page's next_before. Omit for the first page. A number no version of this list has is refused with 400 `invalid_request`."
                }
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{dealerId}}",
                  "description": "Xcel dealer id or your own external dealer id."
                }
              ]
            },
            "description": "**List profile versions, newest first.**\n\nWho changed which fields and when; never values.\n\nOpenAPI: `listDealerProfileVersions`, `GET /v1/dealers/{id}/profile/versions`."
          },
          "response": []
        },
        {
          "name": "Patch the profile",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "If-Match",
                "value": "{{profileEtag}}",
                "disabled": true,
                "description": "The profile version you read (its ETag, e.g. \"3\"). A stale one is 412 version_conflict. Omit (or *) to write over whatever is current."
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"phones\": {\n    \"service\": \"(555) 010-0150\"\n  },\n  \"hours\": {\n    \"service\": {\n      \"sat\": [\n        [\n          \"08:00\",\n          \"14:00\"\n        ]\n      ]\n    }\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/dealers/:id/profile",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dealers",
                ":id",
                "profile"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{dealerId}}",
                  "description": "Xcel dealer id or your own external dealer id."
                }
              ]
            },
            "description": "**Merge-patch the profile.**\n\nWith a test (xm_test_) key it only validates: validated_only is true, the X-Xcel-Validated-Only header is set, and nothing is saved.\n\nOpenAPI: `patchDealerProfile`, `PATCH /v1/dealers/{id}/profile`."
          },
          "response": []
        },
        {
          "name": "Replace the profile",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "If-Match",
                "value": "{{profileEtag}}",
                "disabled": true,
                "description": "The profile version you read (its ETag, e.g. \"3\"). A stale one is 412 version_conflict. Omit (or *) to write over whatever is current."
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Demo Motors\",\n  \"makes\": [\n    \"Ford\",\n    \"Lincoln\"\n  ],\n  \"address\": {\n    \"line1\": \"100 Demo Blvd\",\n    \"line2\": null,\n    \"city\": \"Columbus\",\n    \"state\": \"OH\",\n    \"zip\": \"43004\"\n  },\n  \"phones\": {\n    \"main\": \"(380) 246-4003\"\n  },\n  \"time_zone\": \"America/New_York\",\n  \"hours\": {\n    \"sales\": {\n      \"mon\": [\n        [\n          \"09:00\",\n          \"19:00\"\n        ]\n      ],\n      \"tue\": [\n        [\n          \"09:00\",\n          \"19:00\"\n        ]\n      ],\n      \"wed\": [\n        [\n          \"09:00\",\n          \"19:00\"\n        ]\n      ],\n      \"thu\": [\n        [\n          \"09:00\",\n          \"19:00\"\n        ]\n      ],\n      \"fri\": [\n        [\n          \"09:00\",\n          \"19:00\"\n        ]\n      ],\n      \"sat\": [\n        [\n          \"09:00\",\n          \"17:00\"\n        ]\n      ],\n      \"sun\": []\n    },\n    \"service\": {\n      \"mon\": [\n        [\n          \"09:00\",\n          \"19:00\"\n        ]\n      ],\n      \"tue\": [\n        [\n          \"09:00\",\n          \"19:00\"\n        ]\n      ],\n      \"wed\": [\n        [\n          \"09:00\",\n          \"19:00\"\n        ]\n      ],\n      \"thu\": [\n        [\n          \"09:00\",\n          \"19:00\"\n        ]\n      ],\n      \"fri\": [\n        [\n          \"09:00\",\n          \"19:00\"\n        ]\n      ],\n      \"sat\": [\n        [\n          \"09:00\",\n          \"17:00\"\n        ]\n      ],\n      \"sun\": []\n    }\n  },\n  \"links\": {\n    \"website\": \"https://www.demomotors.com\"\n  },\n  \"brand\": {\n    \"colors\": {\n      \"primary\": \"#0B3D93\",\n      \"secondary\": \"#FFB020\"\n    }\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/dealers/:id/profile",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dealers",
                ":id",
                "profile"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{dealerId}}",
                  "description": "Xcel dealer id or your own external dealer id."
                }
              ]
            },
            "description": "**Replace the profile.**\n\nFields left out are cleared. Logos and Xcel-managed fields are kept. Writes a new version unless nothing changed. With a test (xm_test_) key it only validates: validated_only is true, the X-Xcel-Validated-Only header is set, and nothing is saved.\n\nOpenAPI: `replaceDealerProfile`, `PUT /v1/dealers/{id}/profile`."
          },
          "response": []
        },
        {
          "name": "Upload a logo",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "If-Match",
                "value": "{{profileEtag}}",
                "disabled": true,
                "description": "The profile version you read (its ETag, e.g. \"3\"). A stale one is 412 version_conflict. Omit (or *) to write over whatever is current."
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"variant\": \"primary\",\n  \"content_base64\": \"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzNjAiIGhlaWdodD0iODAiPjxyZWN0IHdpZHRoPSIzNjAiIGhlaWdodD0iODAiIGZpbGw9IiNmZmZmZmYiLz48cGF0aCBkPSJNMTIgMTRoNTJ2NTJIMTJ6IiBmaWxsPSIjMDAzMzY2Ii8+PHBhdGggZD0iTTc4IDI0aDI3MHYxNEg3OHpNNzggNDZoMTkwdjEwSDc4eiIgZmlsbD0iIzAwMzM2NiIvPjwvc3ZnPg==\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/dealers/:id/logo",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dealers",
                ":id",
                "logo"
              ],
              "query": [
                {
                  "key": "variant",
                  "value": "primary",
                  "disabled": true,
                  "description": "For a raw file body."
                }
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{dealerId}}",
                  "description": "Xcel dealer id or your own external dealer id."
                }
              ]
            },
            "description": "**Upload the primary or reversed logo.**\n\nSends a sample SVG logo, drawn with shapes only, as JSON: an SVG with live text is refused (422 `logo_svg_live_text`), so convert text to outlines first. To send a file instead, set the body to the file, `Content-Type` to its type and `?variant=primary`.\n\nPNG, JPEG or SVG judged by content, at most 3 MB. Raster: at least 600 px on the long side and 100 px on the short side. Animated files are refused. SVG is rebuilt from allowed parts and drawn to a PNG; proofs print only the PNG. PDF needs a PDF rasterizer on the server (415 logo_pdf_unsupported otherwise). Writes a new profile version unless it is the same file. With a test (xm_test_) key it only validates: validated_only is true, the X-Xcel-Validated-Only header is set, and nothing is saved.\n\nOpenAPI: `uploadDealerLogo`, `POST /v1/dealers/{id}/logo`."
          },
          "response": []
        },
        {
          "name": "Create a dealer",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 201 or 409 external_id_taken\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([201, 409]);",
                  "  if (pm.response.code === 409) pm.expect(pm.response.json().error.code).to.equal(\"external_id_taken\");",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"external_id\": \"{{testDealerId}}\",\n  \"profile\": {\n    \"name\": \"Demo Motors West\",\n    \"makes\": [\n      \"Ford\",\n      \"Lincoln\"\n    ],\n    \"address\": {\n      \"line1\": \"2100 Wabash Ave\",\n      \"city\": \"Springfield\",\n      \"state\": \"IL\",\n      \"zip\": \"62704\"\n    },\n    \"phones\": {\n      \"main\": \"(555) 010-0299\"\n    },\n    \"time_zone\": \"America/Chicago\",\n    \"links\": {\n      \"website\": \"https://west.demomotors.example.com\"\n    }\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/dealers",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dealers"
              ]
            },
            "description": "**Create a dealer with its profile version 1.**\n\nWith a sandbox key this creates a test dealer, for sandbox orders only. A later run answers 409 `external_id_taken` and the requests after it use the same dealer, so the collection never reaches the limit of 25 test dealers.\n\nA new dealer has no registered approver: it can be quoted in test and live, but live request_approval and submit answer no_registered_approver until one is registered (POST /v1/dealers/{id}/approvers). With a test (xm_test_) key it creates a test dealer: test mode only, never live-ready, at most 25 per partner (409 test_dealer_limit_reached).\n\nOpenAPI: `createDealer`, `POST /v1/dealers`."
          },
          "response": []
        },
        {
          "name": "Upload a creative asset",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200 or 201\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200, 201]);",
                  "});",
                  "if (pm.response.code < 300) {",
                  "  const body = pm.response.json();",
                  "  pm.environment.set(\"assetId\", body.asset.id);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "If-Match",
                "value": "{{profileEtag}}",
                "disabled": true,
                "description": "The profile version you read (its ETag, e.g. \"3\"). A stale one is 412 version_conflict. Omit (or *) to write over whatever is current."
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"kind\": \"signature\",\n  \"name\": \"Morgan Reyes\",\n  \"title\": \"General Manager\",\n  \"content_base64\": \"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI2MDAiIGhlaWdodD0iMjAwIj48cGF0aCBkPSJNNDAgMTQwIEMxMjAgMjAgMjAwIDIwMCAzMDAgOTAgUzQ4MCA2MCA1NjAgMTIwIiBmaWxsPSJub25lIiBzdHJva2U9IiMxNzMwNWUiIHN0cm9rZS13aWR0aD0iNiIvPjwvc3ZnPg==\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/dealers/:id/assets",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dealers",
                ":id",
                "assets"
              ],
              "query": [
                {
                  "key": "kind",
                  "value": "signature",
                  "disabled": true,
                  "description": "For a raw file body: signature, store_photo, staff_photo or photo. Required."
                },
                {
                  "key": "label",
                  "value": "",
                  "disabled": true,
                  "description": "For a raw file body: what {{asset.<kind>.<label>}} calls it. Required for a photo."
                },
                {
                  "key": "name",
                  "value": "",
                  "disabled": true,
                  "description": "For a raw file body: the person, for a signature or staff photo."
                },
                {
                  "key": "title",
                  "value": "",
                  "disabled": true,
                  "description": "For a raw file body: the person's job title."
                },
                {
                  "key": "department",
                  "value": "sales",
                  "disabled": true,
                  "description": "For a signature: the mail it signs. service: Xcel's service templates (We Missed You, open recalls, service reminders); sales: the others. Left out, it signs both, unless a newer signature is marked for that mail. Ignored on other kinds. With a file body."
                }
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{testDealerId}}",
                  "description": "Xcel dealer id or your own external dealer id."
                }
              ]
            },
            "description": "**Upload a creative asset.**\n\nSends a sample SVG signature as JSON to the dealer you just created, whose writes save. To send a file instead, set the body to the file, `Content-Type` to its type and `?kind=signature&name=...`. Saves the asset's id as `assetId`.\n\nA signature, store photo, staff photo or other photo: PNG or JPEG judged by content (SVG for a signature only, rebuilt from allowed parts), at most 10 MB, and the hosted API refuses any body over 4.5 MB first, so send a larger file by url. Upright, in sRGB and without metadata in print. A signature on white loses the paper. A file too small to print sharply at its usual size is accepted with a warning. The same kind and label with another file replaces it and keeps the id; the same file and details change nothing. Writes a new profile version unless nothing changed. With a test (xm_test_) key on a shared dealer it only validates: validated_only is true, the X-Xcel-Validated-Only header is set, and nothing is saved.\n\nOpenAPI: `uploadDealerAsset`, `POST /v1/dealers/{id}/assets`."
          },
          "response": []
        },
        {
          "name": "List the dealer's creative assets",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/dealers/:id/assets",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dealers",
                ":id",
                "assets"
              ],
              "query": [
                {
                  "key": "kind",
                  "value": "signature",
                  "disabled": true,
                  "description": "Only assets of this kind."
                }
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{testDealerId}}",
                  "description": "Xcel dealer id or your own external dealer id."
                }
              ]
            },
            "description": "**List the dealer's creative assets.**\n\nIts current signatures, store photos, staff photos and other photos: each one's kind, label, person, merge_field, renditions and how it prints. Test keys read shared dealers and their own test dealers.\n\nOpenAPI: `listDealerAssets`, `GET /v1/dealers/{id}/assets`."
          },
          "response": []
        },
        {
          "name": "Read a creative asset",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/dealers/:id/assets/:asset_id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dealers",
                ":id",
                "assets",
                ":asset_id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{testDealerId}}",
                  "description": "Xcel dealer id or your own external dealer id."
                },
                {
                  "key": "asset_id",
                  "value": "{{assetId}}",
                  "description": "The asset's id, from the list."
                }
              ]
            },
            "description": "**Read one creative asset.**\n\nOne current creative asset of the dealer. A deleted asset answers 404 `asset_not_found`.\n\nOpenAPI: `getDealerAsset`, `GET /v1/dealers/{id}/assets/{asset_id}`."
          },
          "response": []
        },
        {
          "name": "Change a creative asset's details",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "If-Match",
                "value": "{{profileEtag}}",
                "disabled": true,
                "description": "The profile version you read (its ETag, e.g. \"3\"). A stale one is 412 version_conflict. Omit (or *) to write over whatever is current."
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"title\": \"Owner\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/dealers/:id/assets/:asset_id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dealers",
                ":id",
                "assets",
                ":asset_id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{testDealerId}}",
                  "description": "Xcel dealer id or your own external dealer id."
                },
                {
                  "key": "asset_id",
                  "value": "{{assetId}}",
                  "description": "The asset's id, from the list."
                }
              ]
            },
            "description": "**Change an asset's label, name, title or department.**\n\nThe file does not change; to change it, upload again with the same kind and label. Writes a new profile version. With a test key on a shared dealer it only validates.\n\nOpenAPI: `updateDealerAsset`, `PATCH /v1/dealers/{id}/assets/{asset_id}`."
          },
          "response": []
        },
        {
          "name": "Remove a creative asset",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "If-Match",
                "value": "{{profileEtag}}",
                "disabled": true,
                "description": "The profile version you read (its ETag, e.g. \"3\"). A stale one is 412 version_conflict. Omit (or *) to write over whatever is current."
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/dealers/:id/assets/:asset_id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dealers",
                ":id",
                "assets",
                ":asset_id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{testDealerId}}",
                  "description": "Xcel dealer id or your own external dealer id."
                },
                {
                  "key": "asset_id",
                  "value": "{{assetId}}",
                  "description": "The asset's id, from the list."
                }
              ]
            },
            "description": "**Remove a creative asset.**\n\nSoft: a new profile version without it. New creatives can no longer print it. Creatives, proofs and orders already made with it keep what they printed, since earlier versions and the stored files stay. With a test key on a shared dealer it only validates.\n\nOpenAPI: `deleteDealerAsset`, `DELETE /v1/dealers/{id}/assets/{asset_id}`."
          },
          "response": []
        },
        {
          "name": "Add an offer",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200 or 201\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200, 201]);",
                  "});",
                  "if (pm.response.code < 300) {",
                  "  const body = pm.response.json();",
                  "  pm.environment.set(\"offerId\", body.offer.id);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "If-Match",
                "value": "{{profileEtag}}",
                "disabled": true,
                "description": "The profile version you read (its ETag, e.g. \"3\"). A stale one is 412 version_conflict. Omit (or *) to write over whatever is current."
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Oil change special\",\n  \"department\": \"service\",\n  \"offer\": \"$29.95 Oil Change\",\n  \"detail\": \"Includes a tire rotation\",\n  \"disclosure\": \"Up to 5 quarts of conventional oil. Plus tax. Most vehicles.\",\n  \"ends_on\": \"2026-12-31\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/dealers/:id/offers",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dealers",
                ":id",
                "offers"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{testDealerId}}",
                  "description": "Xcel dealer id or your own external dealer id."
                }
              ]
            },
            "description": "**Add an offer.**\n\nSaves an offer the dealer named, with its real terms and dates, to the dealer you just created. Saves its id as `offerId`.\n\nSave an offer the dealer named, with its terms and dates, so any template creative can print it by offer_id. At most 50 a dealer. Writes a new profile version. With a test (xm_test_) key on a shared dealer it only validates: validated_only is true, the X-Xcel-Validated-Only header is set, and nothing is saved.\n\nOpenAPI: `createDealerOffer`, `POST /v1/dealers/{id}/offers`."
          },
          "response": []
        },
        {
          "name": "List the dealer's offers",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/dealers/:id/offers",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dealers",
                ":id",
                "offers"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{testDealerId}}",
                  "description": "Xcel dealer id or your own external dealer id."
                }
              ]
            },
            "description": "**List the dealer's offers.**\n\nThe dealer's offers library: each offer's terms, dates and status today. generate_creative prints one by offer_id. Test keys read shared dealers and their own test dealers.\n\nOpenAPI: `listDealerOffers`, `GET /v1/dealers/{id}/offers`."
          },
          "response": []
        },
        {
          "name": "Read an offer",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/dealers/:id/offers/:offer_id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dealers",
                ":id",
                "offers",
                ":offer_id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{testDealerId}}",
                  "description": "Xcel dealer id or your own external dealer id."
                },
                {
                  "key": "offer_id",
                  "value": "{{offerId}}",
                  "description": "The offer's id or label, from the list."
                }
              ]
            },
            "description": "**Get an offer.**\n\nOne offer of the dealer, by id or label.\n\nOpenAPI: `getDealerOffer`, `GET /v1/dealers/{id}/offers/{offer_id}`."
          },
          "response": []
        },
        {
          "name": "Change an offer",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "If-Match",
                "value": "{{profileEtag}}",
                "disabled": true,
                "description": "The profile version you read (its ETag, e.g. \"3\"). A stale one is 412 version_conflict. Omit (or *) to write over whatever is current."
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"ends_on\": \"2027-01-31\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/dealers/:id/offers/:offer_id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dealers",
                ":id",
                "offers",
                ":offer_id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{testDealerId}}",
                  "description": "Xcel dealer id or your own external dealer id."
                },
                {
                  "key": "offer_id",
                  "value": "{{offerId}}",
                  "description": "The offer's id or label, from the list."
                }
              ]
            },
            "description": "**Change an offer.**\n\nChange an offer's fields; null clears an optional one. Creatives already made keep what they printed: call generate_creative again to print the change. Writes a new profile version unless nothing changed. With a test (xm_test_) key on a shared dealer it only validates: validated_only is true, the X-Xcel-Validated-Only header is set, and nothing is saved.\n\nOpenAPI: `updateDealerOffer`, `PATCH /v1/dealers/{id}/offers/{offer_id}`."
          },
          "response": []
        },
        {
          "name": "Remove an offer",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "If-Match",
                "value": "{{profileEtag}}",
                "disabled": true,
                "description": "The profile version you read (its ETag, e.g. \"3\"). A stale one is 412 version_conflict. Omit (or *) to write over whatever is current."
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/dealers/:id/offers/:offer_id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dealers",
                ":id",
                "offers",
                ":offer_id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{testDealerId}}",
                  "description": "Xcel dealer id or your own external dealer id."
                },
                {
                  "key": "offer_id",
                  "value": "{{offerId}}",
                  "description": "The offer's id or label, from the list."
                }
              ]
            },
            "description": "**Remove an offer.**\n\nNew creatives can no longer use it; creatives and orders made with it keep what they printed. Writes a new profile version. With a test (xm_test_) key on a shared dealer it only validates: validated_only is true, the X-Xcel-Validated-Only header is set, and nothing is saved.\n\nOpenAPI: `deleteDealerOffer`, `DELETE /v1/dealers/{id}/offers/{offer_id}`."
          },
          "response": []
        },
        {
          "name": "Import dealers from a CSV",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "text/csv"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": "Optional. One key per request you may retry (a UUID): 1 to 255 printable ASCII characters, no spaces. The same request with the same key replays the stored result for 24 hours (`Idempotent-Replayed: true`). Send it again only to retry the same request. A key starting `scoped:` is refused."
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "external_id,name,address_line1,city,state,zip,phone_main,phone_service,website,makes,time_zone\ndemo-motors-west,Demo Motors West,2100 Wabash Ave,Springfield,IL,62704,(555) 010-0299,,https://west.demomotors.example.com,Ford;Lincoln,America/Chicago\ndemo-motors,,,,,,,(555) 010-0150,,,\n",
              "options": {
                "raw": {
                  "language": "text"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/dealers/import",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dealers",
                "import"
              ]
            },
            "description": "**Upsert dealers from a CSV by external_id.**\n\nA row for a new external_id creates the dealer (it needs name, address_line1, city, state and zip); a row for an existing one merges its non-empty cells. At most 500 rows and 1 MB. Cells a spreadsheet would read as a formula are refused per row (formula_value). Xcel-managed, unknown or repeated columns refuse the whole file. Columns: see /docs/dealers.md. With a test (xm_test_) key, rows for new external_ids create test dealers and rows for test dealers save; rows for dealers shared with the live key only validate (validated_only on the row and at the top, and the X-Xcel-Validated-Only header).\n\nOpenAPI: `importDealers`, `POST /v1/dealers/import`."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Asset library",
      "description": "Photos you upload once and print for any of your dealers: `{{asset.photo.<label>}}` prints the dealer's own photo with that label first, else the library's. Test and live keys share the library, so the sandbox key's upload is saved.",
      "item": [
        {
          "name": "Upload a photo to the library",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200 or 201\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200, 201]);",
                  "});",
                  "if (pm.response.code < 300) {",
                  "  const body = pm.response.json();",
                  "  pm.environment.set(\"libraryAssetId\", body.asset.id);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Spring sale banner\",\n  \"label\": \"spring_banner\",\n  \"description\": \"March and April\",\n  \"content_base64\": \"iVBORw0KGgoAAAANSUhEUgAAAZAAAAEsCAIAAABi1XKVAAAC90lEQVR42u3UMQ0AAAgEsd/RhEoMowPSpApuuFQPwAmRADAsAMMCDAvAsAAMCzAsAMMCMCzAsAAMC8CwAMMCMCwAwwIMC8CwAAwLMCwAwwIwLMCwAAwLwLAAwwIwLADDAgwLwLAAw1IBMCwAwwIMC8CwAAwLMCwAwwIwLMCwAAwLwLAAwwIwLADDAgwLwLAADAswLADDAjAswLAADAvAsADDAjAsAMMCDAvAsADDUgEwLADDAgwLwLAADAswLADDAjAswLAADAvAsADDAjAsAMMCDAvAsAAMCzAsAMMCMCzAsAAMC8CwAMMCMCwAwwIMC8CwAMMCMCwAwwIMC8CwAAwLMCwAwwIwLMCwAAwLwLAAwwIwLADDAgwLwLAADAswLADDAjAswLAADAvAsADDAjAsAMMCDAvAsADDAjAsAMMCDAvAsAAMCzAsAMMCMCzAsAAMC8CwAMMCMCwAwwIMC8CwAAwLMCwAwwIwLMCwAAwLwLAAwwIwLADDAgwLwLAAwwIwLADDAgwLwLAADAswLADDAjAswLAADAvAsADDAjAsAMMCDAvAsAAMCzAsAMMCMCzAsAAMC8CwAMMCMCwAwwIMC8CwAMMCMCwAwwIMC8CwAAwLMCwAwwIwLMCwAAwLwLAAwwIwLADDAgwLwLAADAswLADDAjAswLAADAvAsADDAjAsAMMCDAvAsADDAjAsAMMCDAvAsAAMCzAsAMMCMCzAsAAMC8CwAMMCMCwAwwIMC8CwAAwLMCwAwwIwLMCwAAwLwLAAwwIwLADDAgwLwLAAwwIwLADDAgwLwLAADAswLADDAjAswLAADAvAsADDAjAsAMMCDAvAsAAMCzAsAMMCMCzAsAAMC8CwAMMCMCzAsCQADAvAsADDAjAsAMMCDAvAsAAMCzAsAMMCMCzAsAAMC8CwAMMCMCwAwwIMC8CwAAwLMCwAwwIwLMCwAAwLwLAAwwIwLMCwVAAMC8CwAMMCMCwAwwIMC8CwAAwLMCwAwwIwLOCzBaFAF8AehJzcAAAAAElFTkSuQmCC\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/assets",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "assets"
              ],
              "query": [
                {
                  "key": "name",
                  "value": "",
                  "disabled": true,
                  "description": "For a raw file body: what the photo shows. Required."
                },
                {
                  "key": "label",
                  "value": "",
                  "disabled": true,
                  "description": "For a raw file body: what {{asset.photo.<label>}} calls it. Left out, it is made from the name."
                },
                {
                  "key": "description",
                  "value": "",
                  "disabled": true,
                  "description": "For a raw file body: when to use it, or what it shows."
                }
              ]
            },
            "description": "**Upload a photo to your asset library.**\n\nSends a small sample PNG as JSON; the answer warns it is too small to print sharply, as a real photo of 1,200 px or more would not. The same label again replaces the file. To send a file instead, set the body to the file, `Content-Type` to its type and `?name=...`. Saves the photo's id as `libraryAssetId`.\n\nA photo any of your dealers' mail can print: `{{asset.photo.<label>}}` prints the dealer's own photo with that label first, else this one. PNG or JPEG judged by content, at most 10 MB, and the hosted API refuses any body over 4.5 MB first, so send a larger file by url. Upright, in sRGB and without metadata in print. A file too small to print sharply at its usual size is accepted with a warning. The same label with another file replaces that photo's file and keeps its id; creatives and orders already made keep the old file. The same file and details change nothing. Test and live keys share the library, so a test key's upload is saved. A key limited to some dealers is refused with 403 `dealer_scope_forbidden`.\n\nOpenAPI: `uploadPartnerAsset`, `POST /v1/assets`."
          },
          "response": []
        },
        {
          "name": "List the library",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/assets",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "assets"
              ]
            },
            "description": "**List your asset library.**\n\nEvery photo in your asset library, oldest first: each one's label, name, description, merge_field, rendition and how it prints. The library is the same for test and live keys. A key limited to some dealers reads it too, and can_change is false for it.\n\nOpenAPI: `listPartnerAssets`, `GET /v1/assets`."
          },
          "response": []
        },
        {
          "name": "Read a library photo",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/assets/:asset_id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "assets",
                ":asset_id"
              ],
              "variable": [
                {
                  "key": "asset_id",
                  "value": "{{libraryAssetId}}",
                  "description": "The asset's id, from the list."
                }
              ]
            },
            "description": "**Read one library photo.**\n\nOne photo of your asset library. A removed photo answers 404 `asset_not_found`.\n\nOpenAPI: `getPartnerAsset`, `GET /v1/assets/{asset_id}`."
          },
          "response": []
        },
        {
          "name": "Change a library photo's details",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"description\": \"Spring sale, March and April\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/assets/:asset_id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "assets",
                ":asset_id"
              ],
              "variable": [
                {
                  "key": "asset_id",
                  "value": "{{libraryAssetId}}",
                  "description": "The asset's id, from the list."
                }
              ]
            },
            "description": "**Change a library photo's name, label or description.**\n\nThe file does not change; to change it, upload again with the same label. A creative made before a new label keeps printing the photo; a new creative must name the new label. A key limited to some dealers is refused with 403 `dealer_scope_forbidden`.\n\nOpenAPI: `updatePartnerAsset`, `PATCH /v1/assets/{asset_id}`."
          },
          "response": []
        },
        {
          "name": "Remove a library photo",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/assets/:asset_id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "assets",
                ":asset_id"
              ],
              "variable": [
                {
                  "key": "asset_id",
                  "value": "{{libraryAssetId}}",
                  "description": "The asset's id, from the list."
                }
              ]
            },
            "description": "**Remove a library photo.**\n\nSoft: the photo leaves the library, so new creatives can no longer print it, and its label is free again. Creatives, proofs and orders already made with it keep printing it: each keeps its own copy, and the stored files stay. A key limited to some dealers is refused with 403 `dealer_scope_forbidden`.\n\nOpenAPI: `deletePartnerAsset`, `DELETE /v1/assets/{asset_id}`."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Campaigns",
      "description": "Register a webhook endpoint first, then create the draft campaign for the dealer and product. The campaign's id is saved as `campaignId` for every request after it.",
      "item": [
        {
          "name": "Register a webhook",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 201\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([201]);",
                  "});",
                  "if (pm.response.code < 300) {",
                  "  const body = pm.response.json();",
                  "  pm.environment.set(\"webhookId\", body.id);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"https://example.com/updash-webhooks\",\n  \"event_types\": [\n    \"campaign.status_changed\",\n    \"approval.decided\",\n    \"campaign.results_updated\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks"
              ]
            },
            "description": "**Register a webhook endpoint (secret shown once).**\n\nRegistered before the campaign: an endpoint receives only events that happen after it is registered, so the Webhooks folder at the end has deliveries to read and replay. The secret comes back once: keep it to verify `X-Xcel-Signature`. Saves the endpoint id as `webhookId`.\n\nLive endpoints must be https; sandbox endpoints may be http. URLs with credentials, local host names, hosts that do not resolve, and hosts that resolve to any non-public address are refused with `invalid_webhook_url`. The host is checked again before every delivery. The secret is returned once. At most 5 active endpoints per partner and mode by default: 409 webhook_limit_reached (deactivate one with DELETE /v1/webhooks/{id} or in the partner console; a deactivated endpoint does not count). An event type this API does not have (a Lob event name such as postcard.delivered) is 400 invalid_request, with a fix that names the campaign event to use.\n\nOpenAPI: `createWebhook`, `POST /v1/webhooks`."
          },
          "response": []
        },
        {
          "name": "Create a campaign",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 201\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([201]);",
                  "});",
                  "if (pm.response.code < 300) {",
                  "  const body = pm.response.json();",
                  "  pm.environment.set(\"campaignId\", body.campaign.id);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": "Optional. One key per request you may retry (a UUID): 1 to 255 printable ASCII characters, no spaces. The same request with the same key replays the stored result for 24 hours (`Idempotent-Replayed: true`). Send it again only to retry the same request. A key starting `scoped:` is refused."
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"dealer_id\": \"{{dealerId}}\",\n  \"product_code\": \"postcard_6x9\",\n  \"name\": \"November service reminder\",\n  \"external_ref\": \"cmp_778\",\n  \"metadata\": {\n    \"program\": \"service\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns"
              ]
            },
            "description": "**Create a draft campaign.**\n\n`Idempotency-Key` is optional here, and honored as on submit: scoped to the partner and the key's mode, a repeat with the same key and the same body (key order does not matter) within 24 hours returns the stored response, the same campaign, with `Idempotent-Replayed: true`; the same key with a different body is 409 `idempotency_key_reused`; while the first request runs, a repeat gets 409 `idempotency_in_progress`. Refusals are not stored, so a fixed request can reuse the key. Without the header every call creates a campaign. The body is validated before the key. The MCP tool `create_campaign` takes the same key as `idempotency_key`, in the same namespace.\n\nOpenAPI: `createCampaign`, `POST /v1/campaigns`."
          },
          "response": []
        },
        {
          "name": "List campaigns by your reference",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns?external_ref=cmp_778",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns"
              ],
              "query": [
                {
                  "key": "dealer_id",
                  "value": "{{dealerId}}",
                  "disabled": true,
                  "description": "Only this dealer's records: the Xcel dealer id or your external dealer id. An unknown dealer is 404 `not_found` with `field: \"dealer_id\"`."
                },
                {
                  "key": "status",
                  "value": "draft",
                  "disabled": true,
                  "description": "Only campaigns in this status."
                },
                {
                  "key": "external_ref",
                  "value": "cmp_778",
                  "description": "Only campaigns created with this external_ref (exact match, after trimming)."
                },
                {
                  "key": "created_after",
                  "value": "2026-11-01",
                  "disabled": true,
                  "description": "Only campaigns created after this time (exclusive): an ISO 8601 date-time with a time zone, or a date (YYYY-MM-DD, midnight UTC). An ISO 8601 date-time with a time zone (`2026-11-05T14:00:00Z`, `2026-11-05T09:00:00-05:00`) or a date (`2026-11-05`, midnight UTC). A time with no zone is refused, and the 400 names this format."
                },
                {
                  "key": "created_before",
                  "value": "",
                  "disabled": true,
                  "description": "Only campaigns created before this time (exclusive): an ISO 8601 date-time with a time zone, or a date (YYYY-MM-DD, midnight UTC). An ISO 8601 date-time with a time zone (`2026-11-05T14:00:00Z`, `2026-11-05T09:00:00-05:00`) or a date (`2026-11-05`, midnight UTC). A time with no zone is refused, and the 400 names this format."
                },
                {
                  "key": "limit",
                  "value": "25",
                  "disabled": true,
                  "description": "Campaigns per page."
                },
                {
                  "key": "starting_after",
                  "value": "",
                  "disabled": true,
                  "description": "Cursor: `next_cursor` from the previous page, unchanged, with the same filters. Omit for the first page. A cursor from another list, or of a row this list no longer holds, is refused with 400 `invalid_request`: read from the first page."
                }
              ]
            },
            "description": "**List campaigns (this key's partner and mode).**\n\nNewest first (created_at, then id), a page at a time. Filters combine with AND. To page, send `starting_after` = the previous page's `next_cursor`, unchanged, with the same filters; `next_cursor` is null and `has_more` false on the last page. A cursor is opaque: anything else is 400 `invalid_request` (field `starting_after`). An unknown `dealer_id` is 404 `not_found`. Without parameters it answers as before: the newest 25. MCP: list_campaigns.\n\nOpenAPI: `listCampaigns`, `GET /v1/campaigns`."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Audience",
      "description": "Start the upload for a signed URL, PUT the CSV to that URL (a separate request, sent without your API key), then complete the upload. Or send the file in one call: the import takes the CSV as its body, or a source_url Xcel fetches once. Responses carry counts, reason codes and row numbers only.",
      "item": [
        {
          "name": "Start an audience upload",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 201\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([201]);",
                  "});",
                  "if (pm.response.code < 300) {",
                  "  const body = pm.response.json();",
                  "  pm.environment.set(\"audienceId\", body.audience_id);",
                  "  pm.environment.set(\"uploadUrl\", body.upload_url);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"include_suppression_list\": false\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:id/audience",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":id",
                "audience"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{campaignId}}",
                  "description": "Campaign id."
                }
              ]
            },
            "description": "**Start an audience upload (signed URL).**\n\nReturns a signed upload URL valid for 2 hours. PUT the CSV there (`Content-Type: text/csv`), then call `/audience/complete`. To send the file in this call instead, use `POST /v1/campaigns/{id}/audience/import`. One PUT per URL: the URL cannot replace a file that exists, so a corrected file needs a new upload.\n\nOpenAPI: `startAudienceUpload`, `POST /v1/campaigns/{id}/audience`."
          },
          "response": []
        },
        {
          "name": "PUT the CSV to the signed upload URL",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "auth": {
              "type": "noauth"
            },
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "text/csv"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "external_id,first_name,last_name,address1,address2,city,state,zip,vin,vehicle_year,vehicle_make,vehicle_model,service_advisor\ncrm-1001,Maria,Lopez,412 Cedar Ln,,Springfield,IL,62704,1HGCV1F30LA012345,2020,Honda,Accord,Dana\ncrm-1002,JAMES,O'BRIEN,88 Lake Shore Dr,Apt 3B,Chicago,Illinois,60611-2201,,2018,Ford,Escape,\ncrm-1003,Priya,Shah,1200 W Main St,,Peoria,IL,61606,,2022,Toyota,RAV4,Ravi\ncrm-1004,Tom,Nguyen,5 Elm Ct,,Normal,IL,61761,,2019,Chevrolet,Malibu,Dana\ncrm-1005,,Baker,77 Oak St,,Decatur,IL,62521,,2021,Kia,Sorento,\ncrm-1006,Ann,Lee,9 Pine Rd,,Champaign,ZZ,61820,,2017,Nissan,Altima,\ncrm-1007,Maria,Lopez,412 Cedar Lane,,Springfield,IL,62704,,2020,Honda,Accord,Dana\n",
              "options": {
                "raw": {
                  "language": "text"
                }
              }
            },
            "url": {
              "raw": "{{uploadUrl}}",
              "host": [
                "{{uploadUrl}}"
              ]
            },
            "description": "**PUT the audience CSV to the signed upload URL.**\n\nNot an API call: the `upload_url` that *Start an audience upload* saved as `uploadUrl` carries its own token, so this request sends no API key. The body is the quickstart's `audience.csv` (UTF-8, header row first); its last three rows are bad on purpose, so the completion's report shows reason codes. Expect 200.\n\nOne PUT per URL: the URL cannot replace a file that exists, so to send a corrected file, start a new upload. In a real integration the CSV goes from your own system to this URL and never through a chat or a tool argument."
          },
          "response": []
        },
        {
          "name": "Complete the audience upload",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"audience_id\": \"{{audienceId}}\",\n  \"vehicle_source\": \"serviced\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:id/audience/complete",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":id",
                "audience",
                "complete"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{campaignId}}",
                  "description": "Campaign id."
                }
              ]
            },
            "description": "**Process an uploaded audience.**\n\nParses, normalizes, dedupes (name + normalized address) and applies the optional suppression list and the dealer's lasting do-not-mail list (503 `suppression_list_unavailable` when that list cannot be read: nothing is processed, and you can complete again). Returns counts and a reason code per rejected spreadsheet row number. Live audiences then wait for Xcel's CASS/NCOA run (`pending_address_processing`); sandbox audiences pass immediately. `column_map` renames the file's columns before validation, e.g. `{\"customer_id\": \"external_id\", \"lease_maturity_date\": \"lease_end_date\"}`; a bad map is refused with 422 `column_map_invalid` and leaves the version open. Completing twice returns the stored result. Completing again with a different `column_map` processes the same uploaded file again, with no new PUT: in place for a `rejected` version, as a new audience version (new `id`, `reconciliation.reprocessed_from_version` set) for a processed one; a retry with the same map returns that new version. A file that cannot be processed is refused with 422 and that version becomes `rejected`. The report's `column_warnings` flag a missing `external_id` column, contact columns, columns the campaign's creative reads that the file lacks, and rows whose city or state was filled from the ZIP; `suggested_column_map` is the whole map to send. The response has no `next_step`; the next step is the creative.\n\nOpenAPI: `completeAudienceUpload`, `POST /v1/campaigns/{id}/audience/complete`."
          },
          "response": []
        },
        {
          "name": "Import the audience in one call (CSV body)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 201\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([201]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "text/csv"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": "Optional. One key per request you may retry (a UUID): 1 to 255 printable ASCII characters, no spaces. The same request with the same key replays the stored result for 24 hours (`Idempotent-Replayed: true`). Send it again only to retry the same request. A key starting `scoped:` is refused."
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "external_id,first_name,last_name,address1,address2,city,state,zip,vin,vehicle_year,vehicle_make,vehicle_model,service_advisor\ncrm-1001,Maria,Lopez,412 Cedar Ln,,Springfield,IL,62704,1HGCV1F30LA012345,2020,Honda,Accord,Dana\ncrm-1002,JAMES,O'BRIEN,88 Lake Shore Dr,Apt 3B,Chicago,Illinois,60611-2201,,2018,Ford,Escape,\ncrm-1003,Priya,Shah,1200 W Main St,,Peoria,IL,61606,,2022,Toyota,RAV4,Ravi\ncrm-1004,Tom,Nguyen,5 Elm Ct,,Normal,IL,61761,,2019,Chevrolet,Malibu,Dana\ncrm-1005,,Baker,77 Oak St,,Decatur,IL,62521,,2021,Kia,Sorento,\ncrm-1006,Ann,Lee,9 Pine Rd,,Champaign,ZZ,61820,,2017,Nissan,Altima,\ncrm-1007,Maria,Lopez,412 Cedar Lane,,Springfield,IL,62704,,2020,Honda,Accord,Dana\n",
              "options": {
                "raw": {
                  "language": "text"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:id/audience/import",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":id",
                "audience",
                "import"
              ],
              "query": [
                {
                  "key": "column_map",
                  "value": "",
                  "disabled": true,
                  "description": "A text/csv body only: the column_map as URL-encoded JSON, e.g. `?column_map=%7B%22customer_id%22%3A%22external_id%22%7D` for {\"customer_id\": \"external_id\"}. A JSON body carries column_map in the body instead."
                },
                {
                  "key": "vehicle_source",
                  "value": "serviced",
                  "disabled": true,
                  "description": "A text/csv body only: `vehicle_source` as in the JSON body, the vehicle history that prints first. A JSON body carries it in the body instead."
                }
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{campaignId}}",
                  "description": "Campaign id."
                }
              ]
            },
            "description": "**Import an audience by URL or CSV body, in one call.**\n\nSends the audience file and processes it in the same call, so there is no upload URL to handle. Answers as `/audience/complete` does: counts, reason codes and row numbers, never row values. JSON `{\"source_url\": \"https://...\"}`: Xcel fetches the URL once, from a public address only, with no redirects, at most 50 MB, and gives up after 30 seconds without data; it must answer CSV, plain text or a generic binary type, never an HTML page. Or send the CSV itself with `Content-Type: text/csv`, with `column_map`, if any, as URL-encoded JSON in the query, and `vehicle_source` in the query too. The hosted API takes request bodies up to 4.5 MB: send a larger file by `source_url` or the signed upload. The URL is never stored or logged, and the body is never logged. The file is stored where a signed upload would put it and processed the same way (dedupe, suppression and the dealer's lasting do-not-mail list, column warnings, city and state from the ZIP, retention). When the file is refused, the error's `fix` names the `audience_id` it was stored as: complete that id again with a `column_map` (no new import), or import a corrected file. `Idempotency-Key` is optional: the same key and request within 24 hours replay the first answer (`Idempotent-Replayed: true`). A `source_url` counts without its query string, so a retry may send a freshly signed link to the same file.\n\nOpenAPI: `importAudience`, `POST /v1/campaigns/{id}/audience/import`."
          },
          "response": []
        },
        {
          "name": "Delete the first upload's files",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:id/audience/:audience_id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":id",
                "audience",
                ":audience_id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{campaignId}}",
                  "description": "Campaign id."
                },
                {
                  "key": "audience_id",
                  "value": "{{audienceId}}",
                  "description": "The audience version's id, from the upload start, the import or the campaign's status."
                }
              ]
            },
            "description": "**Delete an audience version's files now.**\n\nDeletes the version from the signed upload now. The import above is the campaign's audience, so the order goes on.\n\nDeletes one audience version's stored files now, as the retention job does on its date: the original upload, the per-upload suppression list, the mailable file and the proof PDFs printed from it. Sets `purged_at` and sends `audience.purged` with `reason: request`. Counts and the reconciliation report stay. Row keys go too, unless an order was submitted with this version: its results still read them until 365 days by default after it closes. A second call answers the same. Refused with 409 `audience_in_production` while the version is the file of a submitted order that is not yet completed or cancelled: delete it after that. Any other version may go, in any status. Deleting the current audience of a campaign not yet submitted moves the campaign to `draft` with no audience: its proof, quote and approval were bound to that version, pending approvals expire, `validate_campaign` reports no audience, and proof and quote answer `audience_required` until a new upload completes. Each version keeps its own copy of the file, so a version made by reprocessing with a new `column_map` has to be deleted too. A signed upload URL still open cannot be recalled: a file PUT to it afterwards is never processed, and the daily job deletes it.\n\nOpenAPI: `deleteAudience`, `DELETE /v1/campaigns/{id}/audience/{audience_id}`."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Creative",
      "description": "Make the campaign's creative: from your saved template (then retire it), from print-ready art you upload to a signed URL, and last from Xcel's template with your copy, so the Proof folder renders that one. Preflight answers with every issue and its fix; each call makes a new creative version.",
      "item": [
        {
          "name": "Generate a creative from your saved template",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 201\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([201]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"template_code\": \"{{savedTemplateCode}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:id/creative",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":id",
                "creative"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{campaignId}}",
                  "description": "Campaign id."
                }
              ]
            },
            "description": "**Fill a template with copy, supply HTML, or send print-ready artwork.**\n\nUses the template *Save your own template* saved (`savedTemplateCode`). It sends no copy: the template's one slot is the phone, which prints from the dealer's profile. Runs before *Retire your own template*, since a retired template makes no new creatives.\n\nBrand values (logo, colors, phone, dealer name/address, disclosures) come from the locked brand kit and the FCRA notices are fixed text; sending `brand`, `dealer`, brand-named copy keys or copy keys starting with fcra is refused with `locked_field`. The creative is stored even when preflight finds errors. With a brief, Claude writes the open copy slots (see Creative docs, AI-written copy). Caller html is parsed and cleaned before storage: scripts, embedding elements, on* handlers, javascript: and remote URLs, @import, @media print, @page and :has() are removed, and each is a preflight error (script_not_allowed, active_content_not_allowed, remote_resource_not_allowed, print_css_not_allowed, css_invalid). With `artwork`, each file is fetched (url) or read from its signed upload (artwork_id): one PDF with a page per side, or one PNG or JPEG per side (`front` and `back`), which are placed on pages at the file size without resampling. The PDF that prints (and each image as sent) is stored by its sha256 and checked once; its preflight issues (artwork_*) are on the creative like any other. An upload is kept 7 days; an artwork_id a creative of this campaign already read keeps working from that creative's copy. Static art cannot be read by the copy checks: every artwork creative carries the info issue artwork_not_checked, and a prescreened credit offer must not be sent as artwork.\n\nOpenAPI: `generateCreative`, `POST /v1/campaigns/{id}/creative`."
          },
          "response": []
        },
        {
          "name": "Retire your own template",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/templates/:code/retire",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "templates",
                ":code",
                "retire"
              ],
              "variable": [
                {
                  "key": "code",
                  "value": "{{savedTemplateCode}}",
                  "description": "Template code: one of Xcel's, e.g. postcard_6x9_birthday, or one of your own saved templates, e.g. p_spring_service."
                }
              ]
            },
            "description": "**Retire your own template.**\n\nRetires every version of one of your saved templates: it is no longer listed, previewed (preview links answer 404) or used by new creatives, and a pinned template_version of it is refused. Creatives already made from it keep their stored HTML, slots and rules, so their proofs and orders are unchanged. Saving the code again makes its next version, active. Takes no body. MCP: retire_template.\n\nOpenAPI: `retireTemplate`, `POST /v1/templates/{code}/retire`."
          },
          "response": []
        },
        {
          "name": "Preview print-ready artwork",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});",
                  "if (pm.response.code < 300) {",
                  "  const body = pm.response.json();",
                  "  if (body.preview_url) pm.environment.set(\"artworkPreviewToken\", body.preview_url.split(\"/preview/artwork/\")[1]);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"product_code\": \"postcard_6x9\",\n  \"artwork\": {\n    \"url\": \"{{baseUrl}}/docs/specs/postcard_6x9.pdf\"\n  },\n  \"format\": \"json\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/artwork/preview",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "artwork",
                "preview"
              ]
            },
            "description": "**Check print-ready artwork before a campaign exists.**\n\nChecks print-ready art before a campaign exists; here the product's spec PDF (the designer's guide layer) stands in for your art. Send your own PDF's URL, or `front` and `back` for one PNG or JPEG per side. Saves the token of `preview_url` as `artworkPreviewToken`. The answer's `artwork_id` makes a creative with `{\"artwork\": {\"artwork_id\": ...}}`.\n\nReads the art as generate_creative does (a PDF by url or artwork_id, or one PNG or JPEG per side) and checks it against the product: every artwork_* preflight issue, the dealer's locked disclosures (locked_disclosure_unverified) and the address block with the fictional sample recipient. Answers the review proof PDF (format pdf, the default where PDF rendering is on), with the preflight summary in X-Xcel-Preflight-Ok, X-Xcel-Preflight-Errors and X-Xcel-Preflight-Warnings, the kept file in X-Xcel-Artwork-Id and the link in X-Xcel-Preview-Url; or JSON (format json). A preflight error does not fail the preview; a missing page prints blank. No campaign or creative is made: the file is kept 7 days as artwork_id, which POST /v1/campaigns/{id}/creative takes. Any key. Counts one render against render_proof's hourly limits: the dealer's (dealer_id) and the partner's, or for Demo Motors the partner's only (429 proof_render_rate_limited); a request refused before rendering, and opening preview_url, count nothing. format pdf where PDF rendering is off: 503 pdf_unavailable. MCP: preview_artwork (URLs only, Demo Motors).\n\nOpenAPI: `previewArtwork`, `POST /v1/artwork/preview`."
          },
          "response": []
        },
        {
          "name": "Open the artwork preview link",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "auth": {
              "type": "noauth"
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/preview/artwork/:token",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "preview",
                "artwork",
                ":token"
              ],
              "variable": [
                {
                  "key": "token",
                  "value": "{{artworkPreviewToken}}",
                  "description": "The signed token from preview_url."
                }
              ]
            },
            "description": "**Open an artwork preview link (no API key).**\n\nThe preview_url from POST /v1/artwork/preview or MCP preview_artwork: a page for a person, not an API call. The signed token is the capability and expires one hour after the preview; a revoked key's links stop working. It prints the art the preview kept as the review proof PDF, with the fictional sample recipient in the address block, so it shows no customer data. Never cached or indexed. It prints on the first opening and serves that stored PDF for the rest of the link's hour, so opening it counts against no render limit.\n\nOpenAPI: `openArtworkPreview`, `GET /preview/artwork/{token}`."
          },
          "response": []
        },
        {
          "name": "Start an artwork upload before a campaign",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 201\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([201]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"product_code\": \"postcard_6x9\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/artwork",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "artwork"
              ]
            },
            "description": "**Start an artwork upload before a campaign exists (signed URL).**\n\nLike POST /v1/campaigns/{id}/creative/artwork, without a campaign. PUT one file to upload_url within 2 hours: a PDF with a page per side, or one side's PNG or JPEG (one upload per side). The artwork_id works for POST /v1/artwork/preview and for POST /v1/campaigns/{id}/creative on any of your campaigns in the key's mode (sandbox or live), for 7 days after the file arrives. REST only: an agent cannot PUT a file. 400 unknown_product for a product Xcel does not offer.\n\nOpenAPI: `startPartnerArtworkUpload`, `POST /v1/artwork`."
          },
          "response": []
        },
        {
          "name": "Start an artwork upload for the campaign",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 201\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([201]);",
                  "});",
                  "if (pm.response.code < 300) {",
                  "  const body = pm.response.json();",
                  "  pm.environment.set(\"artworkId\", body.artwork_id);",
                  "  pm.environment.set(\"artworkUploadUrl\", body.upload_url);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:id/creative/artwork",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":id",
                "creative",
                "artwork"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{campaignId}}",
                  "description": "Campaign id."
                }
              ]
            },
            "description": "**Start an artwork upload for a campaign (signed URL).**\n\nSaves `artworkId` and the signed `artworkUploadUrl` for the next two requests.\n\nReturns a signed upload URL valid for 2 hours. PUT one file there with its Content-Type: a print-ready PDF (`application/pdf`, at most 50 MB) with a page per side, or one side's PNG or JPEG (`image/png`, `image/jpeg`, at most 25 MB; start one upload per side). Then call POST /v1/campaigns/{id}/creative with `{\"artwork\": {\"artwork_id\": \"...\"}}`, or for images `{\"artwork\": {\"front\": {\"artwork_id\": \"...\"}, \"back\": {\"artwork_id\": \"...\"}}}`. One PUT per URL. Nothing is checked until generate_creative reads the file. The artwork_id works for this campaign only; the file is deleted 7 days after it arrives (the creative keeps its own copy). For art before a campaign exists, use POST /v1/artwork. Takes no body. REST only: MCP generate_creative takes URLs, or an artwork_id a backend or person uploaded. Refused with 409 campaign_locked once the creative can no longer change.\n\nOpenAPI: `startArtworkUpload`, `POST /v1/campaigns/{id}/creative/artwork`."
          },
          "response": []
        },
        {
          "name": "PUT the PDF to the signed artwork upload URL",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "auth": {
              "type": "noauth"
            },
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/pdf"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "%PDF-1.4\n1 0 obj\n<< /Type /Catalog /Pages 2 0 R >>\nendobj\n2 0 obj\n<< /Type /Pages /Kids [3 0 R 4 0 R] /Count 2 >>\nendobj\n3 0 obj\n<< /Type /Page /Parent 2 0 R /MediaBox [0 0 666 450] /Resources << >> /Contents 5 0 R >>\nendobj\n4 0 obj\n<< /Type /Page /Parent 2 0 R /MediaBox [0 0 666 450] /Resources << >> /Contents 6 0 R >>\nendobj\n5 0 obj\n<< /Length 68 >>\nstream\n0 0.2 0.4 rg 0 0 666 450 re f\n0.784 0.063 0.18 rg 0 120 666 36 re f\nendstream\nendobj\n6 0 obj\n<< /Length 57 >>\nstream\n1 1 1 rg 0 0 666 450 re f\n0 0.2 0.4 rg 0 396 666 54 re f\nendstream\nendobj\nxref\n0 7\n0000000000 65535 f \n0000000009 00000 n \n0000000058 00000 n \n0000000121 00000 n \n0000000225 00000 n \n0000000329 00000 n \n0000000446 00000 n \ntrailer\n<< /Size 7 /Root 1 0 R >>\nstartxref\n552\n%%EOF\n",
              "options": {
                "raw": {
                  "language": "text"
                }
              }
            },
            "url": {
              "raw": "{{artworkUploadUrl}}",
              "host": [
                "{{artworkUploadUrl}}"
              ]
            },
            "description": "**PUT the artwork PDF to the signed upload URL.**\n\nNot an API call: the `upload_url` that *Start an artwork upload for the campaign* saved as `artworkUploadUrl` carries its own token, so this request sends no API key. The body is a small sample postcard_6x9 PDF, two pages at 9.25 x 6.25 in drawn with plain shapes; to send your own art, set the body to your file (binary) and keep `Content-Type: application/pdf`. Expect 200.\n\nOne PUT per URL: to send another file, start a new upload. Nothing is checked until *Generate a creative from the uploaded artwork* reads the file."
          },
          "response": []
        },
        {
          "name": "Generate a creative from the uploaded artwork",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 201\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([201]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"artwork\": {\n    \"artwork_id\": \"{{artworkId}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:id/creative",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":id",
                "creative"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{campaignId}}",
                  "description": "Campaign id."
                }
              ]
            },
            "description": "**Fill a template with copy, supply HTML, or send print-ready artwork.**\n\nMakes the creative from the PDF the last request uploaded (`artworkId`). Art is static: no copy or brief.\n\nBrand values (logo, colors, phone, dealer name/address, disclosures) come from the locked brand kit and the FCRA notices are fixed text; sending `brand`, `dealer`, brand-named copy keys or copy keys starting with fcra is refused with `locked_field`. The creative is stored even when preflight finds errors. With a brief, Claude writes the open copy slots (see Creative docs, AI-written copy). Caller html is parsed and cleaned before storage: scripts, embedding elements, on* handlers, javascript: and remote URLs, @import, @media print, @page and :has() are removed, and each is a preflight error (script_not_allowed, active_content_not_allowed, remote_resource_not_allowed, print_css_not_allowed, css_invalid). With `artwork`, each file is fetched (url) or read from its signed upload (artwork_id): one PDF with a page per side, or one PNG or JPEG per side (`front` and `back`), which are placed on pages at the file size without resampling. The PDF that prints (and each image as sent) is stored by its sha256 and checked once; its preflight issues (artwork_*) are on the creative like any other. An upload is kept 7 days; an artwork_id a creative of this campaign already read keeps working from that creative's copy. Static art cannot be read by the copy checks: every artwork creative carries the info issue artwork_not_checked, and a prescreened credit offer must not be sent as artwork.\n\nOpenAPI: `generateCreative`, `POST /v1/campaigns/{id}/creative`."
          },
          "response": []
        },
        {
          "name": "Generate the creative",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 201\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([201]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"template_code\": \"{{templateCode}}\",\n  \"copy\": {\n    \"note\": \"Happy birthday from all of us at {{dealer.name}}! Thank you for trusting us with your {{recipient.vehicle|vehicle}}.\\n\\nYour gift is on the other side. Stop by any time this month and we will take care of it for you.\",\n    \"gift_offer\": \"$50 toward any service\",\n    \"expires\": \"12/31/2026\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:id/creative",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":id",
                "creative"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{campaignId}}",
                  "description": "Campaign id."
                }
              ]
            },
            "description": "**Fill a template with copy, supply HTML, or send print-ready artwork.**\n\nFills Xcel's template (`templateCode`) with the quickstart's copy. It runs last in the folder, so the Proof folder renders this creative.\n\nBrand values (logo, colors, phone, dealer name/address, disclosures) come from the locked brand kit and the FCRA notices are fixed text; sending `brand`, `dealer`, brand-named copy keys or copy keys starting with fcra is refused with `locked_field`. The creative is stored even when preflight finds errors. With a brief, Claude writes the open copy slots (see Creative docs, AI-written copy). Caller html is parsed and cleaned before storage: scripts, embedding elements, on* handlers, javascript: and remote URLs, @import, @media print, @page and :has() are removed, and each is a preflight error (script_not_allowed, active_content_not_allowed, remote_resource_not_allowed, print_css_not_allowed, css_invalid). With `artwork`, each file is fetched (url) or read from its signed upload (artwork_id): one PDF with a page per side, or one PNG or JPEG per side (`front` and `back`), which are placed on pages at the file size without resampling. The PDF that prints (and each image as sent) is stored by its sha256 and checked once; its preflight issues (artwork_*) are on the creative like any other. An upload is kept 7 days; an artwork_id a creative of this campaign already read keeps working from that creative's copy. Static art cannot be read by the copy checks: every artwork creative carries the info issue artwork_not_checked, and a prescreened credit offer must not be sent as artwork.\n\nOpenAPI: `generateCreative`, `POST /v1/campaigns/{id}/creative`."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Proof",
      "description": "Render the proof and check readiness. The proof shows customer records, so the API describes it but never returns it.",
      "item": [
        {
          "name": "Render the proof",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:id/proof",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":id",
                "proof"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{campaignId}}",
                  "description": "Campaign id."
                }
              ]
            },
            "description": "**Render and check the proof.**\n\nRenders three sample rows plus the worst case (longest name/address), checks the brand-kit logo (warning brand_logo_unreachable; the proof then shows a placeholder box with the dealer name), and fits the worst case into the address area (warnings address_abbreviated, address_line_wrapped, address_block_overflow). Where PDF rendering is on, it prints the print-ready PDF once at trim size plus bleed (one page per panel, else 422 proof_layout_invalid), draws the review proof's guides and PROOF footer over those same pages, and stores both (`renderer.format: \"pdf\"`, `pdf_available: true`); a print failure answers 502 `proof_render_failed` and changes nothing. Elsewhere the proof is an HTML preview (`pdf_available: false`). The proof shows customer records, so it is not returned; the approver sees it on the review page. Counts one render against the campaign's dealer (30 an hour by default) and the partner (300), shared with template and artwork previews (429 proof_render_rate_limited). An artwork (kind pdf) creative prints the PDF's pages with the address block drawn over the address side, one page per side per proof recipient; it needs PDF rendering (503 pdf_unavailable otherwise, since only the PDF proof shows the art), and a stored artwork file that no longer matches its sha256 answers 409 artwork_missing.\n\nOpenAPI: `renderProof`, `POST /v1/campaigns/{id}/proof`."
          },
          "response": []
        },
        {
          "name": "Check readiness",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:id/validate",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":id",
                "validate"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{campaignId}}",
                  "description": "Campaign id."
                }
              ]
            },
            "description": "**Readiness checklist and preflight issues (read-only; same as POST).**\n\nThe readiness checklist and every preflight issue, with `dealer_spend_cap_cents` and `dealer_spend_remaining_cents`. When the dealer has a cap and the order is not submitted, a `spend_cap` check holds up `ready_for_approval` only. On a live order, `live_gaps` and the `approver`, `live_ordering` and `disclosures` checks say what approval or submit still lacks. Read-only.\n\nOpenAPI: `validateCampaignGet`, `GET /v1/campaigns/{id}/validate`."
          },
          "response": []
        },
        {
          "name": "Check readiness (POST)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:id/validate",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":id",
                "validate"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{campaignId}}",
                  "description": "Campaign id."
                }
              ]
            },
            "description": "**Readiness checklist and preflight issues (read-only; GET also works).**\n\nThe same read-only check as GET /v1/campaigns/{id}/validate: the readiness checklist and every preflight issue. It changes nothing.\n\nOpenAPI: `validateCampaign`, `POST /v1/campaigns/{id}/validate`."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Quote",
      "description": "Quote the current creative and audience at your price for your volume tier (https://api.updash.com/console/pricing, signed in).",
      "item": [
        {
          "name": "Get a quote",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 201\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([201]);",
                  "});",
                  "if (pm.response.code < 300) {",
                  "  const body = pm.response.json();",
                  "  pm.environment.set(\"quoteId\", body.quote.id);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"mail_class\": \"first_class\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:id/quote",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":id",
                "quote"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{campaignId}}",
                  "description": "Campaign id."
                }
              ]
            },
            "description": "**Quote the current creative and audience.**\n\nRefuses with 409 `product_not_offered` for a campaign whose product is no longer offered (one made before the product was withdrawn), and with 500 `price_below_cost` if a configured price is below Xcel's cost floor (a configuration error at Xcel; nothing in the request needs to change).\n\nOpenAPI: `getQuote`, `POST /v1/campaigns/{id}/quote`."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Approval and submit",
      "description": "Ask a human to approve, then submit. In the sandbox the review page comes back as `reviewUrl`: open it in a browser and approve as the developer. Get campaign status then answers `approved`, and Submit goes through.",
      "item": [
        {
          "name": "Request approval",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 201\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([201]);",
                  "});",
                  "if (pm.response.code < 300) {",
                  "  const body = pm.response.json();",
                  "  pm.environment.set(\"approvalId\", body.approval_id);",
                  "  if (body.review_url) pm.environment.set(\"reviewUrl\", body.review_url);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": "Optional. One key per request you may retry (a UUID): 1 to 255 printable ASCII characters, no spaces. The same request with the same key replays the stored result for 24 hours (`Idempotent-Replayed: true`). Send it again only to retry the same request. A key starting `scoped:` is refused."
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"quote_id\": \"{{quoteId}}\",\n  \"max_spend_cents\": 50000,\n  \"approver_email\": \"you@example.com\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:id/approval",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":id",
                "approval"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{campaignId}}",
                  "description": "Campaign id."
                }
              ]
            },
            "description": "**Request human approval.**\n\n`max_spend_cents` is the most the person you work for said to spend, never your own estimate; it must be at least the quote total. Saves `approvalId`, and in the sandbox `reviewUrl`.\n\nCreates an approval bound to the campaign's current creative version, audience version, the quote and `max_spend_cents`. Live: `approver_email` must be one of the dealer's `registered_approvers` (omit it when exactly one is registered); Xcel emails the review link to that person and the response holds only the approval id, status, masked approver email, total and expiry. Refusals: `dealer_spend_cap_exceeded` (409, the code submit uses: the quote total is over what remains of the dealer's monthly spend cap after this month's submitted orders in the same mode; no approval is created and nobody is emailed), `no_registered_approver` (409), `approver_not_registered` and `approver_email_required` (400), `approval_delivery_unavailable` (503, nothing created), `approval_delivery_failed` (502, approval expired). Sandbox: no registry check, no email; the response adds `review_url` and `sandbox_only: true`. Only a human decision on the review page approves the order, and the approve is refused with dealer_spend_cap_exceeded (nothing approved) when the quote no longer fits what is left of the cap, since other orders submitted or a lowered cap can use it up while the link waits. Where PDF rendering is on, the approval records the print-ready PDF's sha256 and is refused with 409 proof_pdf_missing when no PDF exists for the current versions; approving, submitting and the printer packet then refuse a changed file (proof_pdf_changed). A prescreened credit offer (a template with `requires_prescreened_list: true`, or any piece that prints the FCRA notices) answers with `prescreen_attestation` and a `next_step` that says so: before Approve works, the approver confirms on the review page that the mailing list is a prescreened list from the consumer reporting agency the piece names (`copy.prescreen_cra`) and enters the date the agency produced it; the approval records both. `Idempotency-Key` is optional: the same key and body within 24 hours answer the first answer (`Idempotent-Replayed: true`), with no second email and the first link still working. Without one, each call expires the earlier pending approval and asks again. A live answer holds no review link, so nor does its stored copy.\n\nOpenAPI: `requestApproval`, `POST /v1/campaigns/{id}/approval`."
          },
          "response": []
        },
        {
          "name": "Get campaign status",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{campaignId}}",
                  "description": "Campaign id."
                }
              ]
            },
            "description": "**Campaign status, counts, approval state and next step.**\n\nEverything the API holds about one order's state: the campaign, its audience counts, creative, latest quote, latest approval, submission and mail dates, who has the next move (`waiting_on`) and `next_step`. Poll it no more than about once a minute, or register a webhook.\n\nOpenAPI: `getCampaignStatus`, `GET /v1/campaigns/{id}`."
          },
          "response": []
        },
        {
          "name": "Decide a sandbox approval",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"approval_id\": \"{{approvalId}}\",\n  \"decision\": \"approve\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/test/campaigns/:id/approval",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "test",
                "campaigns",
                ":id",
                "approval"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{campaignId}}",
                  "description": "Campaign id."
                }
              ]
            },
            "description": "**Sandbox only: decide a pending approval from a script.**\n\nSend this, or approve at reviewUrl in a browser, not both: a decided approval answers 409. Approves or rejects the pending approval from a script. Sandbox keys only: a live order is approved only by the dealer's registered approver.\n\nTest-mode keys only (`test_mode_only` otherwise). Approves or rejects a sandbox order's pending approval, with every check the review page makes, so a script or CI job can run the whole flow. A live order is approved only by the dealer's registered approver on the page Xcel emails them; no route or tool can. Not an MCP tool.\n\nOpenAPI: `decideTestApproval`, `POST /v1/test/campaigns/{id}/approval`."
          },
          "response": []
        },
        {
          "name": "Submit",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 201\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([201]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": "One key per order (a UUID): 1 to 255 printable ASCII characters, no spaces. Scoped to the partner and the key's mode. Reuse it only to retry the same request. A key starting `scoped:` is refused."
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"approval_id\": \"{{approvalId}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:id/submit",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":id",
                "submit"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{campaignId}}",
                  "description": "Campaign id."
                }
              ]
            },
            "description": "**Submit an approved campaign.**\n\nRequires `Idempotency-Key`, scoped to the partner and the key's mode. The dealer's spend cap is checked when approval is requested, when the approver approves on the review page, again here, and again inside the submit transaction under a per-dealer lock, since other orders or the cap can change while the approval waits. Refused unless the approval is approved by a human, unexpired, bound to the current creative/audience versions and quote, the quote is unexpired, its total is within `max_spend_cents` and the dealer's monthly spend cap, and (live) the partner has ordering enabled. Refusal codes: product_not_offered, proof_pdf_changed, approval_not_found, approval_pending, approval_rejected, approval_expired, approval_stale_creative, approval_stale_audience, approval_quote_mismatch, quote_expired, max_spend_exceeded, campaign_not_approved, ordering_disabled, dealer_spend_cap_exceeded, already_submitted, idempotency_key_required, invalid_idempotency_key, idempotency_key_reused, idempotency_in_progress, campaign_changed, not_found. The body is validated before the key. A repeat with the same key, campaign and approval_id within 24 hours returns the stored response with `Idempotent-Replayed: true`; refusals are not stored. While a request with the key is running, a repeat gets idempotency_in_progress; the running request holds the key for at most 60 seconds, so a crashed request frees it within a minute. The submission, the status change, its event and webhook deliveries are written in one transaction.\n\nOpenAPI: `submitCampaign`, `POST /v1/campaigns/{id}/submit`."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Sandbox",
      "description": "Sandbox keys only: simulate production after Submit. Without a body each send moves the order one status on, and five take it to `completed`; this request sends `to` and goes there at once, so the Results folder has results. Results are simulated from `in_postal_network` on.",
      "item": [
        {
          "name": "Advance a sandbox campaign",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"to\": \"completed\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/test/campaigns/:id/advance",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "test",
                "campaigns",
                ":id",
                "advance"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{campaignId}}",
                  "description": "Campaign id."
                }
              ]
            },
            "description": "**Sandbox only: simulate the next production status.**\n\nSends `{\"to\": \"completed\"}`: the order goes straight to `completed`, with simulated results. Leave the body out to move one status on, or send another status, e.g. `{\"to\": \"in_postal_network\"}`.\n\nTest-mode keys only (`test_mode_only` otherwise). Moves a submitted sandbox campaign to the next status, or to `to`. MCP: advance_test_campaign.\n\nOpenAPI: `advanceTestCampaign`, `POST /v1/test/campaigns/{id}/advance`."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Results",
      "description": "The timeline, quantities and results, per lead keyed by your `external_id`. Sandbox results are simulated from `in_postal_network` on, so the Sandbox folder runs first and advances the order to `completed`.",
      "item": [
        {
          "name": "Get results",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:id/results",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":id",
                "results"
              ],
              "query": [
                {
                  "key": "leads_after",
                  "value": "",
                  "disabled": true,
                  "description": "Cursor: the leads.next_after of the previous page. Omit for the first page. A row key this list does not hold (from `/leads`, an older audience version or another campaign) is refused with 400 `invalid_request`: read from the first page."
                },
                {
                  "key": "leads_limit",
                  "value": "100",
                  "disabled": true,
                  "description": "Leads per page."
                },
                {
                  "key": "external_id",
                  "value": "crm-1001",
                  "disabled": true,
                  "description": "Only this person's rows: your record id from the audience, exact. Several rows can share one. A value shaped like an email address or phone number is refused: intake never keeps one as an id."
                },
                {
                  "key": "updated_after",
                  "value": "2026-11-01T14:00:00Z",
                  "disabled": true,
                  "description": "Only leads whose responses or matches changed after this time (exclusive): an ISO 8601 date-time with a time zone, or a date (YYYY-MM-DD, midnight UTC). A lead's updated_at moves only when its results change. One poll stamps every lead it changes with one time and writes them over a few seconds, so overlap your windows by a few minutes. An ISO 8601 date-time with a time zone (`2026-11-05T14:00:00Z`, `2026-11-05T09:00:00-05:00`) or a date (`2026-11-05`, midnight UTC). A time with no zone is refused, and the 400 names this format."
                }
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{campaignId}}",
                  "description": "Campaign id."
                }
              ]
            },
            "description": "**Timeline, quantities and results.**\n\nThe production timeline and quantities, and results once Xcel's tracking reports them: aggregates and a page of per-lead results keyed by your external_id and the row key, never names or addresses. Live orders are refreshed every 6 hours until 90 days after completion; sandbox orders get simulated results from the test advance (in_postal_network onward). Per-lead results are deleted 365 days (by default) after the order completes or is cancelled; the aggregates stay. `external_id` and `updated_after` narrow only the page of leads, not the aggregates; send them on every page with `leads_after`.\n\nOpenAPI: `getCampaignResults`, `GET /v1/campaigns/{id}/results`."
          },
          "response": []
        },
        {
          "name": "List who is on the audience",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:id/leads",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":id",
                "leads"
              ],
              "query": [
                {
                  "key": "after",
                  "value": "",
                  "disabled": true,
                  "description": "Cursor: the next_after of the previous page. Omit for the first page. A row key of an older audience version, or from another list, is refused with 400 `invalid_request`: after a new audience version, read from the first page."
                },
                {
                  "key": "limit",
                  "value": "100",
                  "disabled": true,
                  "description": "Rows per page."
                },
                {
                  "key": "external_id",
                  "value": "crm-1001",
                  "disabled": true,
                  "description": "Only this person's rows: your record id from the audience, exact. Several rows can share one. A value shaped like an email address or phone number is refused: intake never keeps one as an id."
                }
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{campaignId}}",
                  "description": "Campaign id."
                }
              ]
            },
            "description": "**Who is on the campaign's current audience.**\n\nEvery mailable row of the current audience, a page at a time in row-key order, so you can mark each shopper by your own id (`external_id` reads one shopper's rows): `row_key`, `external_id`, `audience_version`, a result status and the piece's USPS tracking. Ids only: never a name, address, phone or email. Mailable is not mailed. `mailed` turns true once the order reaches USPS (`at_usps` or later, a processing scan, not proof of delivery). CASS and NCOA run on live orders after this list is made and report how many rows they removed, not which, so up to `address_processing.cass_failed` + `ncoa_moved` + `do_not_mail` of these rows may not have printed. `result_status` is `matched` (a sale or service is matched to the lead), `responded` (a response, no match), or null. `usps` is the piece's USPS tracking from its Intelligent Mail barcode scans, read every 6 hours once Xcel links a live order to its tracking: `in_transit` after any scan, `processed_for_delivery` once USPS sorted it for its carrier (not proof of delivery), with the scan count, first and last scan and the last facility; null before the first scan. campaign.usps_tracking_updated names the pieces whose stage moved. Row keys are deleted under the results retention policy: the list is then empty, `lead_data_purged_at` is set and `mailable_count` stays. An audience version never submitted loses its row keys with its files. Not on MCP: use get_campaign_results for a lead's results.\n\nOpenAPI: `listCampaignLeads`, `GET /v1/campaigns/{id}/leads`."
          },
          "response": []
        },
        {
          "name": "List every campaign a shopper is on",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/leads?external_id=crm-1001",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "leads"
              ],
              "query": [
                {
                  "key": "external_id",
                  "value": "crm-1001",
                  "description": "The shopper: your record id from the audience, exact. A value shaped like an email address or phone number is refused: intake never keeps one as an id."
                },
                {
                  "key": "dealer_id",
                  "value": "{{dealerId}}",
                  "disabled": true,
                  "description": "Only this dealer's records: the Xcel dealer id or your external dealer id. An unknown dealer is 404 `not_found` with `field: \"dealer_id\"`."
                },
                {
                  "key": "limit",
                  "value": "50",
                  "disabled": true,
                  "description": "Rows per page, 1 to 100."
                },
                {
                  "key": "starting_after",
                  "value": "",
                  "disabled": true,
                  "description": "Cursor: `next_cursor` from the previous page, unchanged, with the same filters. Omit for the first page. A cursor from another list, or of a row this list no longer holds, is refused with 400 `invalid_request`: read from the first page."
                }
              ]
            },
            "description": "**Every campaign a shopper is on.**\n\nYour mail history for one shopper, by your own id, across campaigns: in this key's mode and, for a limited key, its dealers, newest first, with the campaign, dealer, status and row key. Ids only: never a name, address, phone or email. A campaign counts when the shopper has a row on its current audience, whatever its status, so a draft is listed too: read `status` and `mailed`. Mailable is not mailed: `mailed` rests on a processing scan, not proof of delivery, and CASS and NCOA report how many rows they removed from a live order, not which. An empty list means no current audience holds this id: the shopper was rejected (the campaign's `reconciliation.rejected_rows` names the id), was never sent, or retention deleted the row keys. `GET /v1/campaigns/{id}/results` proves nothing about who was mailed: it lists only leads with results. Not on MCP.\n\nOpenAPI: `listShopperLeads`, `GET /v1/leads`."
          },
          "response": []
        },
        {
          "name": "Who this key acts for, and whether live ordering is on",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/account",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "account"
              ]
            },
            "description": "**Who this key acts for, and whether live ordering is on.**\n\nThe partner, the key's mode, ordering_enabled and what stands between you and a live order, with the limits that apply. Works with test and live keys alike. Read it instead of learning from a refused submit.\n\nOpenAPI: `getAccount`, `GET /v1/account`."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Keys",
      "description": "Make a key limited to some dealers, so each store can hold its own, list your keys and revoke one. The secret comes back once. Needs a key for every dealer.",
      "item": [
        {
          "name": "Make a key for one dealer",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 201\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([201]);",
                  "});",
                  "if (pm.response.code < 300) {",
                  "  const body = pm.response.json();",
                  "  pm.environment.set(\"keyId\", body.id);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": "One key per order (a UUID): 1 to 255 printable ASCII characters, no spaces. Scoped to the partner and the key's mode. Reuse it only to retry the same request. A key starting `scoped:` is refused."
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"label\": \"Demo Motors store key\",\n  \"dealer_ids\": [\n    \"demo-motors\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/keys",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "keys"
              ]
            },
            "description": "**Make a key limited to some dealers.**\n\nThe secret comes back once, in `key`. A retry with the same Idempotency-Key answers the same id with `key: null`. Saves the key's id as `keyId`.\n\nMakes a key that reaches only the dealers in `dealer_ids`, in the caller's mode, so each store can hold its own credential. `dealer_ids` is required, so this route cannot make a key for every dealer: those stay in the console. Needs a key that reaches every dealer: a limited key answers 403 `dealer_scope_forbidden`. The secret comes back once, in `key`, and only its hash is kept. `Idempotency-Key` is required, since a retry must not make a second key. No stored answer holds a secret, so a retry with the same key and body answers the same key's id with `key: null` and `Idempotent-Replayed: true`. If the first answer was lost, revoke that key and make another with a new `Idempotency-Key`. At most 1,000 active limited keys per mode: past it, 409 `key_limit_reached`. Not on MCP.\n\nOpenAPI: `createKey`, `POST /v1/keys`."
          },
          "response": []
        },
        {
          "name": "List keys",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/keys",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "keys"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "100",
                  "disabled": true,
                  "description": "Keys per page, 1 to 200."
                },
                {
                  "key": "after",
                  "value": "",
                  "disabled": true,
                  "description": "Cursor: the next_after of the previous page. Omit for the first page. Anything but a key of this partner and mode is refused with 400 `invalid_request`."
                }
              ]
            },
            "description": "**List API keys.**\n\nThis mode's API keys, oldest first, revoked ones too: limited keys with their dealers, and how many of each kind are active. Never a secret or a hash. Needs a key that reaches every dealer: a limited key answers 403 `dealer_scope_forbidden`.\n\nOpenAPI: `listKeys`, `GET /v1/keys`."
          },
          "response": []
        },
        {
          "name": "Revoke a key",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/keys/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "keys",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{keyId}}",
                  "description": "The key's id, from `POST /v1/keys` or `GET /v1/keys`. Never the key itself."
                }
              ]
            },
            "description": "**Revoke a limited key (idempotent).**\n\nRevokes a limited key of this partner and mode: it stops working at once, with every MCP connection made from it. Calling it again answers 200 with `changed: false`. Another partner's key, or one in the other mode, answers 404. A key that reaches every dealer answers 403 `key_for_every_dealer`: revoke those in the console, so one leaked key cannot lock out the others. Needs a key that reaches every dealer: a limited key answers 403 `dealer_scope_forbidden`.\n\nOpenAPI: `revokeKey`, `DELETE /v1/keys/{id}`."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Webhooks",
      "description": "The endpoint registered at the start of the Campaigns folder has the order's events by now. Send it a test event (not stored, so not listed), read its deliveries and replay one, rotate its secret and deactivate it. Replace the example URL with your own receiver.",
      "item": [
        {
          "name": "List webhook event types",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks/event-types",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks",
                "event-types"
              ]
            },
            "description": "**Every event type, with what it says.**\n\nEvery event type an endpoint can subscribe to, with what each says, and the test event's type.\n\nOpenAPI: `listWebhookEventTypes`, `GET /v1/webhooks/event-types`."
          },
          "response": []
        },
        {
          "name": "List events for a window",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/events",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "events"
              ],
              "query": [
                {
                  "key": "since",
                  "value": "2026-11-01T00:00:00Z",
                  "disabled": true,
                  "description": "Events at or after this time: an ISO 8601 date-time with a time zone, or a date (YYYY-MM-DD, midnight UTC). An ISO 8601 date-time with a time zone (`2026-11-05T14:00:00Z`, `2026-11-05T09:00:00-05:00`) or a date (`2026-11-05`, midnight UTC). A time with no zone is refused, and the 400 names this format."
                },
                {
                  "key": "until",
                  "value": "2026-11-02T00:00:00Z",
                  "disabled": true,
                  "description": "Events before this time (exclusive), in the same form. Windows that share an edge neither repeat nor miss an event. Must be after since. An ISO 8601 date-time with a time zone (`2026-11-05T14:00:00Z`, `2026-11-05T09:00:00-05:00`) or a date (`2026-11-05`, midnight UTC). A time with no zone is refused, and the 400 names this format."
                },
                {
                  "key": "dealer_id",
                  "value": "{{dealerId}}",
                  "disabled": true,
                  "description": "Only this dealer's records: the Xcel dealer id or your external dealer id. An unknown dealer is 404 `not_found` with `field: \"dealer_id\"`."
                },
                {
                  "key": "type",
                  "value": "campaign.status_changed",
                  "disabled": true,
                  "description": "Only this event type. GET /v1/webhooks/event-types lists them."
                },
                {
                  "key": "limit",
                  "value": "50",
                  "disabled": true,
                  "description": "Most events per page. A page can hold fewer: go by next_cursor."
                },
                {
                  "key": "starting_after",
                  "value": "",
                  "disabled": true,
                  "description": "Cursor: `next_cursor` from the previous page, unchanged, with the same filters. Omit for the first page. A cursor from another list, or of a row this list no longer holds, is refused with 400 `invalid_request`: read from the first page."
                }
              ]
            },
            "description": "**Your events for a time window, oldest first.**\n\nReconcile a window you missed: your partner's events in this key's mode, in the envelope webhooks deliver, oldest first (created_at, then id). Every type webhooks deliver is here, whether or not an endpoint was registered then; `webhook.test` pings and the campaign timeline's ops and retention entries are not. Sandbox keys read test campaigns' events, live keys live campaigns' events. `dealer.updated` reads in both modes with this key's `mode`, except a test dealer's, which only sandbox keys read. To page, send `starting_after` = the previous page's `next_cursor` with the same filters; `next_cursor` is null and `has_more` false on the last page. A page can hold fewer than `limit` events, and a big one stops early: go by `next_cursor`. An event can commit a moment after its `created_at`, so read up to a minute or two before now, or overlap windows and drop duplicates by `id`. `sequence` here is read from `created_at`: two events in one millisecond can share it, and it can sit a few microseconds below what a webhook delivered for the same event. List order is the order. An unknown `dealer_id` is 404 `not_found`. An old `campaign.lead_results_updated` keeps the ids it named after retention deletes the row keys. Not on MCP.\n\nOpenAPI: `listEvents`, `GET /v1/events`."
          },
          "response": []
        },
        {
          "name": "List webhooks",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks"
              ]
            },
            "description": "**List webhook endpoints with their latest delivery (secrets never shown).**\n\nYour endpoints in the key's mode (a sandbox key sees sandbox endpoints only), active and deactivated, each with its latest delivery, and the active-endpoint limit. The signing secret is never returned here: only at creation and rotation.\n\nOpenAPI: `listWebhooks`, `GET /v1/webhooks`."
          },
          "response": []
        },
        {
          "name": "Send a test event",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks/:id/test",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks",
                ":id",
                "test"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{webhookId}}",
                  "description": "Webhook endpoint id."
                }
              ]
            },
            "description": "**Send a signed test event now and report what the endpoint answered.**\n\nSends one webhook.test event, signed like a real one, whatever event_types the endpoint takes. Nothing is stored and nothing retries. At most 20 per endpoint per hour (429 webhook_test_rate_limited). A deactivated endpoint is 409 webhook_inactive.\n\nOpenAPI: `testWebhook`, `POST /v1/webhooks/{id}/test`."
          },
          "response": []
        },
        {
          "name": "List a webhook's deliveries",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});",
                  "if (pm.response.code < 300) {",
                  "  const body = pm.response.json();",
                  "  pm.environment.set(\"deliveryId\", (body.deliveries[0] || { id: \"\" }).id);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks/:id/deliveries",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks",
                ":id",
                "deliveries"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "25",
                  "disabled": true,
                  "description": "Deliveries per page."
                },
                {
                  "key": "offset",
                  "value": "0",
                  "disabled": true,
                  "description": "How many to skip."
                }
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{webhookId}}",
                  "description": "Webhook endpoint id."
                }
              ]
            },
            "description": "**One endpoint's deliveries, newest first (never the body).**\n\nSaves the newest delivery's id as `deliveryId`, for the replay. The list is empty when the endpoint was registered after the order's events.\n\nThe endpoint's deliveries, newest first: event type, status, attempts and the last error. Never the body. Page with `limit` and `offset`; `has_more` says whether more remain.\n\nOpenAPI: `listWebhookDeliveries`, `GET /v1/webhooks/{id}/deliveries`."
          },
          "response": []
        },
        {
          "name": "Replay a delivery",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 202\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([202]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks/:id/deliveries/:delivery_id/replay",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks",
                ":id",
                "deliveries",
                ":delivery_id",
                "replay"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{webhookId}}",
                  "description": "Webhook endpoint id."
                },
                {
                  "key": "delivery_id",
                  "value": "{{deliveryId}}",
                  "description": "A delivery id from GET /v1/webhooks/{id}/deliveries."
                }
              ]
            },
            "description": "**Queue a past delivery to send again.**\n\nSends the stored body again, with its original event id, sequence and a fresh signature, so a receiver that de-duplicates by X-Xcel-Event-Id drops a copy it already handled. A delivery still queued is 409 webhook_delivery_pending. At most 100 replays per endpoint per hour.\n\nOpenAPI: `replayWebhookDelivery`, `POST /v1/webhooks/{id}/deliveries/{delivery_id}/replay`."
          },
          "response": []
        },
        {
          "name": "Rotate a webhook secret",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks/:id/rotate-secret",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks",
                ":id",
                "rotate-secret"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{webhookId}}",
                  "description": "Webhook endpoint id."
                }
              ]
            },
            "description": "**Rotate an endpoint's signing secret (new secret shown once).**\n\nGives an active endpoint a new `whsec_` secret and returns it once. It applies at once: every delivery sent from now on, retries included, is signed with it, so update your receiver first or accept both secrets for a short overlap. A deactivated endpoint answers 409 webhook_inactive (reactivate it in the partner console first); another partner's or mode's answers 404 webhook_not_found. No request body.\n\nOpenAPI: `rotateWebhookSecret`, `POST /v1/webhooks/{id}/rotate-secret`."
          },
          "response": []
        },
        {
          "name": "Deactivate a webhook",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{webhookId}}",
                  "description": "Webhook endpoint id."
                }
              ]
            },
            "description": "**Deactivate a webhook endpoint (idempotent).**\n\nDeactivates one of your endpoints in the key's mode and cancels its pending deliveries, so nothing more is sent to it. The endpoint stays in the list (with deactivated_at and its last delivery) and no longer counts toward the active-endpoint limit. A console admin can reactivate it in the partner console (Developers); the API has no reactivate route. Calling it again answers 200 with pending_deliveries_cancelled 0. Another partner's endpoint, or one in the other mode, answers 404 webhook_not_found.\n\nOpenAPI: `deleteWebhook`, `DELETE /v1/webhooks/{id}`."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Standing orders",
      "description": "Save a repeating mailing once, then turn a list into an order with one run: the run makes the campaign through to the approval request, skipping anyone the standing order mailed within its window. Nothing prints until the dealer's approver approves each run. A `source_url` and `cadence` on the order let the daily job fetch the list on a schedule, and an `inbound_subject` takes the list your platform emails to the dealer's inbound address.",
      "item": [
        {
          "name": "Save a standing order",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 201\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([201]);",
                  "});",
                  "if (pm.response.code < 300) {",
                  "  const body = pm.response.json();",
                  "  pm.environment.set(\"standingOrderId\", body.standing_order.id);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": "Optional. One key per request you may retry (a UUID): 1 to 255 printable ASCII characters, no spaces. The same request with the same key replays the stored result for 24 hours (`Idempotent-Replayed: true`). Send it again only to retry the same request. A key starting `scoped:` is refused."
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"dealer_id\": \"{{dealerId}}\",\n  \"name\": \"Birthdays this month\",\n  \"product_code\": \"postcard_6x9\",\n  \"creative\": {\n    \"template_code\": \"{{templateCode}}\",\n    \"copy\": {\n      \"note\": \"Happy birthday from all of us at {{dealer.name}}! Thank you for trusting us with your {{recipient.vehicle|vehicle}}.\\n\\nYour gift is on the other side. Stop by any time this month and we will take care of it for you.\",\n      \"gift_offer\": \"$50 toward any service\",\n      \"expires\": \"12/31/2026\"\n    }\n  },\n  \"max_spend_cents\": 50000,\n  \"skip_mailed_within_days\": 90,\n  \"source_url\": \"https://exports.example.com/audiences/lapsed.csv?sig=...\",\n  \"column_map\": {\n    \"customer_id\": \"external_id\",\n    \"lease_maturity_date\": \"lease_end_date\"\n  },\n  \"vehicle_source\": \"serviced\",\n  \"external_id\": \"aud-lapsed-service\",\n  \"inbound_subject\": \"Birthdays this month\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/standing-orders",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "standing-orders"
              ]
            },
            "description": "**Save a standing order.**\n\n`max_spend_cents` is the most one run may cost, a figure a person set. `inbound_subject` takes the audience report your platform emails with that title in its subject. Saves the id as `standingOrderId`.\n\nSaves one repeating mailing for one dealer, after every check a run would meet first: the dealer in the key's scope, the product, the template for that product and the creative's preflight for this dealer (422 `preflight_failed`), live approvers (`approver_not_registered`, `approver_email_required`, `no_registered_approver`), `source_url` and `cadence` together or neither, and the `column_map`, and an `inbound_subject` no other standing order of the dealer holds (409 `inbound_subject_taken`). `Idempotency-Key` is optional and honored as on campaign create. Nothing is mailed or approved here. See /docs/standing-orders.\n\nOpenAPI: `createStandingOrder`, `POST /v1/standing-orders`."
          },
          "response": []
        },
        {
          "name": "Turn on the dealer's address for emailed lists",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": "Optional. One key per request you may retry (a UUID): 1 to 255 printable ASCII characters, no spaces. The same request with the same key replays the stored result for 24 hours (`Idempotent-Replayed: true`). Send it again only to retry the same request. A key starting `scoped:` is refused."
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"enabled\": true,\n  \"senders\": [\n    \"reports@your-platform.example\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/dealers/:id/inbound-email",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dealers",
                ":id",
                "inbound-email"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{dealerId}}",
                  "description": "Xcel dealer id or your own external dealer id."
                }
              ]
            },
            "description": "**Turn the dealer's inbound address on or off, set its senders, or rotate it.**\n\nAnswers the dealer's inbound `address`, a secret: point your platform's scheduled audience report at it. Each email starts a run of the standing order whose `inbound_subject` is in its subject. A sandbox key's address is its own.\n\nChanges only the fields sent. The first `enabled: true` gives the dealer its address; `rotate: true` replaces it, and the old one stops at once. A server that takes no email answers 503 `inbound_email_unavailable` to turning it on or rotating it. `Idempotency-Key` is optional: a retry with the same key answers the first result, so a retried rotation rotates once. Nothing is mailed here.\n\nOpenAPI: `updateDealerInboundEmail`, `PUT /v1/dealers/{id}/inbound-email`."
          },
          "response": []
        },
        {
          "name": "Read the dealer's address for emailed lists",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/dealers/:id/inbound-email",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dealers",
                ":id",
                "inbound-email"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{dealerId}}",
                  "description": "Xcel dealer id or your own external dealer id."
                }
              ]
            },
            "description": "**The dealer's inbound email address for lists.**\n\nThe address your platform emails the dealer's audience reports to in this key's mode, whether it is on, who may send, the standing orders that take email and any Gmail forwarding confirmation waiting. The address is a secret, shown only to the dealer's own partner. See /docs/standing-orders#emailed-lists.\n\nOpenAPI: `getDealerInboundEmail`, `GET /v1/dealers/{id}/inbound-email`."
          },
          "response": []
        },
        {
          "name": "Start a run (CSV body)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 201\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([201]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "text/csv"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "external_id,first_name,last_name,address1,address2,city,state,zip,vin,vehicle_year,vehicle_make,vehicle_model,service_advisor\ncrm-1001,Maria,Lopez,412 Cedar Ln,,Springfield,IL,62704,1HGCV1F30LA012345,2020,Honda,Accord,Dana\ncrm-1002,JAMES,O'BRIEN,88 Lake Shore Dr,Apt 3B,Chicago,Illinois,60611-2201,,2018,Ford,Escape,\ncrm-1003,Priya,Shah,1200 W Main St,,Peoria,IL,61606,,2022,Toyota,RAV4,Ravi\ncrm-1004,Tom,Nguyen,5 Elm Ct,,Normal,IL,61761,,2019,Chevrolet,Malibu,Dana\ncrm-1005,,Baker,77 Oak St,,Decatur,IL,62521,,2021,Kia,Sorento,\ncrm-1006,Ann,Lee,9 Pine Rd,,Champaign,ZZ,61820,,2017,Nissan,Altima,\ncrm-1007,Maria,Lopez,412 Cedar Lane,,Springfield,IL,62704,,2020,Honda,Accord,Dana\n",
              "options": {
                "raw": {
                  "language": "text"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/standing-orders/:id/runs",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "standing-orders",
                ":id",
                "runs"
              ],
              "query": [
                {
                  "key": "column_map",
                  "value": "",
                  "disabled": true,
                  "description": "A text/csv body only: the column_map as URL-encoded JSON. A JSON body carries it in the body instead."
                },
                {
                  "key": "vehicle_source",
                  "value": "owned",
                  "disabled": true,
                  "description": "A text/csv body only: `vehicle_source`. A JSON body carries it in the body instead."
                }
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{standingOrderId}}",
                  "description": "Standing order id."
                }
              ]
            },
            "description": "**Start a run: turn a list into an order.**\n\nThe run answers its counts and the approval request; in the sandbox `approval.review_url` opens the review page.\n\nSends the list as the audience import takes it (a `text/csv` body with `column_map` and `vehicle_source` in the query, or JSON `{source_url, column_map, vehicle_source}`; `{}` fetches the standing order's own `source_url`), under the same limits and errors. The run removes everyone the standing order mailed within `skip_mailed_within_days` (and everyone its other open runs hold) as `already_mailed`; with nobody left it answers `nothing_to_mail` and makes no campaign. Otherwise it creates a campaign, 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, and answers the run, its counts and the approval request. Nothing prints until the dealer's approver approves. A failed step fails the run and answers that step's error. 409 `standing_order_paused`, `standing_order_ended`, or `standing_order_run_in_progress` while another run builds. The URL is never stored from a run or logged, and the body is never logged.\n\nOpenAPI: `startStandingOrderRun`, `POST /v1/standing-orders/{id}/runs`."
          },
          "response": []
        },
        {
          "name": "List the runs",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/standing-orders/:id/runs",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "standing-orders",
                ":id",
                "runs"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "25",
                  "disabled": true,
                  "description": "Runs per page."
                },
                {
                  "key": "starting_after",
                  "value": "",
                  "disabled": true,
                  "description": "Cursor: `next_cursor` from the previous page, unchanged, with the same filters. Omit for the first page. A cursor from another list, or of a row this list no longer holds, is refused with 400 `invalid_request`: read from the first page."
                }
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{standingOrderId}}",
                  "description": "Standing order id."
                }
              ]
            },
            "description": "**List a standing order's runs.**\n\nEvery run, newest first, a page at a time.\n\nOpenAPI: `listStandingOrderRuns`, `GET /v1/standing-orders/{id}/runs`."
          },
          "response": []
        },
        {
          "name": "Get the standing order",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/standing-orders/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "standing-orders",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{standingOrderId}}",
                  "description": "Standing order id."
                }
              ]
            },
            "description": "**Get a standing order and its last runs.**\n\nThe standing order, its last ten runs and what happens next. Another partner's, another mode's or a dealer outside the key's scope answers 404.\n\nOpenAPI: `getStandingOrder`, `GET /v1/standing-orders/{id}`."
          },
          "response": []
        },
        {
          "name": "List standing orders",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/standing-orders",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "standing-orders"
              ],
              "query": [
                {
                  "key": "dealer_id",
                  "value": "{{dealerId}}",
                  "disabled": true,
                  "description": "Only this dealer's records: the Xcel dealer id or your external dealer id. An unknown dealer is 404 `not_found` with `field: \"dealer_id\"`."
                },
                {
                  "key": "status",
                  "value": "active",
                  "disabled": true,
                  "description": "Only standing orders in this status."
                },
                {
                  "key": "external_id",
                  "value": "",
                  "disabled": true,
                  "description": "Only the standing order with this external_id."
                },
                {
                  "key": "limit",
                  "value": "25",
                  "disabled": true,
                  "description": "Standing orders per page."
                },
                {
                  "key": "starting_after",
                  "value": "",
                  "disabled": true,
                  "description": "Cursor: `next_cursor` from the previous page, unchanged, with the same filters. Omit for the first page. A cursor from another list, or of a row this list no longer holds, is refused with 400 `invalid_request`: read from the first page."
                }
              ]
            },
            "description": "**List standing orders (this key's partner and mode).**\n\nNewest first (created_at, then id), a page at a time, as `GET /v1/campaigns` pages. A key limited to some dealers sees their standing orders only. REST only; no MCP tool.\n\nOpenAPI: `listStandingOrders`, `GET /v1/standing-orders`."
          },
          "response": []
        },
        {
          "name": "Pause the standing order",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Service lapsed 7 to 12 months\",\n  \"status\": \"paused\",\n  \"max_spend_cents\": 50000,\n  \"skip_mailed_within_days\": 90,\n  \"source_url\": \"https://exports.example.com/audiences/lapsed.csv?sig=...\",\n  \"column_map\": {\n    \"customer_id\": \"external_id\",\n    \"lease_maturity_date\": \"lease_end_date\"\n  },\n  \"vehicle_source\": \"serviced\",\n  \"inbound_subject\": \"Birthdays this month\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/v1/standing-orders/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "standing-orders",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{standingOrderId}}",
                  "description": "Standing order id."
                }
              ]
            },
            "description": "**Change, pause or resume a standing order.**\n\nChanges only the fields sent, under the checks create makes; the change applies to the next run, and a run that made its order keeps what it was made with. `status` `paused` stops new runs; `active` starts them again. The dealer, product, mail class and `external_id` are set once. An ended standing order answers 409 `standing_order_ended`.\n\nOpenAPI: `updateStandingOrder`, `PATCH /v1/standing-orders/{id}`."
          },
          "response": []
        },
        {
          "name": "End the standing order",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status is 200\", function () {",
                  "  pm.expect(pm.response.code, pm.response.text().slice(0, 2000)).to.be.oneOf([200]);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/standing-orders/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "standing-orders",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{standingOrderId}}",
                  "description": "Standing order id."
                }
              ]
            },
            "description": "**End a standing order.**\n\nEnds it: no run starts again, its runs and history stay, and a second call answers the same. A run already waiting on its approver goes on; its order then submits only when you submit it.\n\nOpenAPI: `endStandingOrder`, `DELETE /v1/standing-orders/{id}`."
          },
          "response": []
        }
      ]
    }
  ],
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{apiKey}}",
        "type": "string"
      }
    ]
  }
}
