Skip to content
Get startedDashboardSupport

Data Lake Schema

Full schema reference for all database tables available to query via PostGrid's Enhanced Reports feature, including contacts, letters, and more.

All the tables available to query via our enhanced reports feature.

Each heading below is the name of the database table as it should be spelled in your queries.

Every table below except organizations carries an organization column holding the ID of the organization that owns the row. For most organizations that is a single constant value, but if your data lake includes sub-organization data it is how you tell each sub-organization’s rows apart — join it against organizations to label rows with a name. See Querying across sub-organizations.

Contacts you have created, including the from and to addresses on every order.

Contacts marked secret (for example the recipients of seed mail) have their name, address, and other personal fields replaced with *****, matching what the API returns for them.

ColumnTypePKFKDescription
idVARCHARYesPostGrid resource ID (returned on creation; used to retrieve later).
createdAtTIMESTAMPTimestamp when the record was created.
updatedAtTIMESTAMPTimestamp when the record was last updated.
descriptionVARCHARFreeform description for your order/campaign (helps you identify the mailing in the dashboard).
metadataJSONArbitrary key–value JSON attached to the object for analytics/segmentation (size-limited).
organizationVARCHARorganizationsID of the organization that owns the record. Always your own organization ID unless sub-organization data is included in your data lake, in which case sub-organization records carry their own ID. Joins against organizations.
firstNameVARCHAR
lastNameVARCHAR
companyNameVARCHAR
emailVARCHAR
phoneNumberVARCHAR
addressLine1VARCHAR
addressLine2VARCHAR
cityVARCHAR
provinceOrStateVARCHAR
postalOrZipVARCHAR
countryCodeVARCHARISO country code.
addressStatusVARCHAR
addressErrorsJSON
skipVerificationBOOLEAN
forceVerifiedStatusBOOLEAN
mailingListsJSON
addressChangeJSON

One row per letter order.

ColumnTypePKFKDescription
idVARCHARYesPostGrid resource ID (returned on creation; used to retrieve later).
createdAtTIMESTAMPTimestamp when the record was created.
updatedAtTIMESTAMPTimestamp when the record was last updated.
descriptionVARCHARFreeform description for your order/campaign (helps you identify the mailing in the dashboard).
metadataJSONArbitrary key–value JSON attached to the object for analytics/segmentation (size-limited).
organizationVARCHARorganizationsID of the organization that owns the record. Always your own organization ID unless sub-organization data is included in your data lake, in which case sub-organization records carry their own ID. Joins against organizations.
sendDateTIMESTAMPScheduled print date. Defaults to the next business day if omitted.
from_idVARCHARcontactsSender contact ID (foreign key into contacts).
to_idVARCHARcontactsRecipient contact ID (foreign key into contacts).
userVARCHARUser that created the record (dashboard/API).
statusVARCHAROrder status in the delivery pipeline (e.g., ready → printing → processed_for_delivery → completed; cancelled possible).
pageCountINTEGERNumber of pages in the generated mail piece.
trackingNumberVARCHARCarrier tracking number (US orders get a USPS tracking number once processed).
imbStatusVARCHARIntelligent Mail Barcode status (US-only; e.g., entered_mail_stream, out_for_delivery, returned_to_sender).
imbZIPCodeVARCHARZIP code from IMB scan metadata (US-only).
imbDateTIMESTAMPTimestamp of the latest IMB scan (US-only).
expressBOOLEANExpress shipping flag (expedited printing/shipping; extra charge).
mailingClassVARCHARSelected mail class (e.g., First Class vs Standard/Marketing Mail).
mergeVariablesJSONJSON used to populate {{ }} placeholders in templates at render time.
campaignVARCHARCampaign this order belongs to, if it was created as part of one.
cancellationJSONCancellation details (who cancelled and when), if the order was cancelled.
seededFromOrderVARCHARFor seed mail, the ID of the order this seed mailer was generated from.
seedDeliveryInfo_dropDateTIMESTAMPFor seed mail, the date the seed mailer was dropped into the mail stream.
seedDeliveryInfo_arrivalDateTIMESTAMPFor seed mail, the date the seed mailer arrived.
colorBOOLEANWhether the mail piece is printed in colour.
doubleSidedBOOLEANWhether the mail piece is printed on both sides.
addressPlacementVARCHARWhere the recipient address is placed (e.g., top_first_page, insert_blank_page).
envelopeVARCHARReturn envelope resource to include with the mailing, if supplied.
returnEnvelopeVARCHARReturn envelope included with the mailing, if supplied.
sizeVARCHARPrint size/format for this collateral.
paperVARCHARPaper stock used for this collateral (premium papers only).
pdfWorkflowRunVARCHARPDF workflow run applied to the uploaded PDF, if any.

