Corsair
PluginsHubSpot

HubSpot API Endpoints

Complete reference for all HubSpot API endpoints

The HubSpot plugin provides full access to HubSpot's API through a typed interface. All endpoints are organized by resource type and automatically handle authentication, rate limiting, and error handling.

New to Corsair? Learn about core concepts like API access, authentication, and error handling before diving into specific endpoints.

Full Implementation: For the complete, up-to-date list of all endpoints and their implementations, see the HubSpot plugin source code on GitHub.

Contacts

Manage contacts in HubSpot CRM.

get

contacts.get

Get a specific contact.

const contact = await corsair.hubspot.api.contacts.get({
    contactId: "contact-id",
    properties: ["email", "firstname", "lastname"],
});

Parameters:

NameTypeRequiredDescription
contactIdstringYesContact ID
propertiesstring[]NoProperties to return
propertiesWithHistorystring[]NoProperties with history
associationsstring[]NoAssociated objects to return
archivedbooleanNoInclude archived contacts
idPropertystringNoID property to use

getMany

contacts.getMany

Get multiple contacts.

const contacts = await corsair.hubspot.api.contacts.getMany({
    limit: 100,
    properties: ["email", "firstname"],
});

Parameters:

NameTypeRequiredDescription
limitnumberNoNumber of results to return
afterstringNoPagination cursor
propertiesstring[]NoProperties to return
propertiesWithHistorystring[]NoProperties with history
associationsstring[]NoAssociated objects
archivedbooleanNoInclude archived contacts

createOrUpdate

contacts.createOrUpdate

Create or update a contact.

const contact = await corsair.hubspot.api.contacts.createOrUpdate({
    properties: {
        email: "contact@example.com",
        firstname: "John",
        lastname: "Doe",
    },
});

Parameters:

NameTypeRequiredDescription
propertiesRecord<string, any>NoContact properties
associationsArray<object>NoAssociated objects

delete

contacts.delete

Delete a contact.

await corsair.hubspot.api.contacts.delete({
    contactId: "contact-id",
});

Parameters:

NameTypeRequiredDescription
contactIdstringYesContact ID to delete

getRecentlyCreated

contacts.getRecentlyCreated

Get recently created contacts.

const contacts = await corsair.hubspot.api.contacts.getRecentlyCreated({
    count: 10,
    since: "2024-01-01T00:00:00Z",
});

Parameters:

NameTypeRequiredDescription
countnumberNoNumber of results
afterstringNoPagination cursor
sincestringNoOnly return contacts created after this time

getRecentlyUpdated

contacts.getRecentlyUpdated

Get recently updated contacts.

const contacts = await corsair.hubspot.api.contacts.getRecentlyUpdated({
    count: 10,
    since: "2024-01-01T00:00:00Z",
});

Parameters:

NameTypeRequiredDescription
countnumberNoNumber of results
afterstringNoPagination cursor
sincestringNoOnly return contacts updated after this time

contacts.search

Search for contacts.

const contacts = await corsair.hubspot.api.contacts.search({
    query: "email:contact@example.com",
    limit: 10,
});

Parameters:

NameTypeRequiredDescription
querystringNoSearch query
limitnumberNoNumber of results
afterstringNoPagination cursor
sortsstring[]NoSort criteria
propertiesstring[]NoProperties to return
filterGroupsArray<any>NoFilter groups

Companies

Manage companies in HubSpot CRM.

get

companies.get

Get a specific company.

const company = await corsair.hubspot.api.companies.get({
    companyId: "company-id",
    properties: ["name", "domain"],
});

Parameters:

NameTypeRequiredDescription
companyIdstringYesCompany ID
propertiesstring[]NoProperties to return
propertiesWithHistorystring[]NoProperties with history
associationsstring[]NoAssociated objects
archivedbooleanNoInclude archived companies
idPropertystringNoID property to use

getMany

companies.getMany

Get multiple companies.

const companies = await corsair.hubspot.api.companies.getMany({
    limit: 100,
});

Parameters:

NameTypeRequiredDescription
limitnumberNoNumber of results
afterstringNoPagination cursor
propertiesstring[]NoProperties to return
propertiesWithHistorystring[]NoProperties with history
associationsstring[]NoAssociated objects
archivedbooleanNoInclude archived companies

create

companies.create

Create a new company.

const company = await corsair.hubspot.api.companies.create({
    properties: {
        name: "Acme Corp",
        domain: "acme.com",
    },
});

