Skip to main content

Direct Mail

This document defines the schema and bucket structure for direct mail integrations with SearchLight. For S3 setup, file format, and access steps see the overview.

Bucket Key Structure

/standard-direct-mail/{account}/{YYYY-MM-DD}/{filename}.json.gz

Example: standard-direct-mail/example-plumber/2026-02-19/direct_mail_bort.json.gz

The date in the path reflects the updatedAt date of the record. If a record is created on 2026-03-10 but updated on 2026-03-15, it should appear in the 2026-03-15 folder. The original record in the 2026-03-10 folder can either be removed or left in place, either is acceptable.


Schema

FieldTypeRequiredDescriptionExample
accountIdnumberrequiredUnique identifier for the account12345
accountNamestringrequiredName of the account"Example Account"
campaignIdstringrequiredUnique identifier for the campaign (or work order)"1111111"
campaignNamestringrequiredName of the campaign"Example Campaign Name"
campaignPhoneNumbersstring[]requiredArray of tracking numbers associated with the campaign["000-000-0000"]
dropDatesstring[] (ISO 8601)requiredArray of dates the mail pieces were dropped for a given campaign["2024-12-09"]
orderQuantityMailednumberrequiredTotal number of mail pieces sent8000
orderTotalCostnumberrequiredTotal cost of the campaign in dollars3200
updatedAtstring (ISO 8601)requiredDate the record was uploaded or last updated"2025-01-01"
orderTotalCostPerPiecenumberoptionalCost per mail piece in dollars0.4

Example Record

{
"accountId": 12345,
"accountName": "Example Account",
"campaignId": "1111111",
"campaignName": "Example Campaign Name",
"campaignPhoneNumbers": ["000-000-0000"],
"updatedAt": "2025-01-01",
"dropDates": ["2024-12-09"],
"orderQuantityMailed": 8000,
"orderTotalCost": 3200,
"orderTotalCostPerPiece": 0.4
}