Skip to main content
The Google sheets 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

  • rangeUpdated (rangeUpdated)

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

Range Updated

Range Updated

rangeUpdated A range of cells in a Google Sheet was updated Payload
NameTypeRequiredDescription
spreadsheetIdstringNo
sheetNamestringNo
rangestringNo
values(string | number | boolean | null)[]No
eventTyperangeUpdatedNo
timestampstringNo
eventanyNo
{
  eventType: rangeUpdated,
  spreadsheetId: string,
  sheetName: string,
  range: string,
  values: (
    string | number | boolean | null
  )[],
  timestamp: string
}
webhookHooks example
googlesheets({
    webhookHooks: {
        rangeUpdated: {
            before(ctx, args) {
                return { ctx, args };
            },
            after(ctx, response) {
            },
        },
    },
})