Create a mailpiece draft
send_mailPrepare (free): Make a draft letter or postcard. You get the itemized price, page images and approval_url. By default, show the person the draft and send them to approval_url to pay. Keep the full private mail_url to check on it later. Reuse idempotency_key only to retry the same draft. Example: {"product":"letter","service":"certified_err","idempotency_key":"unique-draft-key-001","from":{"organization":"Example Sender","line1":"100 Example St","city":"Philadelphia","state":"PA","zip":"19106"},"to":{"organization":"Example Recipient","line1":"200 Example Ave","city":"Philadelphia","state":"PA","zip":"19106"},"document":{"text":"Hello, this is an example letter."}}
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": {
"product": "<product>",
"service": "<service>",
"from": "<from>",
"to": "<to>",
"idempotency_key": "<idempotency_key>"
},
"name": "send_mail"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | ||
| from | Yes | ||
| options | No | ||
| product | Yes | ||
| service | Yes | ||
| document | No | For a letter, provide exactly one of text, pdf_base64 or pdf_url. For a postcard, provide front and back with exactly one source each. The front requires a one-page PDF. | |
| idempotency_key | Yes | Use a unique 16-255 character key and reuse it when retrying. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| to | Yes | ||
| from | Yes | ||
| mode | Yes | ||
| pages | Yes | ||
| proof | Yes | ||
| quote | Yes | ||
| route | Yes | ||
| state | Yes | ||
| object | Yes | ||
| status | Yes | ||
| options | Yes | ||
| payment | Yes | ||
| product | Yes | ||
| service | Yes | ||
| approval | Yes | ||
| mail_url | Yes | ||
| timeline | Yes | ||
| next_step | Yes | ||
| share_url | Yes | ||
| cancelable | Yes | ||
| created_at | Yes | ||
| record_url | Yes | ||
| reprint_of | No | ||
| updated_at | Yes | ||
| drafted_via | Yes | ||
| preview_url | Yes | ||
| receipt_url | Yes | ||
| to_as_given | Yes | ||
| total_cents | Yes | ||
| approval_url | Yes | ||
| cancel_until | Yes | ||
| approval_hash | Yes | ||
| address_status | Yes | ||
| cancel_summary | Yes | ||
| payment_notice | No | ||
| document_sha256 | Yes | ||
| payment_refused | No | ||
| replacement_url | No | ||
| tracking_number | Yes | ||
| possible_duplicate | Yes |