JDBC Driver for HubSpot

Build 26.0.9770

Leads

Lists all lead records available in HubSpot, supporting lead management workflows.

Table Specific Information

In HubSpot, leads are contacts or companies that are potential customers.

SELECT

When selecting leads, they can be filtered by columns marked below as 'Filterable'. For those columns, the supported server-side operators are: =, !=, <, <=, >, >=, IN

Further filtering is available using AND and OR combinations. A maximum of 3 OR operators are supported server-side, with each of these operators supporting up to 3 AND operators inside of them. For example:

SELECT * FROM Leads;
SELECT * FROM Leads WHERE [Id] = '385815394826';
SELECT * FROM Leads WHERE [Workflow updated lifecycle stage of company] = true OR [Associated Company Domain] = 'http://HubTest.com';

In the below server-offloading examples, "{Column}" represents any column you'd like to filter and "{Value}" represents any value you want to filter it on:

SELECT * FROM Leads WHERE {Column} = {Value} AND {Column} < {Value} AND {Column} > {Value}
SELECT * FROM Leads WHERE {Column} != {Value} AND {Column} >= {Value} AND {Column} <= {Value}
SELECT * FROM Leads WHERE ({Column} = {Value} AND {Column} = {Value}) OR ({Column} != {Value} AND {Column} >= {Value})
SELECT * FROM Leads WHERE ({Column} != {Value} AND {Column} >= {Value} AND {Column} <= {Value}) OR ({Column} != {Value} AND {Column} >= {Value} AND {Column} <= {Value}) OR ({Column} != {Value} AND {Column} >= {Value} AND {Column} <= {Value})

INSERT

When creating Leads, either the 'Primary Associated Contact Object ID' column or the 'Primary Associated Company Object ID' column (these names can change based on UseDisplayNames and UseSimpleNames) must be specified in the INSERT statement, otherwise the query will fail. For example:

INSERT INTO Leads (`Lead Name`, `Primary Associated Contact Object ID`) VALUES ('Inserted Lead 1', 31501492998);
INSERT INTO Leads (`Lead Name`, `Primary Associated Company Object ID`) VALUES ('Inserted Lead 1', 21960329051);
INSERT INTO Leads (`Lead Name`, `Primary Associated Contact Object ID`, `Primary Associated Company Object ID`) VALUES ('Inserted Lead 1', 31501492998, 21960329051);

The same applies for bulk INSERTs:

INSERT INTO Leads#TEMP (`Lead Name`, `Primary Associated Contact Object ID`) VALUES ('Inserted Lead 1', 31501492998);
INSERT INTO Leads#TEMP (`Lead Name`, `Primary Associated Contact Object ID`) VALUES ('Inserted Lead 1', 31501492998);
INSERT INTO Leads#TEMP (`Lead Name`, `Primary Associated Contact Object ID`) VALUES ('Inserted Lead 1', 31501492998);
INSERT INTO Leads (`Lead Name`, `Primary Associated Contact Object ID`) SELECT * FROM Leads#TEMP;

UPDATE


UPDATE Leads SET [Business units] = '10' WHERE [Id] = '3917882265'
UPDATE Leads SET [Lead Disqualification Note] = 'testing note', [Disqualification Reason] = 'BAD_TIMING' WHERE [Id] = '386085073667'

DELETE


DELETE FROM Leads WHERE ID = '3917882265'

Columns

Name Type ReadOnly References Filterable Description
Id [KEY] Long True True

Unique identifier assigned to each lead record in HubSpot.

Archived Bool True False

Indicates whether the lead record has been archived and is no longer active.

CreatedAt Datetime True False

Timestamp marking when the lead record was first created.

UpdatedAt Datetime True False

Timestamp marking when the lead record was most recently updated.

All teams String True False

List of all team IDs, including hierarchical teams, associated with the ownership properties for this lead.

Business units String False False

Business units assigned to the lead for organizational categorization and reporting.

All owner ids String True False

List of all owner user IDs associated with the lead, covering both default and custom owner properties.

All team ids String True False

List of team IDs associated with all owner properties of the lead, excluding hierarchy.

Associated Company Domain String True True

Domain name of the company associated with the lead, if available.

Associated Company Name String True True

Company name linked to the lead, if available.

Associated Contact Email String True True

Email address of the primary contact associated with the lead, if available.

Associated Contact First Name String True True

First name of the primary contact associated with the lead, if available.

Associated Contact Last Name String True True

Last name of the primary contact associated with the lead, if available.

Calls Connected Count String True True

Total number of calls made to the lead that resulted in a successful connection.

Primary company analytics source String True True

Most recent analytics source from the primary associated company at the time the company was linked to the lead. This value does not update after creation.

Primary company analytics source first drilldown String True True

