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-id}/{YYYY-MM-DD}/{filename}.json.gz

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

{account-id} is your internal identifier for the location: the id your own system uses (e.g. pk7f3q9x2m or 48211). Use it as-is and keep it stable for the life of the integration.

The date in the path reflects the updated_at 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
idstringrequiredUnique identifier for the job record"12345"
account_namestringrequiredName of the account"Example Account"
location_namestringrequiredName of the business location the job was for"Jim's HVAC"
campaign_namestringrequiredName of the campaign"Example Campaign Name"
campaign_phone_numbersstring[]requiredArray of tracking numbers associated with the job's campaign["000-000-0000"]
drop_datesstring[] (ISO 8601)requiredArray of dates the mail pieces were dropped for a given job["2024-12-09"]
order_quantity_mailednumberrequiredTotal number of mail pieces sent8000
order_total_costnumberrequiredTotal cost of the job in dollars3200
updated_atstring (ISO 8601)requiredDate the record was uploaded or last updated"2025-01-01"
order_total_cost_per_piecenumberoptionalCost per mail piece in dollars0.4

Example Record

{
"id": "12345",
"account_name": "Example Account",
"location_name": "Jim's HVAC",
"campaign_name": "Example Campaign Name",
"campaign_phone_numbers": ["000-000-0000"],
"updated_at": "2025-01-01",
"drop_dates": ["2024-12-09"],
"order_quantity_mailed": 8000,
"order_total_cost": 3200,
"order_total_cost_per_piece": 0.4
}