Raw schema
{
"type": "object",
"properties": {
"documentId": {
"type": "string",
"minLength": 1,
"description": "Template (html_template) or finished letter (pdf) documentId."
},
"name": {
"type": "string",
"maxLength": 255,
"description": "Campaign name (for your records)."
},
"from": {
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 255,
"description": "Full name on the address line"
},
"company": {
"type": "string",
"maxLength": 255
},
"line1": {
"type": "string",
"minLength": 1,
"maxLength": 255,
"description": "Street address line 1"
},
"line2": {
"type": "string",
"maxLength": 255,
"description": "Apartment, suite, or unit (optional)"
},
"city": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"state": {
"type": "string",
"minLength": 2,
"maxLength": 2,
"description": "2-letter US state code, e.g. CA"
},
"zip": {
"type": "string",
"pattern": "^\\d{5}(-\\d{4})?$",
"description": "US ZIP or ZIP+4"
}
},
"required": [
"name",
"line1",
"city",
"state",
"zip"
],
"additionalProperties": false,
"description": "US sender/return address. Required unless the server has a fallback."
},
"recipients": {
"type": "array",
"items": {
"type": "object",
"properties": {
"to": {
"type": "object",
"properties": {
"name": {
"$ref": "#/properties/from/properties/name"
},
"company": {
"$ref": "#/properties/from/properties/company"
},
"line1": {
"$ref": "#/properties/from/properties/line1"
},
"line2": {
"$ref": "#/properties/from/properties/line2"
},
"city": {
"$ref": "#/properties/from/properties/city"
},
"state": {
"$ref": "#/properties/from/properties/state"
},
"zip": {
"$ref": "#/properties/from/properties/zip"
}
},
"required": [
"name",
"line1",
"city",
"state",
"zip"
],
"additionalProperties": false,
"description": "Recipient's US postal address."
},
"mergeVariables": {
"type": "object",
"additionalProperties": {
"anyOf": [
{
"type": "string",
"maxLength": 5000
},
{
"type": "number"
},
{
"type": "boolean"
}
]
},
"propertyNames": {
"minLength": 1,
"maxLength": 255
},
"description": "This recipient's values for the template's {{merge fields}}. Required for template documents; omit for static PDFs."
}
},
"required": [
"to"
],
"additionalProperties": false
},
"minItems": 1,
"maxItems": 500,
"description": "One entry per recipient (1-500)."
},
"options": {
"type": "object",
"properties": {
"color": {
"type": "boolean",
"default": false
},
"doubleSided": {
"type": "boolean",
"default": true
},
"serviceLevel": {
"type": "string",
"enum": [
"economy",
"standard",
"express"
],
"description": "Delivery service level (replaces mailClass)."
},
"mailClass": {
"type": "string",
"enum": [
"usps_first_class",
"usps_standard"
],
"description": "Deprecated USPS mail class alias. Prefer serviceLevel."
},
"extraService": {
"type": "string",
"enum": [
"certified",
"certified_return_receipt",
"registered"
]
},
"useType": {
"type": "string",
"enum": [
"marketing",
"operational"
],
"default": "marketing",
"description": "Accurate use type; bulk sends are typically marketing."
}
},
"additionalProperties": false
},
"payerWallet": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$",
"description": "The x402 wallet that will pay this quote. Must be KYC-verified with PostAgent (re-checked at payment against the wallet that actually signs)."
}
},
"required": [
"documentId",
"recipients",
"payerWallet"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}