First level of analytics source detail for the primary company associated with the lead. This value does not update after creation.

Primary company analytics source second drilldown String True True

Second level of analytics source detail for the primary company associated with the lead. This value does not update after creation.

Company Avatar FileManager key String True False

Path to the custom avatar image of the associated company, stored in HubSpot's FileManager.

Is Target Account String True True

Indicates whether the associated company is flagged as a target account for marketing or sales purposes.

Company Last Activity Date Datetime True True

Most recent activity date recorded for the primary associated company.

Company Last Engagement Date Datetime True True

Most recent tracked engagement by a contact at the associated company. Excludes marketing emails and bulk communications.

Company Last Engagement Type String True False

Type of the last tracked engagement performed by a contact at the associated company. Excludes marketing and mass emails.

Company Time of Last Session Datetime True True

Timestamp for the most recent web session attributed to any contacts associated with the primary company.

Company Next Activity Date Datetime True True

Scheduled date of the next activity associated with the primary company.

Company Next Activity Type String True False

Type of the next scheduled activity related to the primary associated company.

Company Number of Pageviews String True True

Total number of website pageviews from all contacts linked to the primary associated company.

Associated company timezone String True True

Timezone of the primary associated company, if available.

Primary contact analytics source String True True

Most recent analytics source from the primary contact at the time of association with the lead. This value does not update after creation.

Primary contact analytics source first drilldown String True True

First level of analytics source detail from the primary contact associated with the lead. This value does not update after creation.

Primary contact analytics source second drilldown String True True

Second level of analytics source detail from the primary contact associated with the lead. This value does not update after creation.

Contact Avatar FileManager key String True False

Path to the custom avatar image of the associated contact, stored in HubSpot's FileManager.

Contact Buying Role String True True

Role of the associated contact in the buying or decision-making process.

Associated contact job title String True True

Job title of the associated contact, if available.

Contact Last Activity Date Datetime True True

Date of the last recorded activity performed by the associated contact.

Contact Last Engagement Date Datetime True True

Date the contact last engaged with your website or tracked interactions. Excludes marketing emails and bulk communications.

Contact Last Engagement Type String True False

Type of last engagement performed by the contact, excluding marketing and mass emails.

Contact Time of Last Session Datetime True True

Timestamp of the most recent website session initiated by the lead's primary contact.

Contact Next Activity Date Datetime True True

Scheduled date of the next activity planned for the lead's primary contact.

Contact Next Activity Type String True False

Type of the next scheduled activity for the primary contact, such as a call or meeting.

Contact Number of Pageviews String True True

Total number of website pageviews recorded for the lead's primary contact.

Associated contact timezone String True True

Timezone of the primary associated contact, if available.

Created by user ID Decimal True True

HubSpot user ID of the individual who created the lead record. Automatically assigned by HubSpot.

Object create date/time Datetime True True

Date and time when the lead object was created in HubSpot. Automatically generated.

Emails Connected Count String True True

Number of email interactions with the lead that resulted in a successful connection.

Initial Assign Notification State String True False

Status indicating whether an initial assignment notification was sent when the lead was created.

Last Activity Date Datetime True True

Most recent activity date for the lead, defaulting to the associated contact if available, otherwise the associated company.

Last Engagement Date Datetime True True

Most recent engagement date for the lead, based on either the primary contact or associated company.

Last Engagement Type String True False

Type of last engagement for the lead, prioritizing the primary contact, or otherwise the associated company.

Lead Time of Last Session Datetime True True

Timestamp of the last recorded session by the primary associated contact or, if unavailable, the associated company.

Object last modified date/time Datetime True True

Most recent timestamp of any update made to the lead object, including internal property changes.

Associated Deal Pipeline Stage String True False

Sales pipeline stage of the primary associated deal linked to the lead.

Associated deals Decimal True True

Total number of deals associated with the lead.

Call Count Decimal True True

Total number of calls logged against the lead.

Closed won deal amount Decimal True True

Total monetary value of all closed-won deals associated with the lead.

Message Thread Count Decimal True True

Total number of message threads (such as SMS, LinkedIn, or WhatsApp) involving the lead.

Currency String True False

Currency code associated with the most recent deal linked to the lead.

Lead Disqualification Note String False True

Free-text note explaining why the lead was disqualified.

Disqualification Reason String False False

Dropdown field listing the reason for lead disqualification.

Email Count Decimal True True

Total number of emails sent to the lead.

First Outreach Date Datetime True True

Date of the first recorded outreach (such as a call, email, or meeting) initiated toward the lead.

Lead Inferred Pseudostage String True True

Inferred lead pipeline pseudostage based on the lead's activities and interactions.

Is Disqualified Decimal True True

Flag indicating whether the lead is disqualified (1 = yes, 0 = no). Used for internal reporting.