One row per postcard order.

ColumnTypePKFKDescription
idVARCHARYesPostGrid resource ID (returned on creation; used to retrieve later).
createdAtTIMESTAMPTimestamp when the record was created.
updatedAtTIMESTAMPTimestamp when the record was last updated.
descriptionVARCHARFreeform description for your order/campaign (helps you identify the mailing in the dashboard).
metadataJSONArbitrary key–value JSON attached to the object for analytics/segmentation (size-limited).
organizationVARCHARorganizationsID of the organization that owns the record. Always your own organization ID unless sub-organization data is included in your data lake, in which case sub-organization records carry their own ID. Joins against organizations.
sendDateTIMESTAMPScheduled print date. Defaults to the next business day if omitted.
from_idVARCHARcontactsSender contact ID (foreign key into contacts).
to_idVARCHARcontactsRecipient contact ID (foreign key into contacts).
userVARCHARUser that created the record (dashboard/API).
statusVARCHAROrder status in the delivery pipeline (e.g., ready → printing → processed_for_delivery → completed; cancelled possible).
pageCountINTEGERNumber of pages in the generated mail piece.
trackingNumberVARCHARCarrier tracking number (US orders get a USPS tracking number once processed).
imbStatusVARCHARIntelligent Mail Barcode status (US-only; e.g., entered_mail_stream, out_for_delivery, returned_to_sender).
imbZIPCodeVARCHARZIP code from IMB scan metadata (US-only).
imbDateTIMESTAMPTimestamp of the latest IMB scan (US-only).
expressBOOLEANExpress shipping flag (expedited printing/shipping; extra charge).
mailingClassVARCHARSelected mail class (e.g., First Class vs Standard/Marketing Mail).
mergeVariablesJSONJSON used to populate {{ }} placeholders in templates at render time.
campaignVARCHARCampaign this order belongs to, if it was created as part of one.
cancellationJSONCancellation details (who cancelled and when), if the order was cancelled.
seededFromOrderVARCHARFor seed mail, the ID of the order this seed mailer was generated from.
seedDeliveryInfo_dropDateTIMESTAMPFor seed mail, the date the seed mailer was dropped into the mail stream.
seedDeliveryInfo_arrivalDateTIMESTAMPFor seed mail, the date the seed mailer arrived.
sizeVARCHARPrint size/format for this collateral.
paperVARCHARPaper stock used for this collateral (premium papers only).

One row per cheque order.

ColumnTypePKFKDescription
idVARCHARYesPostGrid resource ID (returned on creation; used to retrieve later).
createdAtTIMESTAMPTimestamp when the record was created.
updatedAtTIMESTAMPTimestamp when the record was last updated.
descriptionVARCHARFreeform description for your order/campaign (helps you identify the mailing in the dashboard).
metadataJSONArbitrary key–value JSON attached to the object for analytics/segmentation (size-limited).
organizationVARCHARorganizationsID of the organization that owns the record. Always your own organization ID unless sub-organization data is included in your data lake, in which case sub-organization records carry their own ID. Joins against organizations.
sendDateTIMESTAMPScheduled print date. Defaults to the next business day if omitted.
from_idVARCHARcontactsSender contact ID (foreign key into contacts).
to_idVARCHARcontactsRecipient contact ID (foreign key into contacts).
userVARCHARUser that created the record (dashboard/API).
statusVARCHAROrder status in the delivery pipeline (e.g., ready → printing → processed_for_delivery → completed; cancelled possible).
pageCountINTEGERNumber of pages in the generated mail piece.
trackingNumberVARCHARCarrier tracking number (US orders get a USPS tracking number once processed).
imbStatusVARCHARIntelligent Mail Barcode status (US-only; e.g., entered_mail_stream, out_for_delivery, returned_to_sender).
imbZIPCodeVARCHARZIP code from IMB scan metadata (US-only).
imbDateTIMESTAMPTimestamp of the latest IMB scan (US-only).
expressBOOLEANExpress shipping flag (expedited printing/shipping; extra charge).
mailingClassVARCHARSelected mail class (e.g., First Class vs Standard/Marketing Mail).
mergeVariablesJSONJSON used to populate {{ }} placeholders in templates at render time.
campaignVARCHARCampaign this order belongs to, if it was created as part of one.
cancellationJSONCancellation details (who cancelled and when), if the order was cancelled.
sizeVARCHARPrint size/format for this collateral.
bankAccountVARCHARBank account used to issue the cheque.
amountINTEGERCheque amount.
currencyCodeVARCHARISO currency code for the cheque (e.g., USD, CAD).
envelopeVARCHARReturn envelope resource to include with the mailing, if supplied.
digitalOnlyJSONDigital-only cheque delivery details (recipient email and delivery state), if the cheque was sent digitally.

