Skip to main content

Introduction

Webhooks allow your spreadsheet to receive HTTP requests from external services. Create a webhook column, get a unique URL, and process incoming data with custom code.

The Webhook Object

In webhook columns, you have access to a webhook object with request information:
webhook.method      // HTTP method (GET, POST, PUT, etc.)
webhook.url         // Full request URL
webhook.headers     // Request headers as key-value pairs
webhook.query       // Query parameters as key-value pairs
webhook.body        // Request body (parsed JSON or raw data)
webhook.receivedAt  // Timestamp when request was received
webhook.ip          // IP address of the requester

Quick Example

// Validate required fields
if (!webhook.body.email || !webhook.body.name) {
   return { success: false, error: "Email and name required" };
}

// Add webhook data to sheet
webhook.addRootFieldsToSheet("Leads", true);

return { success: true };

Key Method

webhook.addRootFieldsToSheet()

Automatically maps webhook body fields to sheet columns and creates a new row.
webhook.addRootFieldsToSheet(sheetName: string, create?: boolean): void
Example:
// Webhook receives: { "name": "John", "email": "[email protected]" }

// Add to Leads sheet, creating new columns if needed
webhook.addRootFieldsToSheet("Leads", true);

Context Availability

In webhook columns, ctx.thisRow and ctx.thisCell are not available. Use the webhook object instead.
Available: webhook, ctx.sheet(), ctx.getRowByValue(), ctx.utils, services Not available: ctx.thisRow, ctx.thisCell

Learn More