Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt

Use this file to discover all available pages before exploring further.

The Hubspot plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see Overview for setup context and the exact URL shape).
New to Corsair? See webhooks and hooks.

Webhook map

  • companyCreated (companyCreated)
  • companyDeleted (companyDeleted)
  • companyUpdated (companyUpdated)
  • contactCreated (contactCreated)
  • contactDeleted (contactDeleted)
  • contactUpdated (contactUpdated)
  • dealCreated (dealCreated)
  • dealDeleted (dealDeleted)
  • dealUpdated (dealUpdated)
  • ticketCreated (ticketCreated)
  • ticketDeleted (ticketDeleted)
  • ticketUpdated (ticketUpdated)

HTTP handler setup

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;
}

Events

Company Created

Company Created

companyCreated A new company was created Payload
NameTypeRequiredDescription
subscriptionIdnumberYes
portalIdnumberYes
occurredAtnumberYes
subscriptionTypecompany.creationYes
attemptNumbernumberYes
objectIdnumberYes
propertyNamestringNo
propertyValuestringNo
changeSourcestringNo
eventIdstringNo
{
  success: boolean
}
webhookHooks example
hubspot({
    webhookHooks: {
        companyCreated: {
            before(ctx, args) {
                return { ctx, args };
            },
            after(ctx, response) {
            },
        },
    },
})

Company Deleted

Company Deleted

companyDeleted A company was deleted Payload
NameTypeRequiredDescription
subscriptionIdnumberYes
portalIdnumberYes
occurredAtnumberYes
subscriptionTypecompany.deletionYes
attemptNumbernumberYes
objectIdnumberYes
propertyNamestringNo
propertyValuestringNo
changeSourcestringNo
eventIdstringNo
{
  success: boolean
}
webhookHooks example
hubspot({
    webhookHooks: {
        companyDeleted: {
            before(ctx, args) {
                return { ctx, args };
            },
            after(ctx, response) {
            },
        },
    },
})

Company Updated

Company Updated

companyUpdated A company property was updated Payload
NameTypeRequiredDescription
subscriptionIdnumberYes
portalIdnumberYes
occurredAtnumberYes
subscriptionTypecompany.propertyChangeYes
attemptNumbernumberYes
objectIdnumberYes
propertyNamestringYes
propertyValuestringYes
changeSourcestringNo
eventIdstringNo
{
  success: boolean
}
webhookHooks example
hubspot({
    webhookHooks: {
        companyUpdated: {
            before(ctx, args) {
                return { ctx, args };
            },
            after(ctx, response) {
            },
        },
    },
})

Contact Created

Contact Created

contactCreated A new contact was created Payload
NameTypeRequiredDescription
subscriptionIdnumberYes
portalIdnumberYes
occurredAtnumberYes
subscriptionTypecontact.creationYes
attemptNumbernumberYes
objectIdnumberYes
propertyNamestringNo
propertyValuestringNo
changeSourcestringNo
eventIdstringNo
{
  success: boolean
}
webhookHooks example
hubspot({
    webhookHooks: {
        contactCreated: {
            before(ctx, args) {
                return { ctx, args };
            },
            after(ctx, response) {
            },
        },
    },
})

Contact Deleted

Contact Deleted

contactDeleted A contact was deleted Payload
NameTypeRequiredDescription
subscriptionIdnumberYes
portalIdnumberYes
occurredAtnumberYes
subscriptionTypecontact.deletionYes
attemptNumbernumberYes
objectIdnumberYes
propertyNamestringNo
propertyValuestringNo
changeSourcestringNo
eventIdstringNo
{
  success: boolean
}
webhookHooks example
hubspot({
    webhookHooks: {
        contactDeleted: {
            before(ctx, args) {
                return { ctx, args };
            },
            after(ctx, response) {
            },
        },
    },
})

Contact Updated

Contact Updated

