Table: hubspot_contact - Query HubSpot Contacts using SQL
HubSpot Contacts is a resource within the HubSpot CRM that provides a comprehensive view of all interactions with a particular contact. It includes information such as contact details, communication history, and any associated deals or tasks. This resource helps businesses to maintain a centralized, up-to-date record of all contact interactions, enabling personalized and targeted communication strategies.
Table Usage Guide
The hubspot_contact
table provides insights into contact details and interactions within HubSpot CRM. As a Sales or Marketing professional, explore contact-specific details through this table, including communication history, associated deals, and tasks. Utilize it to uncover information about contacts, such as their engagement with your business, their preferences, and the effectiveness of your communication strategies.
Examples
Basic info
Explore which contacts have been archived in your Hubspot database. This can help you identify instances where contact details may need to be updated or restored, providing a practical tool for maintaining your contact list.
select id, created_at, archived, email, firstname, lastnamefrom hubspot_contact;
select id, created_at, archived, email, firstname, lastnamefrom hubspot_contact;
List all archived contacts
Explore which contacts have been archived in your Hubspot account. This can be useful for cleaning up your contact list or identifying potential leads that have been overlooked.
select id, created_at, archived, email, firstname, lastnamefrom hubspot_contactwhere archived;
select id, created_at, archived, email, firstname, lastnamefrom hubspot_contactwhere archived = 1;
List contacts created in the last 30 days
Determine the contacts that have been added within the past month. This allows you to keep track of recent additions to your network and ensure you are staying up-to-date with new connections.
select id, created_at, archived, email, firstname, lastnamefrom hubspot_contactwhere created_at > now() - interval '30 days';
select id, created_at, archived, email, firstname, lastnamefrom hubspot_contactwhere created_at > datetime('now', '-30 days');
List contacts from Queensland
Explore which contacts are based in Queensland to target marketing campaigns more effectively. This helps in personalizing communication and improving customer engagement.
select id, created_at, archived, email, firstname, lastnamefrom hubspot_contactwhere state = 'QLD';
select id, created_at, archived, email, firstname, lastnamefrom hubspot_contactwhere state = 'QLD';
List lead contacts
Discover the segments that consist of lead contacts in your Hubspot account. This query is useful in identifying prospective customers for targeted marketing or sales follow-ups.
select id, created_at, archived, email, firstname, lastnamefrom hubspot_contactwhere lifecyclestage = 'lead';
select id, created_at, archived, email, firstname, lastnamefrom hubspot_contactwhere lifecyclestage = 'lead';
List contacts that have never closed any deal
Determine the areas in which contacts have not yet successfully closed any deals. This can be useful for identifying potential opportunities for engagement or training needs.
select id, created_at, archived, email, firstname, lastnamefrom hubspot_contactwhere recent_deal_close_date is null;
select id, created_at, archived, email, firstname, lastnamefrom hubspot_contactwhere recent_deal_close_date is null;
List contacts who are Salespersons
Explore which contacts in your database are designated as Salespersons. This can be beneficial in identifying potential leads or understanding your interaction with this specific job role.
select id, created_at, archived, email, firstname, lastnamefrom hubspot_contactwhere jobtitle = 'Salesperson';
select id, created_at, archived, email, firstname, lastnamefrom hubspot_contactwhere jobtitle = 'Salesperson';
Schema for hubspot_contact
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | |
archived | boolean | = | Indicates whether the contact is archived or not. |
archived_at | timestamp with time zone | The timestamp when the contact was archived. | |
created_at | timestamp with time zone | The timestamp when the contact was created. | |
id | text | = | The unique ID of the contact. |
title | text | Title of the resource. | |
updated_at | timestamp with time zone | The timestamp when the contact was last updated. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- hubspot
You can pass the configuration to the command with the --config
argument:
steampipe_export_hubspot --config '<your_config>' hubspot_contact