create_batch_mail
Create a batch draft from a template link and a recipient list; nothing is charged. template_url is a public https:// link to a PDF at the mail type's size, or to a PNG/JPG postcard graphic that is set on a page at that size (design 4×6 in at 300 dpi = 1200×1800 px). Recipients go inline (an array of {name, line1, line2, city, state, zip}; company accepted) or as recipients_url, a CSV link. Malformed rows and duplicates are skipped and listed, never charged. A one-page postcard gets an address side printed with the return address. Field kits, all optional: every other recipient key (or a nested fields object) is a field, printed by {{tag}} in message or qr.url (fallback: {{tag|text}}) and into PDF form fields of the same name; qr puts a code unique to each piece on it (link opens qr.url, confirm opens a one-button mailbox.bot page, verify proves the recipient gets mail at the address: a QR code plus a short code the person enters where they are signed in, your app via POST /v1/batch-mail/verify with their ref, or read back to the owner for the dashboard; set qr.url to that page and a scan opens it with the code filled in), with scans and confirmations per piece on the batch record and as batch.piece.scanned / batch.piece.confirmed webhooks (a "ref" key on each recipient comes back with them); stock weatherproof, one printed insert (insert_url + insert_stock) and mail_on (a date to mail on) as well. The result carries the exact price, the first recipients and any image warnings. Nothing is charged until the batch is confirmed, and a one-hour proof link shows the template and a sample address label first. Requires the current mailbox_md_version. A key that requires approval saves the draft for the account owner to pay in the dashboard. Postcards from 1 recipient (a $2.00 small-batch fee under 10); letters, flyers and pamphlets from 10; up to 10,000.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"job_name": "<job_name>",
"mail_type": "<mail_type>",
"mailbox_md_version": "<mailbox_md_version>"
},
"name": "create_batch_mail"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| qr | No | Optional: a QR code unique to each piece, https://mailbox.bot/q/<code>. Postcards: on the address side, bottom left. Letters and inserts: bottom right of page 1 (keep about 3 × 1 in clear). Scans store counts and times only. | |
| color | No | Color printing for letters, flyers and pamphlets, charged per color page (postcards are always full color). Default false. | |
| stock | No | standard (default) or weatherproof: tear- and water-resistant synthetic sheets for notices and small signs posted outdoors, letters and flyers only, +85¢ per sheet. | |
| duplex | No | Print both sides of each sheet. Default false. | |
| mail_on | No | Optional date to mail on, YYYY-MM-DD (Pacific time), today to 60 days ahead. The facility mails on or after it. | |
| message | No | Optional text with {{tags}}. On a letter it is the letter itself (Times 12 pt, 1 in margins; send no template_url). On a postcard it prints on the address side mailbox.bot adds, so the template is the front only; the text has to fit once each recipient's fields are filled in. | |
| job_name | Yes | A name the owner will recognise in the dashboard and in emails, e.g. "Spring open house postcards". | |
| mail_type | Yes | postcard_4x6, postcard_6x9, letter (1–3 pages, 6 with duplex), flyer (1 page), pamphlet_light (4–8 pages), pamphlet_heavy (9–16 pages). | |
| column_map | No | For recipients_url only, when the CSV headers are not recognised: field (name, line1, line2, city, state, zip) → the header text in the file. | |
| insert_url | No | Optional public https:// link to one insert sheet (PDF, PNG or JPG, US Letter, 1 or 2 pages) packed with every letter, flyer or pamphlet. Its PDF form fields named like your keys are filled per recipient. | |
| recipients | No | Inline recipients, up to 10,000 (postcards from 1, other types from 10). Skipped rows are reported by position (1 = first). Send this or recipients_url, not both. | |
| return_zip | No | Return ZIP code. | |
| return_city | No | Return city. | |
| return_name | No | Return name. Defaults to the account's saved return address. | |
| insert_stock | No | The insert's stock: paper (+30¢), weatherproof (+95¢) or label_sheet, one full 8.5 × 11 in weatherproof sticker printed on one side (+$1.45). Per piece; letters, flyers and pamphlets only. | |
| return_line1 | No | Return street address. Defaults to the account's saved return address. | |
| return_line2 | No | Return suite or unit. | |
| return_state | No | Return state, 2 letters. | |
| template_url | No | Public https:// link to the template (PDF, PNG or JPG, ≤10 MB). Signed cloud-storage links, CDN and GitHub raw URLs work; links that need a login, private hosts and IP addresses are refused. Required, except for a letter sent as message. | |
| mailing_class | No | first_class (USPS First-Class Mail, 1–5 days, forwarded and returned; the default) or marketing_mail (USPS Marketing Mail, 3–10 days, 200+ recipients; not open until the facility's USPS permit is active). The class is USPS postage, not a description of the content: USPS requires bills, statements and personal correspondence to go first_class. | |
| recipients_url | No | Public https:// link to a recipients CSV (columns name, address, address2, city, state, zip; ≤5 MB). Send this or recipients, not both. | |
| return_company | No | Return company line. | |
| mailbox_md_version | Yes | Current MAILBOX.md version number. Required for agent keys. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes | The draft: batch (status draft, pricing, recipients summary, links.proof), recipients_preview, template (how it was taken), warnings and next_step. |