In progress leads Decimal True True

Flag indicating whether the lead is actively being worked on (1 = yes, 0 = no). Used for reporting.

Is New Decimal True True

Flag indicating whether the lead is newly created (1 = yes, 0 = no). Used internally for reporting.

Open leads Decimal True True

Indicates whether the lead is in an open stage, meaning not yet qualified or disqualified.

Is Qualified Decimal True True

Flag indicating whether the lead has been qualified (1 = yes, 0 = no). Used for reporting purposes.

Lead Label String False False

Current sales status label assigned to the lead.

Meeting Count Decimal True True

Total number of meetings booked with the lead.

Lead Name String False True

Full name of the lead, as entered in HubSpot.

Lead name calculated String True True

Automatically calculated full name for the lead based on associated contact properties.

Outreach activity count Decimal True True

Total number of outbound activities (calls, emails, meetings, or other communications) performed toward the lead.

Open deal amount Decimal True True

Combined value of all currently open deals associated with the lead.

Primary Company Owner String True False

Owner ID of the primary associated company linked to the lead.

Primary Contact Owner String True False

Owner ID of the primary associated contact linked to the lead.

Lead Source String True False

Analytics source indicating how the lead was originally acquired, based on associated contact or company.

Initial company lifecycle stage String True True

First recorded lifecycle stage of the primary associated company when linked to the lead. This value does not update.

Initial contact lifecycle stage String True True

First recorded lifecycle stage of the primary associated contact when linked to the lead. This value does not update.

Lead Source DrillDown 1 String True True

Second tier of detail about how the lead was sourced.

Lead Source DrillDown 2 String True True

Third tier of detail about how the lead was sourced.

Initial source lifecycle stage String True True

Lifecycle stage of the associated contact or company at the time of the lead's creation.

Time to First Touch Decimal True True

Elapsed time between lead creation and first outreach activity logged against the lead.

Lead Title (DEPRECATEDUse hsLeadName) String True True

Deprecated lead title field. Use hsLeadName instead.

Lead Type String False False

Categorization of the lead, such as New Business, Existing Business, or Re-attempting.

Meetings Connected Count String True True

Total number of meetings associated with the lead that were considered connected.

Merged record IDs String True False

List of record IDs that have been merged into this lead record. Automatically generated by HubSpot.

Next Activity Date Datetime True True

Scheduled date of the next activity, prioritized by the primary contact or associated company.

Next Activity Type String True False

Type of the next scheduled activity, based on the primary associated contact or company.

Lead Number of Pageviews Decimal True True

Number of website pageviews recorded for the primary contact or, if unavailable, for the associated company.

Record ID Decimal True True

Unique HubSpot-generated ID assigned to the lead record.

Record Creation Source String True True

Internal metadata field indicating the source system where the lead record originated.

Record Source Detail 1 String True True

Primary detail level describing how the lead record was created.

Record Source Detail 2 String True True

Secondary detail level describing how the lead record was created.

Record Source Detail 3 String True True

Tertiary detail level describing how the lead record was created.

Record Creation Source ID String True True

Internal source ID representing how the lead record was created.

Record Source String True False

Summary of the creation method for the lead record, based on internal metadata.

Record Creation Source User ID Decimal True True

User ID associated with the creation of the lead, if available.

Lead owner calculated String True False

Automatically determined owner of the lead, based on ownership of the primary contact or company.

Lead Pipeline String False False

Pipeline in which the lead is currently categorized.

Lead Pipeline Stage String False False

Current stage of the lead within its assigned pipeline.

Pipeline Stage Category String True True

Category assigned to the lead's current pipeline stage for segmentation purposes.

Pipeline Stage Category Last Updated At Datetime True True

Timestamp marking the most recent update to the lead's pipeline stage category.

Primary Associated Object Name String True True

Name of the primary associated contact or company linked to the lead.

Primary Associated Company Object ID Decimal False True

HubSpot object ID of the primary associated company connected to the lead.

Primary contact enrolled in sequence Bool True True

Indicates whether the lead's primary associated contact is currently enrolled in a HubSpot sequence.

Primary Associated Contact Object ID Decimal False True

HubSpot object ID of the primary associated contact linked to the lead.

Read Only Object Bool True True

Indicates whether the lead record is read-only and cannot be modified.

Shared Team IDs String True False

List of team IDs with shared access to the lead record.

Shared User IDs String True False

List of user IDs with shared access permissions to the lead record.

Lead tags String True False

List of tag IDs automatically assigned to the lead for segmentation or categorization.

Time in Attempting (Lead Pipeline) Decimal True False

Total time in seconds that the lead spent in the 'Attempting' stage of the 'Lead pipeline'.