Parameters:

NameTypeRequiredDescription
propertiesRecord<string, any>NoCompany properties
associationsArray<object>NoAssociated objects

update

companies.update

Update a company.

await corsair.hubspot.api.companies.update({
    companyId: "company-id",
    properties: {
        name: "Updated Company Name",
    },
});

Parameters:

NameTypeRequiredDescription
companyIdstringYesCompany ID
propertiesRecord<string, any>NoProperties to update
associationsArray<object>NoAssociated objects

delete

companies.delete

Delete a company.

await corsair.hubspot.api.companies.delete({
    companyId: "company-id",
});

Parameters:

NameTypeRequiredDescription
companyIdstringYesCompany ID to delete

getRecentlyCreated

companies.getRecentlyCreated

Get recently created companies.

const companies = await corsair.hubspot.api.companies.getRecentlyCreated({
    count: 10,
});

Parameters:

NameTypeRequiredDescription
countnumberNoNumber of results
afterstringNoPagination cursor
sincestringNoOnly return companies created after this time

getRecentlyUpdated

companies.getRecentlyUpdated

Get recently updated companies.

const companies = await corsair.hubspot.api.companies.getRecentlyUpdated({
    count: 10,
});

Parameters:

NameTypeRequiredDescription
countnumberNoNumber of results
afterstringNoPagination cursor
sincestringNoOnly return companies updated after this time

searchByDomain

companies.searchByDomain

Search for companies by domain.

const companies = await corsair.hubspot.api.companies.searchByDomain({
    domain: "example.com",
});

Parameters:

NameTypeRequiredDescription
domainstringYesDomain to search for
limitnumberNoNumber of results
afterstringNoPagination cursor
propertiesstring[]NoProperties to return
associationsstring[]NoAssociated objects

Deals

Manage deals in HubSpot CRM.

get

deals.get

Get a specific deal.

const deal = await corsair.hubspot.api.deals.get({
    dealId: "deal-id",
    properties: ["dealname", "amount"],
});

Parameters:

NameTypeRequiredDescription
dealIdstringYesDeal ID
propertiesstring[]NoProperties to return
propertiesWithHistorystring[]NoProperties with history
associationsstring[]NoAssociated objects
archivedbooleanNoInclude archived deals
idPropertystringNoID property to use

getMany

deals.getMany

Get multiple deals.

const deals = await corsair.hubspot.api.deals.getMany({
    limit: 100,
});

Parameters:

NameTypeRequiredDescription
limitnumberNoNumber of results
afterstringNoPagination cursor
propertiesstring[]NoProperties to return
propertiesWithHistorystring[]NoProperties with history
associationsstring[]NoAssociated objects
archivedbooleanNoInclude archived deals

create

deals.create

Create a new deal.

const deal = await corsair.hubspot.api.deals.create({
    properties: {
        dealname: "New Deal",
        amount: "10000",
        dealstage: "appointmentscheduled",
    },
});

Parameters:

NameTypeRequiredDescription
propertiesRecord<string, any>NoDeal properties
associationsArray<object>NoAssociated objects

update

deals.update

Update a deal.

await corsair.hubspot.api.deals.update({
    dealId: "deal-id",
    properties: {
        dealstage: "closedwon",
    },
});

Parameters:

NameTypeRequiredDescription
dealIdstringYesDeal ID
propertiesRecord<string, any>NoProperties to update
associationsArray<object>NoAssociated objects

delete

deals.delete

Delete a deal.

await corsair.hubspot.api.deals.delete({
    dealId: "deal-id",
});

Parameters:

NameTypeRequiredDescription
dealIdstringYesDeal ID to delete

getRecentlyCreated

deals.getRecentlyCreated

Get recently created deals.

const deals = await corsair.hubspot.api.deals.getRecentlyCreated({
    count: 10,
});

Parameters:

NameTypeRequiredDescription
countnumberNoNumber of results
afterstringNoPagination cursor
sincestringNoOnly return deals created after this time

getRecentlyUpdated

deals.getRecentlyUpdated

Get recently updated deals.

const deals = await corsair.hubspot.api.deals.getRecentlyUpdated({
    count: 10,
});

Parameters:

NameTypeRequiredDescription
countnumberNoNumber of results
afterstringNoPagination cursor
sincestringNoOnly return deals updated after this time

search

deals.search