contactUpdated A contact property was updated Payload
NameTypeRequiredDescription
subscriptionIdnumberYes
portalIdnumberYes
occurredAtnumberYes
subscriptionTypecontact.propertyChangeYes
attemptNumbernumberYes
objectIdnumberYes
propertyNamestringYes
propertyValuestringYes
changeSourcestringNo
eventIdstringNo
{
  success: boolean
}
webhookHooks example
hubspot({
    webhookHooks: {
        contactUpdated: {
            before(ctx, args) {
                return { ctx, args };
            },
            after(ctx, response) {
            },
        },
    },
})

Deal Created

Deal Created

dealCreated A new deal was created Payload
NameTypeRequiredDescription
subscriptionIdnumberYes
portalIdnumberYes
occurredAtnumberYes
subscriptionTypedeal.creationYes
attemptNumbernumberYes
objectIdnumberYes
propertyNamestringNo
propertyValuestringNo
changeSourcestringNo
eventIdstringNo
{
  success: boolean
}
webhookHooks example
hubspot({
    webhookHooks: {
        dealCreated: {
            before(ctx, args) {
                return { ctx, args };
            },
            after(ctx, response) {
            },
        },
    },
})

Deal Deleted

Deal Deleted

dealDeleted A deal was deleted Payload
NameTypeRequiredDescription
subscriptionIdnumberYes
portalIdnumberYes
occurredAtnumberYes
subscriptionTypedeal.deletionYes
attemptNumbernumberYes
objectIdnumberYes
propertyNamestringNo
propertyValuestringNo
changeSourcestringNo
eventIdstringNo
{
  success: boolean
}
webhookHooks example
hubspot({
    webhookHooks: {
        dealDeleted: {
            before(ctx, args) {
                return { ctx, args };
            },
            after(ctx, response) {
            },
        },
    },
})

Deal Updated

Deal Updated

dealUpdated A deal property was updated Payload
NameTypeRequiredDescription
subscriptionIdnumberYes
portalIdnumberYes
occurredAtnumberYes
subscriptionTypedeal.propertyChangeYes
attemptNumbernumberYes
objectIdnumberYes
propertyNamestringYes
propertyValuestringYes
changeSourcestringNo
eventIdstringNo
{
  success: boolean
}
webhookHooks example
hubspot({
    webhookHooks: {
        dealUpdated: {
            before(ctx, args) {
                return { ctx, args };
            },
            after(ctx, response) {
            },
        },
    },
})

Ticket Created

Ticket Created

ticketCreated A new support ticket was created Payload
NameTypeRequiredDescription
subscriptionIdnumberYes
portalIdnumberYes
occurredAtnumberYes
subscriptionTypeticket.creationYes
attemptNumbernumberYes
objectIdnumberYes
propertyNamestringNo
propertyValuestringNo
changeSourcestringNo
eventIdstringNo
{
  success: boolean
}
webhookHooks example
hubspot({
    webhookHooks: {
        ticketCreated: {
            before(ctx, args) {
                return { ctx, args };
            },
            after(ctx, response) {
            },
        },
    },
})

Ticket Deleted

Ticket Deleted

ticketDeleted A support ticket was deleted Payload
NameTypeRequiredDescription
subscriptionIdnumberYes
portalIdnumberYes
occurredAtnumberYes
subscriptionTypeticket.deletionYes
attemptNumbernumberYes
objectIdnumberYes
propertyNamestringNo
propertyValuestringNo
changeSourcestringNo
eventIdstringNo
{
  success: boolean
}
webhookHooks example
hubspot({
    webhookHooks: {
        ticketDeleted: {
            before(ctx, args) {
                return { ctx, args };
            },
            after(ctx, response) {
            },
        },
    },
})

Ticket Updated

Ticket Updated

ticketUpdated A support ticket property was updated Payload
NameTypeRequiredDescription
subscriptionIdnumberYes
portalIdnumberYes
occurredAtnumberYes
subscriptionTypeticket.propertyChangeYes
attemptNumbernumberYes
objectIdnumberYes
propertyNamestringYes
propertyValuestringYes
changeSourcestringNo
eventIdstringNo
{
  success: boolean
}
webhookHooks example
hubspot({
    webhookHooks: {
        ticketUpdated: {
            before(ctx, args) {
                return { ctx, args };
            },
            after(ctx, response) {
            },
        },
    },
})