Time in Connected (Lead Pipeline) Decimal True False

Total time in seconds that the lead spent in the 'Connected' stage of the 'Lead pipeline'.

Time in New (Lead Pipeline) Decimal True False

Total time in seconds that the lead spent in the 'New' stage of the 'Lead pipeline'.

Time in Qualified (Lead Pipeline) Decimal True False

Total time in seconds that the lead spent in the 'Qualified' stage of the 'Lead pipeline'.

Time in Disqualified (Lead Pipeline) Decimal True False

Total time in seconds that the lead spent in the 'Disqualified' stage of the 'Lead pipeline'.

Unique creation key String True True

Unique property used for idempotent creation of lead records to prevent duplication.

Updated by user ID Decimal True True

User ID of the person who most recently updated the lead record. Automatically managed by HubSpot.

User IDs of all notification followers String True False

List of user IDs who chose to follow this lead and receive notifications.

User IDs of all notification unfollowers String True False

List of user IDs who opted out of receiving notifications for this lead.

User IDs of all owners String True False

List of all user IDs assigned as owners of the lead record.

Cumulative time in Attempting (Lead pipeline) Decimal True True

Cumulative total time spent by the lead in the 'Attempting' stage of the 'Lead pipeline'.

Cumulative time in Connected (Lead pipeline) Decimal True True

Cumulative total time spent by the lead in the 'Connected' stage of the 'Lead pipeline'.

Cumulative time in New (Lead pipeline) Decimal True True

Cumulative total time spent by the lead in the 'New' stage of the 'Lead pipeline'.

Cumulative time in Qualified (Lead pipeline) Decimal True True

Cumulative total time spent by the lead in the 'Qualified' stage of the 'Lead pipeline'.

Cumulative time in Disqualified (Lead pipeline) Decimal True True

Cumulative total time spent by the lead in the 'Disqualified' stage of the 'Lead pipeline'.

Date entered Attempting (Lead pipeline) Datetime True True

Date and time when the lead entered the 'Attempting' stage of the 'Lead pipeline'.

Date entered Connected (Lead pipeline) Datetime True True

Date and time when the lead entered the 'Connected' stage of the 'Lead pipeline'.

Date entered New (Lead pipeline) Datetime True True

Date and time when the lead entered the 'New' stage of the 'Lead pipeline'.

Date entered Qualified (Lead pipeline) Datetime True True

Date and time when the lead entered the 'Qualified' stage of the 'Lead pipeline'.

Date entered Disqualified (Lead pipeline) Datetime True True

Date and time when the lead entered the 'Disqualified' stage of the 'Lead pipeline'.

Date exited Attempting (Lead pipeline) Datetime True True

Date and time when the lead exited the 'Attempting' stage of the 'Lead pipeline'.

Date exited Connected (Lead pipeline) Datetime True True

Date and time when the lead exited the 'Connected' stage of the 'Lead pipeline'.

Date exited New (Lead pipeline) Datetime True True

Date and time when the lead exited the 'New' stage of the 'Lead pipeline'.

Date exited Qualified (Lead pipeline) Datetime True True

Date and time when the lead exited the 'Qualified' stage of the 'Lead pipeline'.

Date exited Disqualified (Lead pipeline) Datetime True True

Date and time when the lead exited the 'Disqualified' stage of the 'Lead pipeline'.

Latest time in Attempting (Lead pipeline) Decimal True True

Total time in seconds spent in the 'Attempting' stage since the last time the lead entered it.

Latest time in Connected (Lead pipeline) Decimal True True

Total time in seconds spent in the 'Connected' stage since the last time the lead entered it.

Latest time in New (Lead pipeline) Decimal True True

Total time in seconds spent in the 'New' stage since the last time the lead entered it.

Latest time in Qualified (Lead pipeline) Decimal True True

Total time in seconds spent in the 'Qualified' stage since the last time the lead entered it.

Latest time in Disqualified (Lead pipeline) Decimal True True

Total time in seconds spent in the 'Disqualified' stage since the last time the lead entered it.

Performed in an import Bool True True

Indicates whether the lead record was created as part of a data import process.

Workflow updated lifecycle stage of company Bool False True

Indicates whether a workflow automatically updated the lifecycle stage of the associated company.

Workflow updated lifecycle stage of contact Bool False True

Indicates whether a workflow automatically updated the lifecycle stage of the associated contact.

Owner Assigned Date Datetime True True

Date and time when ownership of the lead was most recently assigned or changed.

Lead Owner String False True

Primary owner assigned to the lead. Defaults to the primary contact's owner or, if not available, the company's owner.

HubSpot Team String True False

Primary HubSpot team associated with the owner of the lead.

Copyright (c) 2026 CData Software, Inc. - All rights reserved.
Build 26.0.9770