One row per self-mailer order.

ColumnTypePKFKDescription
idVARCHARYesPostGrid resource ID (returned on creation; used to retrieve later).
createdAtTIMESTAMPTimestamp when the record was created.
updatedAtTIMESTAMPTimestamp when the record was last updated.
descriptionVARCHARFreeform description for your order/campaign (helps you identify the mailing in the dashboard).
metadataJSONArbitrary key–value JSON attached to the object for analytics/segmentation (size-limited).
organizationVARCHARorganizationsID of the organization that owns the record. Always your own organization ID unless sub-organization data is included in your data lake, in which case sub-organization records carry their own ID. Joins against organizations.
sendDateTIMESTAMPScheduled print date. Defaults to the next business day if omitted.
from_idVARCHARcontactsSender contact ID (foreign key into contacts).
to_idVARCHARcontactsRecipient contact ID (foreign key into contacts).
userVARCHARUser that created the record (dashboard/API).
statusVARCHAROrder status in the delivery pipeline (e.g., ready → printing → processed_for_delivery → completed; cancelled possible).
pageCountINTEGERNumber of pages in the generated mail piece.
trackingNumberVARCHARCarrier tracking number (US orders get a USPS tracking number once processed).
imbStatusVARCHARIntelligent Mail Barcode status (US-only; e.g., entered_mail_stream, out_for_delivery, returned_to_sender).
imbZIPCodeVARCHARZIP code from IMB scan metadata (US-only).
imbDateTIMESTAMPTimestamp of the latest IMB scan (US-only).
expressBOOLEANExpress shipping flag (expedited printing/shipping; extra charge).
mailingClassVARCHARSelected mail class (e.g., First Class vs Standard/Marketing Mail).
mergeVariablesJSONJSON used to populate {{ }} placeholders in templates at render time.
campaignVARCHARCampaign this order belongs to, if it was created as part of one.
cancellationJSONCancellation details (who cancelled and when), if the order was cancelled.
sizeVARCHARPrint size/format for this collateral.
paperVARCHARPaper stock used for this collateral (premium papers only).

One row per snap-pack order.

ColumnTypePKFKDescription
idVARCHARYesPostGrid resource ID (returned on creation; used to retrieve later).
createdAtTIMESTAMPTimestamp when the record was created.
updatedAtTIMESTAMPTimestamp when the record was last updated.
descriptionVARCHARFreeform description for your order/campaign (helps you identify the mailing in the dashboard).
metadataJSONArbitrary key–value JSON attached to the object for analytics/segmentation (size-limited).
organizationVARCHARorganizationsID of the organization that owns the record. Always your own organization ID unless sub-organization data is included in your data lake, in which case sub-organization records carry their own ID. Joins against organizations.
sendDateTIMESTAMPScheduled print date. Defaults to the next business day if omitted.
from_idVARCHARcontactsSender contact ID (foreign key into contacts).
to_idVARCHARcontactsRecipient contact ID (foreign key into contacts).
userVARCHARUser that created the record (dashboard/API).
statusVARCHAROrder status in the delivery pipeline (e.g., ready → printing → processed_for_delivery → completed; cancelled possible).
pageCountINTEGERNumber of pages in the generated mail piece.
trackingNumberVARCHARCarrier tracking number (US orders get a USPS tracking number once processed).
imbStatusVARCHARIntelligent Mail Barcode status (US-only; e.g., entered_mail_stream, out_for_delivery, returned_to_sender).
imbZIPCodeVARCHARZIP code from IMB scan metadata (US-only).
imbDateTIMESTAMPTimestamp of the latest IMB scan (US-only).
expressBOOLEANExpress shipping flag (expedited printing/shipping; extra charge).
mailingClassVARCHARSelected mail class (e.g., First Class vs Standard/Marketing Mail).
mergeVariablesJSONJSON used to populate {{ }} placeholders in templates at render time.
campaignVARCHARCampaign this order belongs to, if it was created as part of one.
cancellationJSONCancellation details (who cancelled and when), if the order was cancelled.
sizeVARCHARPrint size/format for this collateral.

