Corsair
PluginsHubSpot

HubSpot Webhooks

All available HubSpot webhook events

The HubSpot plugin automatically handles incoming webhooks from HubSpot. Point your HubSpot webhook URL to your Corsair webhook endpoint, and the plugin will automatically process events and update your database.

New to Corsair? Learn about core concepts like webhooks, hooks, and multi-tenancy before setting up webhook handlers.

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

Setup

Configure your webhook endpoint to handle HubSpot events:

app/api/webhook/route.ts
import { processWebhook } from "corsair";
import { corsair } from "@/server/corsair";

export async function POST(request: Request) {
    const headers = Object.fromEntries(request.headers);
    const body = await request.json();
    
    const result = await processWebhook(corsair, headers, body);
    return result.response;
}

In your HubSpot account, set the webhook URL to:

https://your-domain.com/api/webhook

Available Webhooks

contactCreated

contacts.contactCreated

Fires when a contact is created.

contactUpdated

contacts.contactUpdated

Fires when a contact is updated.

contactDeleted

contacts.contactDeleted

Fires when a contact is deleted.

companyCreated

companies.companyCreated

Fires when a company is created.

companyUpdated

companies.companyUpdated

Fires when a company is updated.

companyDeleted

companies.companyDeleted

Fires when a company is deleted.

dealCreated

deals.dealCreated

Fires when a deal is created.

dealUpdated

deals.dealUpdated

Fires when a deal is updated.

dealDeleted

deals.dealDeleted

Fires when a deal is deleted.

ticketCreated

tickets.ticketCreated

Fires when a ticket is created.

ticketUpdated

tickets.ticketUpdated

Fires when a ticket is updated.

ticketDeleted

tickets.ticketDeleted

Fires when a ticket is deleted.

Example Usage:

corsair.ts
hubspot({
    webhookHooks: {
        contacts: {
            contactCreated: {
                after: async (ctx, result) => {
                    console.log("Contact created:", result.data);
                },
            },
        },
    },
})

See Webhooks for more details on webhook concepts and Hooks for the complete hooks documentation.