Search for deals.

const deals = await corsair.hubspot.api.deals.search({
    query: "dealname:New Deal",
    limit: 10,
});

Parameters:

NameTypeRequiredDescription
querystringNoSearch query
limitnumberNoNumber of results
afterstringNoPagination cursor
sortsstring[]NoSort criteria
propertiesstring[]NoProperties to return
filterGroupsArray<any>NoFilter groups

Tickets

Manage support tickets in HubSpot.

get

tickets.get

Get a specific ticket.

const ticket = await corsair.hubspot.api.tickets.get({
    ticketId: "ticket-id",
    properties: ["subject", "content"],
});

Parameters:

NameTypeRequiredDescription
ticketIdstringYesTicket ID
propertiesstring[]NoProperties to return
propertiesWithHistorystring[]NoProperties with history
associationsstring[]NoAssociated objects
archivedbooleanNoInclude archived tickets
idPropertystringNoID property to use

getMany

tickets.getMany

Get multiple tickets.

const tickets = await corsair.hubspot.api.tickets.getMany({
    limit: 100,
});

Parameters:

NameTypeRequiredDescription
limitnumberNoNumber of results
afterstringNoPagination cursor
propertiesstring[]NoProperties to return
propertiesWithHistorystring[]NoProperties with history
associationsstring[]NoAssociated objects
archivedbooleanNoInclude archived tickets

create

tickets.create

Create a new ticket.

const ticket = await corsair.hubspot.api.tickets.create({
    properties: {
        subject: "Support Request",
        content: "I need help with...",
        hs_pipeline: "0",
        hs_pipeline_stage: "1",
    },
});

Parameters:

NameTypeRequiredDescription
propertiesRecord<string, any>NoTicket properties
associationsArray<object>NoAssociated objects

update

tickets.update

Update a ticket.

await corsair.hubspot.api.tickets.update({
    ticketId: "ticket-id",
    properties: {
        hs_pipeline_stage: "2",
    },
});

Parameters:

NameTypeRequiredDescription
ticketIdstringYesTicket ID
propertiesRecord<string, any>NoProperties to update

delete

tickets.delete

Delete a ticket.

await corsair.hubspot.api.tickets.delete({
    ticketId: "ticket-id",
});

Parameters:

NameTypeRequiredDescription
ticketIdstringYesTicket ID to delete

Engagements

Manage engagements (calls, meetings, notes, tasks, emails).

get

engagements.get

Get a specific engagement.

const engagement = await corsair.hubspot.api.engagements.get({
    engagementId: "engagement-id",
});

Parameters:

NameTypeRequiredDescription
engagementIdstringYesEngagement ID

getMany

engagements.getMany

Get multiple engagements.

const engagements = await corsair.hubspot.api.engagements.getMany({
    limit: 100,
});

Parameters:

NameTypeRequiredDescription
limitnumberNoNumber of results
afterstringNoPagination cursor

create

engagements.create

Create a new engagement.

const engagement = await corsair.hubspot.api.engagements.create({
    engagement: {
        type: "NOTE",
        active: true,
    },
    associations: {
        contactIds: [123],
    },
    metadata: {
        body: "Meeting notes here",
    },
});

Parameters:

NameTypeRequiredDescription
engagement.typestringYesEngagement type (NOTE, CALL, MEETING, TASK, EMAIL)
engagement.activebooleanNoWhether engagement is active
engagement.timestampnumberNoEngagement timestamp
associationsobjectNoAssociated contacts, companies, deals
metadataRecord<string, any>NoEngagement metadata

delete

engagements.delete

Delete an engagement.

await corsair.hubspot.api.engagements.delete({
    engagementId: "engagement-id",
});

Parameters:

NameTypeRequiredDescription
engagementIdstringYesEngagement ID to delete

Contact Lists

Manage contact lists.

addContact

contactLists.addContact

Add a contact to a list.

await corsair.hubspot.api.contactLists.addContact({
    listId: "list-id",
    contactId: "contact-id",
});

Parameters:

NameTypeRequiredDescription
listIdstringYesList ID
contactIdstringYesContact ID

removeContact

contactLists.removeContact

Remove a contact from a list.

await corsair.hubspot.api.contactLists.removeContact({
    listId: "list-id",
    contactId: "contact-id",
});

Parameters:

NameTypeRequiredDescription
listIdstringYesList ID
contactIdstringYesContact ID