One row per visit to a QR code or PURL tracker.

ColumnTypePKFKDescription
idVARCHARYesPostGrid resource ID (returned on creation; used to retrieve later).
createdAtTIMESTAMPTimestamp when the record was created.
updatedAtTIMESTAMPTimestamp when the record was last updated.
descriptionVARCHARFreeform description for your order/campaign (helps you identify the mailing in the dashboard).
metadataJSONArbitrary key–value JSON attached to the object for analytics/segmentation (size-limited).
organizationVARCHARorganizationsID of the organization that owns the record. Always your own organization ID unless sub-organization data is included in your data lake, in which case sub-organization records carry their own ID. Joins against organizations.
trackerVARCHARTracker ID (QR code / PURL definition) that generated this visit.
orderIDVARCHAROrder ID (letter/postcard/cheque/self-mailer) associated with this tracker visit.
deviceVARCHARDevice classification captured for the visit (e.g., mobile/desktop).
ipAddressVARCHARVisitor IP captured for the visit.

One row per document you have uploaded.

ColumnTypePKFKDescription
idVARCHARYesPostGrid resource ID (returned on creation; used to retrieve later).
createdAtTIMESTAMPTimestamp when the record was created.
updatedAtTIMESTAMPTimestamp when the record was last updated.
descriptionVARCHARFreeform description for your order/campaign (helps you identify the mailing in the dashboard).
metadataJSONArbitrary key–value JSON attached to the object for analytics/segmentation (size-limited).
organizationVARCHARorganizationsID of the organization that owns the record. Always your own organization ID unless sub-organization data is included in your data lake, in which case sub-organization records carry their own ID. Joins against organizations.

One row per virtual mailbox.

ColumnTypePKFKDescription
idVARCHARYesPostGrid resource ID (returned on creation; used to retrieve later).
createdAtTIMESTAMPTimestamp when the record was created.
updatedAtTIMESTAMPTimestamp when the record was last updated.
descriptionVARCHARFreeform description for your order/campaign (helps you identify the mailing in the dashboard).
metadataJSONArbitrary key–value JSON attached to the object for analytics/segmentation (size-limited).
organizationVARCHARorganizationsID of the organization that owns the record. Always your own organization ID unless sub-organization data is included in your data lake, in which case sub-organization records carry their own ID. Joins against organizations.
nameVARCHARName of the virtual mailbox.
statusVARCHARProvisioning status of the virtual mailbox.
capabilitiesJSONWhat the mailbox can do (e.g., scanning, forwarding).
countryCodeVARCHARISO country code of the mailbox address.

One row per piece of mail received in a virtual mailbox.

ColumnTypePKFKDescription
idVARCHARYesPostGrid resource ID (returned on creation; used to retrieve later).
createdAtTIMESTAMPTimestamp when the record was created.
updatedAtTIMESTAMPTimestamp when the record was last updated.
descriptionVARCHARFreeform description for your order/campaign (helps you identify the mailing in the dashboard).
metadataJSONArbitrary key–value JSON attached to the object for analytics/segmentation (size-limited).
organizationVARCHARorganizationsID of the organization that owns the record. Always your own organization ID unless sub-organization data is included in your data lake, in which case sub-organization records carry their own ID. Joins against organizations.
virtualMailboxVARCHARvirtualmailboxesVirtual mailbox this item arrived in (foreign key into virtualmailboxes).
matchedLetterVARCHARlettersLetter this returned item was matched back to, if any (foreign key into letters).
returnReasonVARCHARWhy the mail piece came back (e.g., undeliverable, moved).

Your organization, plus every sub-organization whose data is included in your data lake. Join it on the organization column of any other table to label rows with the organization that owns them — see Querying across sub-organizations.

ColumnTypePKFKDescription
idVARCHARYesOrganization ID. Matches the organization column on every other table.
nameVARCHAROrganization name, as shown in the dashboard.
updatedAtTIMESTAMPTimestamp when the organization was last updated.