Update a Letter Draft
update_draftChange the recipient, body, tier or colour of a draft that has not been sent, and re-price it. Returns a new page count and a new quote, so the previous total is void — state the new total to the user before sending. The 6-printed-page maximum applies to the new body as well: a replacement that renders to 7 or more pages is refused and the draft is left as it was. This creates nothing and mails nothing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | A complete US postal address. US domestic addresses only. | |
| tier | No | Which product to buy. Call get_pricing first and pass a tier it lists: standard is a plain First-Class letter. certified, certified_err, proof_of_mailing and registered are other products the current price card may not sell, and a tier it does not sell is refused rather than substituted — so do not describe one to the user until get_pricing has listed it. | |
| colour | No | Omit this. The current price card prints black & white only; true is refused. | |
| draft_id | Yes | The draft_id returned by create_draft. | |
| body_markdown | No | Replaces the whole letter text. It must render to 6 printed pages or fewer — roughly 2,400 words of body text. | |
| from_address_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | Yes | The next call to make. Read it before answering the user. | |
| tier | Yes | The product this draft is priced as, as passed to create_draft or update_draft. | |
| quote | Yes | A priced letter. State total.display to the user before sending, and pass total.amount_cents as confirm_total_cents. | |
| draft_id | Yes | Pass this to preview_draft, update_draft and send_letter. | |
| expires_at | Yes | ISO 8601 instant the draft is deleted. Nothing is charged if it expires. | |
| page_count | Yes | Printed pages, as counted by the renderer. Never more than 6 — a longer body is refused. | |
| tier_title | Yes | What the price card in force calls that product, such as Standard. Use this name when you tell the user what they are buying. | |
| sheet_count | Yes | Sheets of paper this letter is printed on: one page per sheet, one side each, up to 3 pages; a letter of 4 to 6 pages is printed on both sides, so it is never more than 3 sheets. | |
| included_pages | Yes | Printed pages the headline price covers. This draft is priced at that total up to this many pages. |