PluginsHubSpot
HubSpot Database Schema
Database entities and querying synced HubSpot data
The HubSpot plugin automatically syncs data from HubSpot to your database. This allows you to query HubSpot data without making API calls, providing faster access and offline capabilities.
New to Corsair? Learn about core concepts like database operations, data synchronization, and multi-tenancy before working with the database.
Full Implementation: For the complete, up-to-date database schema and implementations, see the HubSpot plugin source code on GitHub.
Synced Entities
The HubSpot plugin syncs the following entities to your database:
- contacts - Contact records
- companies - Company records
- deals - Deal records
- tickets - Support ticket records
- engagements - Engagement records (calls, meetings, notes, tasks, emails)
Database API
Access synced data through the db property:
const contacts = await corsair.hubspot.db.contacts.search({
data: { properties: { email: "contact@example.com" } },
});Contacts
Schema
{
id: string;
properties?: Record<string, any>;
createdAt?: Date | null;
updatedAt?: Date | null;
archived?: boolean;
}Querying Contacts
Search by email:
const contacts = await corsair.hubspot.db.contacts.search({
data: { properties: { email: "contact@example.com" } },
});Companies
Schema
{
id: string;
properties?: Record<string, any>;
createdAt?: Date | null;
updatedAt?: Date | null;
archived?: boolean;
}Querying Companies
Search by domain:
const companies = await corsair.hubspot.db.companies.search({
data: { properties: { domain: "example.com" } },
});Deals
Schema
{
id: string;
properties?: Record<string, any>;
createdAt?: Date | null;
updatedAt?: Date | null;
archived?: boolean;
}Tickets
Schema
{
id: string;
properties?: Record<string, any>;
createdAt?: Date | null;
updatedAt?: Date | null;
archived?: boolean;
}Engagements
Schema
{
id: string;
engagement?: {
id?: number;
type?: string;
active?: boolean;
timestamp?: number;
};
associations?: Record<string, any>;
metadata?: Record<string, any>;
}See Database for more information about database concepts and querying patterns.