> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usehatchapp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Bulk Export Schema Overview

> Column-level definitions for the contact_history, contact_history_v2, conversation_items, leads and attributions datasets.

Each dataset below is requested by its `data_source` name through the
[Bulk Export API](https://docs.usehatchapp.com/integrations/hatch-api/bulk-export/overview.md). The
**filter column** is the timestamp the API applies your date range to; the
**row key** uniquely identifies a row for upserts.

## Contact history

Two versions of this dataset are available. Use `contact_history_v2` if your
organization uses ServiceTitan, otherwise use `contact_history`.

> [tab] contact\_history\_v2
>
> Version 2, currently available only to organizations using ServiceTitan.
> One row per campaign enrollment event. Filter column `updated_at`; row key
> `contact_history_id`; two years of history.
>
> > [accordion] Fields
> >
> > | Field | Description |
> > | - | - |
> > | `organization_id` | Organization ID tied to the record. |
> > | `organization_name` | Friendly organization name. |
> > | `workspace_id` | Unique workspace identifier. |
> > | `workspace_name` | Workspace name. |
> > | `contact_history_id` | Unique identifier for the row. Row key. |
> > | `campaign_id` | Campaign identifier in Hatch. Empty when `campaign_stage` is `manual_sale`. |
> > | `campaign_name` | Campaign name. Empty when `campaign_stage` is `manual_sale`. |
> > | `current_lead_source` | Source currently assigned to the contact. |
> > | `hatch_contact_id` | Unique contact ID from Hatch. |
> > | `contact_status` | Campaign engagement status (`in progress`, `replied`, `no reply`, `no-reply`, `canceled`). Empty when `campaign_stage` is `manual_sale`. Definitions below. |
> > | `campaign_stage` | The event this row records: `launch`, `reply`, `appointment`, `sale` or `manual_sale`. |
> > | `sales_value` | Sold estimate amount when `campaign_stage` is `sale`, the entered amount when it is `manual_sale`; `0` for all other values. |
> > | `opted_out` | The email address or phone number that opted out, if any; otherwise null. |
> > | `email` | Contact email. |
> > | `phone` | Contact phone number. |
> > | `updated_at` | When the event in `campaign_stage` happened. **Filter column.** |
> > | `external_contact_id` | CRM-based customer or contact id from the integrated CRM or lead source. Empty when `campaign_stage` is `manual_sale`. |
> > | `appointment_id` | ServiceTitan appointment ID for the enrollment's appointment, carried on every row of that enrollment. Empty when there is no appointment, and when `campaign_stage` is `manual_sale`. |
> > | `source_id` | CRM job number for select integrations; otherwise null. |
> > | `invoice_id` | ServiceTitan estimate ID for the enrollment's sale, carried on every row of that enrollment. Empty when there is no sale, and when `campaign_stage` is `manual_sale`. |
> >
> > > [!NOTE]
> > >
> > > **Contact status definitions.** Hatch calculates `contact_status` values as campaigns progress. Use these labels to group performance inside your BI tools.
> > >
> > > * **in progress**: The contact is actively moving through automated steps and can still receive follow-ups.
> > > * **no reply** / **no-reply**: Automation completed without a response from the contact.
> > > * **replied**: The contact responded, so the automation ended and the conversation moved to your team.
> > > * **canceled**: The contact was removed due to rules (invalid info, opt-out, competing campaign, etc.).

> [tab] contact\_history
>
> Version 1 of the contact history dataset. One row per campaign enrollment
> event. Filter column `updated_at`; row key `contact_history_id`; one year
> of history.
>
> > [accordion] Fields
> >
> > | Field | Description |
> > | - | - |
> > | `organization_id` | Organization ID tied to the record. |
> > | `organization_name` | Friendly organization name. |
> > | `workspace_id` | Unique workspace identifier. |
> > | `workspace_name` | Workspace name. |
> > | `contact_history_id` | Unique identifier for the row. Row key. |
> > | `campaign_id` | Campaign identifier in Hatch. Empty when `campaign_stage` is `manual_sale`. |
> > | `campaign_name` | Campaign name. Empty when `campaign_stage` is `manual_sale`. |
> > | `current_lead_source` | Source currently assigned to the contact (e.g., `integration:salesforce`). |
> > | `hatch_contact_id` | Unique contact ID from Hatch. |
> > | `contact_status` | Campaign engagement status (`in progress`, `replied`, `no reply`, `no-reply`, `canceled`). Empty when `campaign_stage` is `manual_sale`. Definitions below. |
> > | `campaign_stage` | The event this row records: `launch`, `reply`, `appointment`, `sale` or `manual_sale`. |
> > | `sales_value` | Sale amount when `campaign_stage` is `sale` or `manual_sale`; `0` for all other values. |
> > | `opted_out` | The email address or phone number that opted out, if any; otherwise null. |
> > | `email` | Contact email. |
> > | `phone` | Contact phone number. |
> > | `updated_at` | When the event in `campaign_stage` happened. **Filter column.** |
> > | `external_contact_id` | CRM-based customer or contact id from the integrated CRM or lead source. (See below.) |
> > | `appointment_id` | CRM-based appointment ID from integrated sources. (See below.) |
> > | `source_id` | CRM job number for select integrations; otherwise null. |
> > | `invoice_id` | CRM-based invoice, estimate or sale ID from integrated sources. (See below.) |
> >
> > > [!NOTE]
> > >
> > > **Contact status definitions.** Hatch calculates `contact_status` values as campaigns progress. Use these labels to group performance inside your BI tools.
> > >
> > > * **in progress**: The contact is actively moving through automated steps and can still receive follow-ups.
> > > * **no reply** / **no-reply**: Automation completed without a response from the contact.
> > > * **replied**: The contact responded, so the automation ended and the conversation moved to your team.
> > > * **canceled**: The contact was removed due to rules (invalid info, opt-out, competing campaign, etc.).

## conversation\_items

Available to all organizations. One row per message or call. Filter column
`updated_at`; row key `id`; full history.

> [accordion] Fields
>
> | Field | Description |
> | - | - |
> | `organization_id` | Organization ID tied to the conversation. |
> | `organization_name` | Organization name. |
> | `workspace_id` | Workspace ID. |
> | `workspace_name` | Workspace name. |
> | `id` | Unique identifier for the conversation item. Row key. |
> | `conversation_id` | Conversation identifier. |
> | `contact_id` | Contact identifier for the participant. |
> | `board_id` | Board the conversation belongs to. |
> | `actor_type` | Who sent the item: `contact`, a Hatch user, a campaign, or the Hatch AI assistant. |
> | `actor_id` | Unique ID for the actor (user, contact, campaign or bot). |
> | `category` | Item category (for example `message`). |
> | `type` | Channel of the item: `sms`, `email`, `voicecall`, `voicemaildrop`, etc. |
> | `direction` | `inbound` (from the contact) or `outbound` (sent by Hatch). |
> | `title` | Item title. Null for SMS. |
> | `body` | Message body text (if applicable). |
> | `delivery_status` | Latest delivery status from the provider. |
> | `status_history` | Serialized status change history for troubleshooting delivery failures. |
> | `chatbot_disposition` | The disposition a chatbot applied to the overall conversation (same for each conversation item). |
> | `call_duration` | Duration in seconds. Populated only for completed voice calls. |
> | `send_at` | Scheduled send time for delayed/scheduled messages. |
> | `display_at` | When the item was displayed in the conversation. |
> | `is_scheduled` | Indicates whether the item was scheduled. |
> | `provider_name` | External provider handling delivery (e.g., Twilio). |
> | `provider_message_id` | Provider-specific identifier for the message. |
> | `mongo_id` | Unique database source identifier. |
> | `updated_at` | When the item was created in Hatch. Later delivery-status changes do not move it. **Filter column.** |

## leads

Available to all organizations. One row per lead. Filter column `updated_at`;
row key `lead_id`; two years of history. The `booked`, `booked_at` and
`appointment_id` fields are currently populated only for organizations using
ServiceTitan.

> [accordion] Fields
>
> | Field | Type | Description |
> | - | - | - |
> | `lead_id` | string | Hatch identifier for the lead. Row key. |
> | `external_lead_id` | string | Lead identifier supplied by the lead source. For custom sources posted through the Hatch API this is the `externalID` you sent. Which sources populate it is configured by Hatch for your organization. |
> | `external_contact_id` | string | Contact or customer id in the external system, when provided. |
> | `external_created_at` | timestamp | Creation time in the external system, when provided. |
> | `received_at` | timestamp | When Hatch received the lead. |
> | `organization_id` | string | Hatch organization identifier. |
> | `organization_name` | string | Hatch organization name. |
> | `department_id` | string | Hatch department identifier. |
> | `department_name` | string | Hatch department name. |
> | `contact_id` | string | Hatch contact the lead belongs to. |
> | `contact_name` | string | Contact name as received on the lead. |
> | `contact_email` | string | Contact email as received on the lead. |
> | `contact_phone` | string | Contact phone as received on the lead. |
> | `appointment_id` | string | Identifier of the CRM appointment behind `booked_at`. |
> | `lead_source_original` | string | Source label the lead arrived under, kept for the life of the lead. |
> | `service_type` | string | Service requested, taken from source fields configured by Hatch for your organization; null when the source carries none. |
> | `status` | string | Opportunity status as received from the source; null when not provided. |
> | `updated_at` | timestamp | Last change to the lead or to any of its lifecycle fields. **Filter column.** |
> | `is_primary_lead` | boolean | True on one row in each duplicate group. Count leads where this is true. |
> | `duplicate_group_id` | string | Shared by rows Hatch identifies as the same enquiry, for example the same contact arriving through two sources on the same day. |
> | `was_enrolled` | boolean | Whether the contact entered a Hatch campaign during this lead's window. |
> | `enrolled_at` | timestamp | When the contact first entered a Hatch campaign during this lead's window. |
> | `first_outbound_at` | timestamp | First outbound Hatch communication to the contact across all of the contact's leads, not limited to this lead's window. |
> | `engaged` | boolean | Whether the contact replied (inbound SMS, email, voice call or voicemail). |
> | `engaged_at` | timestamp | When the contact first replied during this lead's window. Null when `engaged` is false. |
> | `booked` | boolean | Whether a CRM appointment was created for the contact during this lead's window, regardless of how it was booked, including appointments later cancelled. |
> | `booked_at` | timestamp | Creation time of that appointment. Null when `booked` is false. |

## attributions

Currently available only to organizations using ServiceTitan. One row per appointment or sale
attributed to a Hatch campaign or agent. An outcome attributed to both a
campaign and an agent appears twice, once per `touch_origin`. Filter column
`event_at`; row key `attribution_id`; full history. A *touch* is the Hatch
message or call that received credit for the outcome.

> [accordion] Fields
>
> | Field | Description |
> | - | - |
> | `attribution_id` | Unique identifier for the attribution. Row key. |
> | `external_contact_id` | CRM-based customer or contact id from the integrated CRM or lead source. |
> | `organization_id` | Unique identifier for the organization. |
> | `organization_name` | Friendly organization name. |
> | `department_id` | Unique identifier for the department. |
> | `department_name` | Department name. |
> | `workspace_id` | Unique identifier for the workspace of the touch. |
> | `workspace_name` | Workspace name. |
> | `contact_id` | Unique contact ID from Hatch. |
> | `contact_name` | Contact name. |
> | `contact_email` | Contact email. |
> | `contact_phone` | Contact phone number. |
> | `event_type` | Type of event: `appointment` or `sale`. |
> | `event_id` | CRM-based appointment or sale ID from integrated sources. |
> | `event_at` | When the appointment was created or the sale was closed. **Filter column.** |
> | `revenue` | Sale amount associated with the event. Null on appointment rows. |
> | `job_id` | CRM-based job ID from integrated sources. |
> | `campaign_id` | Unique identifier for the campaign in Hatch. Populated when `touch_origin` is `campaign`. |
> | `campaign_name` | Campaign name. |
> | `agent_id` | Unique identifier for the agent in Hatch. Populated when `touch_origin` is `agent`. |
> | `conversation_id` | Unique identifier for the conversation. |
> | `touch_id` | Unique identifier for the touch (conversation item). |
> | `touch_origin` | Origin of the touch: `campaign` or `agent`. |
> | `touch_ts` | Timestamp of the touch. |
> | `touch_channel` | Channel of the touch: `sms`, `email`, `voicecall` or `voicemaildrop`. |
> | `seconds_before_event` | Number of seconds between the touch and the event. |
> | `attribution_window_seconds` | Attribution window, in seconds, applied to this touch. |
> | `attribution_window_scope_level` | Level the attribution window was configured at: `campaign`, `agent`, `workspace`, `organization` or `global`. |

> [card] [Bulk Export API Overview](https://docs.usehatchapp.com/integrations/hatch-api/bulk-export/overview.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.