Use this when the user wants to write a new paper letter from text and post it, for example to cancel a contract, subscription or membership by letter, file a complaint or objection, or send a formal notice, by ordinary or registered mail. Renders an A4 letter (DIN 5008 layout: sender block with the user's own name and address, recipient, place and date, subject, body, closing, signature) that passes the print check, and creates a draft with the exact price. Nothing is sent or charged: show the user the draft and the total, ask for confirmation, then call send_letter. The sender can live in any country. For the account's first letter the sender block must carry the user's REAL full name (first and last name, no alias, nickname or pseudonym) and postal address: it is then saved as the account's sender details; without valid ones the call fails with SENDER_DETAILS_REQUIRED. Once the account has sender details, the sender block is printed as given and the saved details stay as they are (sender_details: on_file when the block matches them, kept when it differs): the user changes them in Settings → Your details. Body supports paragraphs (blank line), '- ' bullets, '1. ' lists and **bold**. Needs the user's account.
View input schema
{
"type": "object",
"properties": {
"sender": {
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 60,
"description": "The user's full name: their REAL first and last name, not an alias, nickname or pseudonym, e.g. Anna Schmidt."
},
"company": {
"description": "The user's company or organisation, e.g. Example GmbH. Optional.",
"type": "string",
"maxLength": 60
},
"line1": {
"type": "string",
"minLength": 1,
"maxLength": 60,
"description": "Street and house number, or PO box, e.g. Hauptstraße 5."
},
"line2": {
"description": "Optional extra address line: c/o, apartment, floor or building, e.g. Apt 4B.",
"type": "string",
"maxLength": 60
},
"postal_code": {
"description": "Postcode / ZIP code, e.g. 10115 or 94105. Required in countries that use postcodes.",
"type": "string",
"maxLength": 16
},
"city": {
"type": "string",
"minLength": 1,
"maxLength": 50,
"description": "City or town, e.g. Berlin."
},
"region": {
"description": "State, province or region where the user's country has one in addresses, e.g. CA (California, US), ON (Ontario, CA) or Madrid (ES). Required for addresses in AE, AS, AU, BR, CA, CN, CO, CR, ES, FM, HK, HN, ID, IN, IQ, IT, JM, JP, KN, KR, KY, MH, MP, MX, NR, PF, PG, PW, RU, SO, SV, TW, US, VE, VI, VN when this block is saved as the user's sender details (an account without them yet: SENDER_DETAILS_REQUIRED, fields.region); otherwise optional.",
"type": "string",
"maxLength": 50
},
"country": {
"type": "string",
"minLength": 2,
"maxLength": 2,
"description": "Country as an ISO 3166-1 alpha-2 code, e.g. DE, FR or US."
},
"email": {
"description": "The user's email address, printed in the sender block, e.g. max@example.com. Optional.",
"type": "string",
"format": "email",
"pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
},
"phone": {
"description": "The user's phone number, printed in the sender block, e.g. +49 30 1234567. Optional.",
"type": "string",
"maxLength": 40
}
},
"required": [
"name",
"line1",
"city",
"country"
],
"description": "The user's own name and address (any country), printed in the letter's sender block. Use the user's REAL full name, not an alias, nickname or pseudonym: for an account without sender details yet, this block is checked and saved as them; once the account has them, they stay as they are. The user's saved sender details (name and postal address) are printed at the top left of the envelope after \"Sent on behalf of:\" (their company name and business address instead, if the account has business details); undeliverable letters are returned to that address."
},
"recipient": {
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 60,
"description": "Recipient's name: a person, or a department such as Customer Service when writing to a company, e.g. Erika Mustermann."
},
"company": {
"description": "Recipient's company or organisation, e.g. Example GmbH. Optional.",
"type": "string",
"maxLength": 60
},
"line1": {
"type": "string",
"minLength": 1,
"maxLength": 60,
"description": "Street and house number, or PO box, e.g. Hauptstraße 5."
},
"line2": {
"description": "Optional extra address line: c/o, apartment, floor or building, e.g. Apt 4B.",
"type": "string",
"maxLength": 60
},
"postal_code": {
"description": "Postcode / ZIP code, e.g. 10115 or 94105. Required in countries that use postcodes.",
"type": "string",
"maxLength": 16
},
"city": {
"type": "string",
"minLength": 1,
"maxLength": 50,
"description": "City or town, e.g. Berlin."
},
"region": {
"description": "State, province or region. Required for recipients in AE, AS, AU, BR, CA, CN, CO, CR, ES, FM, HK, HN, ID, IN, IQ, IT, JM, JP, KN, KR, KY, MH, MP, MX, NR, PF, PG, PW, RU, SO, SV, TW, US, VE, VI, VN (without it the draft is refused: INVALID_ADDRESS, fields.region); omit where addresses have none, e.g. DE, FR or GB. The code in US, CA, AU and BR, e.g. CA (California) or ON (Ontario); elsewhere the name or its usual abbreviation, e.g. Madrid (ES) or RM (Rome, IT).",
"type": "string",
"maxLength": 50
},
"country": {
"type": "string",
"minLength": 2,
"maxLength": 2,
"description": "Country as an ISO 3166-1 alpha-2 code, e.g. DE, FR or US."
}
},
"required": [
"name",
"line1",
"city",
"country"
],
"description": "Recipient's postal address, printed in the letter's address field and on the envelope. Ask the user for missing fields."
},
"subject": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "Subject line printed above the body, e.g. Cancellation of my contract no. 12345 (up to 200 characters)."
},
"body": {
"type": "string",
"minLength": 1,
"maxLength": 20000,
"description": "Letter text including the salutation (e.g. 'Dear Sir or Madam,'), without closing or signature. Blank line = new paragraph; '- ' bullets, '1. ' numbered lists and **bold** work. Up to 20,000 characters."
},
"language": {
"default": "en",
"description": "Language of the letter as an ISO 639-1 code, e.g. en, de, fr, es, pt, it or nl; sets the date format and the default closing. Default \"en\".",
"type": "string",
"minLength": 2,
"maxLength": 5
},
"place": {
"description": "Place printed before the date, usually the user's city, e.g. Berlin. Optional.",
"type": "string",
"maxLength": 60
},
"date": {
"description": "Date of the letter as an ISO date (YYYY-MM-DD), e.g. 2026-10-08. Default: today.",
"type": "string"
},
"closing": {
"description": "Closing phrase, e.g. 'Kind regards'. Default: the usual closing in the letter's language.",
"type": "string",
"maxLength": 200
},
"signature": {
"description": "Name printed under the closing, e.g. Max Mustermann. Default: the sender's name.",
"type": "string",
"maxLength": 80
},
"references": {
"description": "Up to 5 reference lines printed above the subject, e.g. [\"Customer no. 12345\", \"Contract no. 987\"]. Optional.",
"maxItems": 5,
"type": "array",
"items": {
"type": "string",
"maxLength": 120
}
},
"duplex": {
"default": false,
"description": "true = print on both sides of the paper (fewer sheets, so a lighter letter); false = one side only. Default false.",
"type": "boolean"
},
"color": {
"default": "bw",
"description": "\"bw\" = black and white, \"color\" = colour printing (costs more per page). Default \"bw\".",
"type": "string",
"enum": [
"bw",
"color"
]
},
"envelope": {
"description": "\"DL\" (220×110 mm, letter folded twice), \"C5\" (229×162 mm, folded once) or \"C4\" (324×229 mm, flat). Omit to use the smallest envelope that holds the sheets (recommended); one too small for the page count is refused.",
"type": "string",
"enum": [
"DL",
"C5",
"C4"
]
},
"registered": {
"default": false,
"description": "true = registered mail: tracking number and signature on delivery, for an extra fee (also what \"certified\" letters, Einschreiben, lettre recommandée and carta certificada mean here; not a US certified-mail product). false = ordinary mail. Default false. Often wanted for cancellations and deadlines.",
"type": "boolean"
}
},
"required": [
"sender",
"recipient",
"subject",
"body"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}