SweepAndGo Webhook API

Receive and process webhook events from SweepAndGo with CORS support and Notion-based configuration.

Configuration

The UUID of the Notion page that contains the configuration for processing events

Request Preview

URL:
POST /api/sweepandgo/550e8400-e29b-41d4-a716-446655440000
Headers:
{
  "Content-Type": "application/json"
}
Body:
"{\n  \"type\": \"client:subscription_created\",\n  \"clientId\": \"client_123456\",\n  \"firstName\": \"John\",\n  \"lastName\": \"Doe\",\n  \"email\": \"john@example.com\",\n  \"phone\": \"+1234567890\",\n  \"address\": \"123 Main Street\",\n  \"city\": \"San Francisco\",\n  \"state\": \"CA\",\n  \"zipCode\": \"94102\",\n  \"subscriptionStatus\": \"active\",\n  \"subscriptionDate\": \"2026-07-11T12:11:08.226Z\"\n}"

API Reference

Endpoint

POST /api/sweepandgo/[uuid]

Parameters

uuid
UUID of the Notion page containing the webhook configuration

Request Body

The request body should contain the SweepAndGo webhook payload with a required type field that identifies the event type.

Required Fields:

  • type - Event type string identifying the webhook (e.g., client:subscription_created)

Event Type Categories:

Sync Types (Fetch and Sync from SweepAndGo to GHL):

These event types trigger data synchronization from SweepAndGo API to GHL. The webhook payload contains optional pagination parameters.

  • client:sync_active_to_ghl - Sync active clients from SweepAndGo
  • client:sync_inactive_to_ghl - Sync inactive clients from SweepAndGo
  • lead:sync_to_ghl - Sync leads from SweepAndGo

Sync Payload Fields:

  • startPage - Starting page number for pagination (optional, defaults to 1)
  • endPage - Ending page number for pagination (optional, defaults to 10)

When syncing, the following SweepAndGo contact fields are mapped to GHL contacts:

  • first_name/name → firstName
  • last_name → lastName
  • email → email
  • cell_phone → phone
  • address → address1
  • city → city
  • zip_code → postalCode
  • status → tags
  • client_id/lead_id → custom fields (if configured in schema)

Webhook Handler Types (Real-time Event Handlers):

All other event types are real-time webhook handlers that process incoming SweepAndGo events immediately.

  • Client Events: subscription_created, subscription_canceled, subscription_paused, subscription_unpaused, changed_status, changed_address, changed_info, payment_accepted, payment_declined, client_onboarding_onetime, client_onboarding_recurring, reviews_automation
  • Lead Events: out_of_service_area, in_service_area
  • Quote Events: quote

Common Client Fields:

  • clientId - Unique identifier for the client
  • firstName - Client first name
  • lastName - Client last name
  • email - Client email address
  • phone - Client phone number
  • address - Client address
  • city - City
  • state - State/Province
  • zipCode - Postal code

Response

{
  "success": true,
  "data": {
    "processed": true,
    "events": 1,
    "timestamp": "2026-07-11T12:11:08.226Z"
  }
}

Features

  • CORS-enabled for browser-based webhook delivery
  • Notion page-based configuration for event routing
  • Automatic event processing and transformation
  • Comprehensive error handling and logging