Getting started
- Introduction
- Working with our API
Assets
- Overview
- Assets
- Asset Versions
List letters
Retrieve a list of letters with optional pagination.
curl --request GET \
--url https://api.posta.co/letters \
--header 'X-Api-Key: <api-key>'
{
"items": [
{
"id": "ltr_9a32a8b5a96c880c",
"status": "queued",
"externalId": "0013i00002YyVvSAAV",
"sendDate": "2023-12-25",
"description": "Compliance notice",
"sender": {
"individual": {
"fullName": "TODO",
"prefix": "TODO",
"firstName": "TODO",
"middleName": "TODO",
"lastName": "TODO",
"postfix": "TODO",
"title": "TODO"
},
"organization": "Veezla, Inc.",
"address": {
"addressLine1": "1900 Reston Metro Plz",
"addressLine2": "Ste 600",
"lastLine": "Reston, VA 20194-5952"
},
"addressComponents": {
"cassType": "none",
"urbanization": "TODO",
"city": "TODO",
"state": "TODO",
"zipCode": "TODO",
"plus4Code": "TODO"
},
"addressAnalysis": {
"dpvMatchCode": "TODO",
"dpvFootnotes": [
"TODO"
],
"dpvCmra": "TODO",
"dpvVacant": "TODO",
"dpvNoStat": "TODO",
"dpvActive": "TODO",
"dpvInactiveReason": "TODO",
"dpvThrowback": "TODO",
"dpvNonDeliveryDayIndicator": "TODO",
"dpvNonDeliveryDayValues": "TODO",
"dpvNoSecureLocation": "TODO",
"dpvDoorNotAccessible": "TODO",
"lacslinkCode": "TODO",
"lacslinkIndicator": "TODO",
"suitelinkIndicator": "TODO",
"ewsIndicator": true
},
"addressCorrections": [
{
"name": "TODO",
"input": "TODO",
"corrected": "TODO"
}
],
"addressMetadata": {
"recordType": "TODO",
"addressType": "TODO",
"zipCodeType": "TODO",
"county": "TODO",
"countyFips": "TODO",
"carrierRoute": "TODO",
"carrierRouteType": "TODO",
"congressionalDistrict": "TODO",
"defaultBuildingAddress": true,
"elotSequence": "TODO",
"elotSort": "TODO",
"latitude": 0,
"longitude": 0,
"precision": "TODO",
"uspsFinanceNumber": "TODO",
"timeZone": "TODO"
}
},
"recipient": {
"nonAddressData": "<string>",
"individual": {
"fullName": "TODO",
"prefix": "TODO",
"firstName": "TODO",
"middleName": "TODO",
"lastName": "TODO",
"postfix": "TODO",
"title": "TODO"
},
"organization": "Posta Customer, Inc.",
"address": {
"addressLine1": "1900 Reston Metro Plz",
"addressLine2": "Ste 600",
"lastLine": "Reston, VA 20194-5952"
},
"addressComponents": {
"cassType": "none",
"urbanization": "TODO",
"city": "TODO",
"state": "TODO",
"zipCode": "TODO",
"plus4Code": "TODO"
},
"addressAnalysis": {
"dpvMatchCode": "TODO",
"dpvFootnotes": [
"TODO"
],
"dpvCmra": "TODO",
"dpvVacant": "TODO",
"dpvNoStat": "TODO",
"dpvActive": "TODO",
"dpvInactiveReason": "TODO",
"dpvThrowback": "TODO",
"dpvNonDeliveryDayIndicator": "TODO",
"dpvNonDeliveryDayValues": "TODO",
"dpvNoSecureLocation": "TODO",
"dpvDoorNotAccessible": "TODO",
"lacslinkCode": "TODO",
"lacslinkIndicator": "TODO",
"suitelinkIndicator": "TODO",
"ewsIndicator": true
},
"addressCorrections": [
{
"name": "TODO",
"input": "TODO",
"corrected": "TODO"
}
],
"addressMetadata": {
"recordType": "TODO",
"addressType": "TODO",
"zipCodeType": "TODO",
"county": "TODO",
"countyFips": "TODO",
"carrierRoute": "TODO",
"carrierRouteType": "TODO",
"congressionalDistrict": "TODO",
"defaultBuildingAddress": true,
"elotSequence": "TODO",
"elotSort": "TODO",
"latitude": 0,
"longitude": 0,
"precision": "TODO",
"uspsFinanceNumber": "TODO",
"timeZone": "TODO"
}
},
"content": {
"type": "asset",
"assetId": "ast_1234567890abcdef",
"assetVersionId": "astv_1234567890abcdef"
},
"url": "https://api.posta.co/letters/ltr_9a32a8b5a96c880c/download",
"variables": [
{
"name": "customerName",
"value": "John Doe"
}
],
"options": {
"print": {
"color": true
},
"mail": {
"service": "firstClass",
"extraServices": [
"acs"
]
},
"variableHandling": {
"validationScope": "asset"
},
"addressProcessing": {
"cassSender": {
"type": "basic",
"casing": "proper"
},
"cassRecipient": {
"type": "basic",
"casing": "proper"
},
"ncoaRecipient": "newAddress"
},
"deliverabilityThreshold": "normal",
"deliverabilityValues": [
"deliverable"
]
},
"useType": "marketing",
"events": [
{
"id": "evt_1234567890abcdef",
"timestamp": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"modifiedAt": "2023-11-07T05:31:56Z",
"type": "tracking",
"status": "inTransit",
"description": "TODO",
"operationCode": "TODO",
"actionRequired": true,
"trackingEventDetails": {
"notes": "TODO",
"facility": "TODO",
"facilityType": "TODO",
"facilityZip": "TODO",
"additionalData": {}
},
"location": "TODO"
}
],
"issueMessage": "Recipient address could not be validated",
"metadata": [
{
"key": "salesforceId",
"value": "0013i00002YyVvSAAV"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"modifiedAt": "2023-11-07T05:31:56Z"
}
],
"nextToken": "<string>"
}
Authorizations
Query Parameters
Include CASS processing details in the response.
The number of items to return per page. The maximum pageSize
is 100 items.
A cursor for the next page of results.
Response
Array of items for the current page.
A letter.
A unique identifier for the letter, prefixed with ltr_. Use this ID to retrieve, update, or delete the letter.
1 - 99999
"ltr_9a32a8b5a96c880c"
Represents the current status of a letter in the mailing process:
queued
: Awaiting processingready
: Processed and ready for printinginProduction
: Being printed and prepared for mailingmailed
: Handed off to postal service for deliveryissue
: Problem that needs addressingcanceled
: Letter will not be mailed
queued
, ready
, inProduction
, mailed
, issue
, canceled
"queued"
An object containing the sender's information for the letter. It must include:
Either an individual
object, an organization
string, or both.
- If
individual
is provided, it can contain either afullName
string or name components (at minimumfirstName
andlastName
). - If only name components are provided, they will be used in the order specified in our API for addressing.
- If both
fullName
and name components are provided,fullName
will be used for addressing.
An address
object with the sender's complete address details.
This information is used to populate the return address on the letter. Ensure all provided details are accurate to facilitate any potential return mail handling.
Address information for sender or recipient.
First line of the address.
1 - 99999
"1900 Reston Metro Plz"
Second line of the address, if applicable.
99999
"Ste 600"
Generated by us, used as the last line for postal addressing. Typically city, state, and ZIP code combined.
99999
"Reston, VA 20194-5952"
Name of the individual, if applicable. Must be 40 characters or less.
The full name of the individual.
99999
"TODO"
The name prefix (e.g., Mr., Mrs., Dr.).
99999
"TODO"
The first name (given name) of the individual.
99999
"TODO"
The middle name of the individual.
99999
"TODO"
The last name (family name) of the individual.
99999
"TODO"
The name suffix (e.g., Jr., Sr., III).
99999
"TODO"
The professional or honorary title of the individual.
99999
"TODO"
Name of the organization, if applicable. Must be 40 characters or less.
99999
"Veezla, Inc."
Parsed components of the sender's address.
none
Urbanization name
99999
"TODO"
City name
99999
"TODO"
State abbreviation
99999
"TODO"
5-digit ZIP code
99999
"TODO"
ZIP+4 code
99999
"TODO"
Analysis of the sender's address.
DPV (Delivery Point Validation) match code
99999
"TODO"
DPV footnotes
["TODO"]
DPV CMRA indicator
99999
"TODO"
DPV vacant indicator
99999
"TODO"
DPV no-stat indicator
99999
"TODO"
DPV active indicator
99999
"TODO"
DPV inactive reason
99999
"TODO"
DPV throwback indicator
99999
"TODO"
DPV non-delivery day indicator
99999
"TODO"
DPV non-delivery day values
99999
"TODO"
DPV no secure location indicator
99999
"TODO"
DPV door not accessible indicator
99999
"TODO"
LACSLink code
99999
"TODO"
LACSLink indicator
99999
"TODO"
SuiteLink indicator
99999
"TODO"
Early Warning System indicator
Corrections made to the sender's address.
Represents a correction made to an address component
Name of the corrected address field
1 - 99999
"TODO"
Input value before correction
99999
"TODO"
Corrected value
99999
"TODO"
Metadata about the sender's address.
Type of record
99999
"TODO"
Type of address
99999
"TODO"
Type of ZIP code
99999
"TODO"
County name
99999
"TODO"
County FIPS code
99999
"TODO"
Carrier route
99999
"TODO"
Type of carrier route
99999
"TODO"
Congressional district
99999
"TODO"
Indicates if this is the default building address
eLOT sequence number
99999
"TODO"
eLOT sort
99999
"TODO"
Latitude coordinate
-90 <= x <= 90
0
Longitude coordinate
-180 <= x <= 180
0
Precision of the geocode
99999
"TODO"
USPS finance number
99999
"TODO"
Time zone of the address
99999
"TODO"
Recipient information for the letter. Either individual or organization is required; both can be provided. For accurate NCOA processing, provide name components when available.
Address information for sender or recipient.
First line of the address.
1 - 99999
"1900 Reston Metro Plz"
Second line of the address, if applicable.
99999
"Ste 600"
Generated by us, used as the last line for postal addressing. Typically city, state, and ZIP code combined.
99999
"Reston, VA 20194-5952"
Additional non-address data for the recipient. It will be printed as the first line of the recipient information. Must be 40 characters or less.s Eg. Private & Confidential
.
99999
Name of the individual, if applicable. Must be 40 characters or less.
The full name of the individual.
99999
"TODO"
The name prefix (e.g., Mr., Mrs., Dr.).
99999
"TODO"
The first name (given name) of the individual.
99999
"TODO"
The middle name of the individual.
99999
"TODO"
The last name (family name) of the individual.
99999
"TODO"
The name suffix (e.g., Jr., Sr., III).
99999
"TODO"
The professional or honorary title of the individual.
99999
"TODO"
Name of the organization, if applicable. Must be 40 characters or less.
99999
"Posta Customer, Inc."
Parsed components of the recipient's address.
none
Urbanization name
99999
"TODO"
City name
99999
"TODO"
State abbreviation
99999
"TODO"
5-digit ZIP code
99999
"TODO"
ZIP+4 code
99999
"TODO"
Analysis of the recipient's address.
DPV (Delivery Point Validation) match code
99999
"TODO"
DPV footnotes
["TODO"]
DPV CMRA indicator
99999
"TODO"
DPV vacant indicator
99999
"TODO"
DPV no-stat indicator
99999
"TODO"
DPV active indicator
99999
"TODO"
DPV inactive reason
99999
"TODO"
DPV throwback indicator
99999
"TODO"
DPV non-delivery day indicator
99999
"TODO"
DPV non-delivery day values
99999
"TODO"
DPV no secure location indicator
99999
"TODO"
DPV door not accessible indicator
99999
"TODO"
LACSLink code
99999
"TODO"
LACSLink indicator
99999
"TODO"
SuiteLink indicator
99999
"TODO"
Early Warning System indicator
Corrections made to the recipient's address.
Represents a correction made to an address component
Name of the corrected address field
1 - 99999
"TODO"
Input value before correction
99999
"TODO"
Corrected value
99999
"TODO"
Metadata about the recipient's address.
Type of record
99999
"TODO"
Type of address
99999
"TODO"
Type of ZIP code
99999
"TODO"
County name
99999
"TODO"
County FIPS code
99999
"TODO"
Carrier route
99999
"TODO"
Type of carrier route
99999
"TODO"
Congressional district
99999
"TODO"
Indicates if this is the default building address
eLOT sequence number
99999
"TODO"
eLOT sort
99999
"TODO"
Latitude coordinate
-90 <= x <= 90
0
Longitude coordinate
-180 <= x <= 180
0
Precision of the geocode
99999
"TODO"
USPS finance number
99999
"TODO"
Time zone of the address
99999
"TODO"
Content of the letter.
asset
Identifier of the asset used for the letter's content.
"ast_1234567890abcdef"
Identifier of the asset version used for the letter's content.
"astv_1234567890abcdef"
Indicates the letter's purpose: 'marketing' or 'transactional'. Affects eligibility for USPS promotions and sales tax compliance.
marketing
, transactional
"marketing"
Array of events in the letter's lifecycle.
Represents a lifecycle event for a letter.
Unique identifier for the event.
"evt_1234567890abcdef"
The timestamp the resource was created at (UTC).
The timestamp the resource was last modified at (UTC).
tracking
The status of the tracking event.
inTransit
, delivered
, exception
, outForDelivery
, returnedToSender
Detailed information about the tracking event.
Additional notes about the tracking event.
"TODO"
The postal facility where the event occurred.
"TODO"
The type of postal facility.
"TODO"
The ZIP code of the facility.
"TODO"
The timestamp when the event occurred.
Description of the tracking event.
"TODO"
Operation code associated with the tracking event.
"TODO"
Indicates if any action is required based on this event.
The location where the event occurred, if applicable.
"TODO"
The timestamp the resource was created at (UTC).
The timestamp the resource was last modified at (UTC).
Optional client-defined identifier for referencing this letter in external systems. Not used by Posta for processing.
99999
"0013i00002YyVvSAAV"
Specifies the Send Date in ISO 8601 format (YYYY-MM-DD). Time portion, if provided, is ignored.
If omitted:
- SLA begins after the daily cutoff and we auto-assign a date based on our SLA:
- Before cutoff: Earliest production date (e.g., same day if sent 9 am Tuesday).
- After cutoff: Next production date (e.g., next day if sent 11 am Tuesday).
- Non-production day: Next production date.
If specified:
- Must be between current date and 180 days in future.
- If specified date is a production day, value remains as-is.
- If not a production day, next production day is assigned.
Daily cutoff: 10 am ET on production days (Monday - Friday, exluding national holidays)
Note: All letters are cancelable on or before the Send Date's daily cutoff.
Example: 2023-08-15
Optional description for internal reference. Does not affect processing or delievery.
99999
"Compliance notice"
Temporary URL to download the rendered letter PDF. Expires after a set period.
99999
"https://api.posta.co/letters/ltr_9a32a8b5a96c880c/download"
Key-value pairs for personalizing letter content when using handlebars in HTML content.
Represents a variable with a name and optional value for dynamic personalization.
Customization options for letter production and delivery, including:
- Printing preferences (e.g., color, simplex/duplex)
- Mailing preferences (e.g., mail class, extra services)
- Data processing preferences (e.g., CASS, NCOA)
- Other preferences
Defaults apply if not specified. See Option
documentation for details.
Note: Some options may affect pricing or production time.
Print options for the letter.
Whether to print the letter in color or black and white.
true
Mail options for the letter.
Mailing service to use for the letter. We currently support firstClass
only.
firstClass
"firstClass"
Additional services for firstClass
mail. We will offer support for ACS and Secure Destruction soon, currently no extra services available.
Additional mailing services that can be applied to letters.
acs
, secureDestruction
["acs"]
Variable handling options for the letter.
Defines the scope to validate the requested variables against.
none
: The requested variable will not be evaluated.asset
: The requested variable will be evaluated against the Variable Definitions of the published version of the Asset. If the requested variables are missing a defined variable on the Asset or if they contain an extra variable not defined on the Asset, the rendering will fail. Furthermore, all parameters of the Variable Definition will be evaluated.
For detailed examples and edge cases on how behavior
, allowEmpty
, and presetValue
interact, see the Assets Overview in our API reference.
none
, asset
"asset"
Address processing options for the letter.
CASS options for address processing.
Indicates the level of CASS processing to be applied to the address.
none
, basic
, full
"basic"
Specifies the casing style to be used for the address after CASS processing.
proper
, upper
, original
"proper"
Indicates the type of CASS processing to be applied to the recipient's address. Values can be: none
, basic
, full
.
none
, basic
, full
"basic"
Specifies the casing style to be used for the address after CASS processing.
proper
, upper
, original
"proper"
NCOA handling preferences for the recipient's address.
newAddress
, oldAddress
, doNotSend
"newAddress"
Deliverability threshold for the letter.
none
, normal
, strict
"normal"
You can speficy explicit deliverability values as a threashold insteead of our presets. The letter will only be send when the recipient's address' deliverability is among the specified values.
The deliverability status of an address
deliverable
, deliverableUnnecessaryUnit
, deliverableIncorrectUnit
, deliverableMissingUnit
, undeliverable
Human-readable description of any issues encountered with the letter.
99999
"Recipient address could not be validated"
A key-value store for custom metadata.
Limitations:
- Up to 20 metadata key-value pairs
- Key must be no more than 64 characters
- Value must be no more than 512 characters
A cursor for the next page of results.
curl --request GET \
--url https://api.posta.co/letters \
--header 'X-Api-Key: <api-key>'
{
"items": [
{
"id": "ltr_9a32a8b5a96c880c",
"status": "queued",
"externalId": "0013i00002YyVvSAAV",
"sendDate": "2023-12-25",
"description": "Compliance notice",
"sender": {
"individual": {
"fullName": "TODO",
"prefix": "TODO",
"firstName": "TODO",
"middleName": "TODO",
"lastName": "TODO",
"postfix": "TODO",
"title": "TODO"
},
"organization": "Veezla, Inc.",
"address": {
"addressLine1": "1900 Reston Metro Plz",
"addressLine2": "Ste 600",
"lastLine": "Reston, VA 20194-5952"
},
"addressComponents": {
"cassType": "none",
"urbanization": "TODO",
"city": "TODO",
"state": "TODO",
"zipCode": "TODO",
"plus4Code": "TODO"
},
"addressAnalysis": {
"dpvMatchCode": "TODO",
"dpvFootnotes": [
"TODO"
],
"dpvCmra": "TODO",
"dpvVacant": "TODO",
"dpvNoStat": "TODO",
"dpvActive": "TODO",
"dpvInactiveReason": "TODO",
"dpvThrowback": "TODO",
"dpvNonDeliveryDayIndicator": "TODO",
"dpvNonDeliveryDayValues": "TODO",
"dpvNoSecureLocation": "TODO",
"dpvDoorNotAccessible": "TODO",
"lacslinkCode": "TODO",
"lacslinkIndicator": "TODO",
"suitelinkIndicator": "TODO",
"ewsIndicator": true
},
"addressCorrections": [
{
"name": "TODO",
"input": "TODO",
"corrected": "TODO"
}
],
"addressMetadata": {
"recordType": "TODO",
"addressType": "TODO",
"zipCodeType": "TODO",
"county": "TODO",
"countyFips": "TODO",
"carrierRoute": "TODO",
"carrierRouteType": "TODO",
"congressionalDistrict": "TODO",
"defaultBuildingAddress": true,
"elotSequence": "TODO",
"elotSort": "TODO",
"latitude": 0,
"longitude": 0,
"precision": "TODO",
"uspsFinanceNumber": "TODO",
"timeZone": "TODO"
}
},
"recipient": {
"nonAddressData": "<string>",
"individual": {
"fullName": "TODO",
"prefix": "TODO",
"firstName": "TODO",
"middleName": "TODO",
"lastName": "TODO",
"postfix": "TODO",
"title": "TODO"
},
"organization": "Posta Customer, Inc.",
"address": {
"addressLine1": "1900 Reston Metro Plz",
"addressLine2": "Ste 600",
"lastLine": "Reston, VA 20194-5952"
},
"addressComponents": {
"cassType": "none",
"urbanization": "TODO",
"city": "TODO",
"state": "TODO",
"zipCode": "TODO",
"plus4Code": "TODO"
},
"addressAnalysis": {
"dpvMatchCode": "TODO",
"dpvFootnotes": [
"TODO"
],
"dpvCmra": "TODO",
"dpvVacant": "TODO",
"dpvNoStat": "TODO",
"dpvActive": "TODO",
"dpvInactiveReason": "TODO",
"dpvThrowback": "TODO",
"dpvNonDeliveryDayIndicator": "TODO",
"dpvNonDeliveryDayValues": "TODO",
"dpvNoSecureLocation": "TODO",
"dpvDoorNotAccessible": "TODO",
"lacslinkCode": "TODO",
"lacslinkIndicator": "TODO",
"suitelinkIndicator": "TODO",
"ewsIndicator": true
},
"addressCorrections": [
{
"name": "TODO",
"input": "TODO",
"corrected": "TODO"
}
],
"addressMetadata": {
"recordType": "TODO",
"addressType": "TODO",
"zipCodeType": "TODO",
"county": "TODO",
"countyFips": "TODO",
"carrierRoute": "TODO",
"carrierRouteType": "TODO",
"congressionalDistrict": "TODO",
"defaultBuildingAddress": true,
"elotSequence": "TODO",
"elotSort": "TODO",
"latitude": 0,
"longitude": 0,
"precision": "TODO",
"uspsFinanceNumber": "TODO",
"timeZone": "TODO"
}
},
"content": {
"type": "asset",
"assetId": "ast_1234567890abcdef",
"assetVersionId": "astv_1234567890abcdef"
},
"url": "https://api.posta.co/letters/ltr_9a32a8b5a96c880c/download",
"variables": [
{
"name": "customerName",
"value": "John Doe"
}
],
"options": {
"print": {
"color": true
},
"mail": {
"service": "firstClass",
"extraServices": [
"acs"
]
},
"variableHandling": {
"validationScope": "asset"
},
"addressProcessing": {
"cassSender": {
"type": "basic",
"casing": "proper"
},
"cassRecipient": {
"type": "basic",
"casing": "proper"
},
"ncoaRecipient": "newAddress"
},
"deliverabilityThreshold": "normal",
"deliverabilityValues": [
"deliverable"
]
},
"useType": "marketing",
"events": [
{
"id": "evt_1234567890abcdef",
"timestamp": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"modifiedAt": "2023-11-07T05:31:56Z",
"type": "tracking",
"status": "inTransit",
"description": "TODO",
"operationCode": "TODO",
"actionRequired": true,
"trackingEventDetails": {
"notes": "TODO",
"facility": "TODO",
"facilityType": "TODO",
"facilityZip": "TODO",
"additionalData": {}
},
"location": "TODO"
}
],
"issueMessage": "Recipient address could not be validated",
"metadata": [
{
"key": "salesforceId",
"value": "0013i00002YyVvSAAV"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"modifiedAt": "2023-11-07T05:31:56Z"
}
],
"nextToken": "<string>"
}