Back to DocsWebhooks & API

Lead Ingestion Webhook

Accept incoming leads from any source via a simple HTTP POST endpoint.

Table of contents

Overview

The Lead Ingestion Webhook lets you push leads into DealOracle from any external source — landing pages, CRMs, Zapier, custom forms, or any system that can make HTTP requests.

Use cases include:

  • Landing page forms — Send leads from Unbounce, Leadpages, Instapage, or custom HTML forms
  • CRM integrations — Forward leads from HubSpot, Salesforce, or other CRMs
  • Zapier / Make — Connect any app to DealOracle via automation platforms
  • Custom applications — Send leads from your own backend systems
  • Third-party lead providers — Accept leads from aggregators or partner networks

Endpoint

Send a POST request to your DealOracle webhook URL:

POST https://your-project.supabase.co/functions/v1/lead-webhook

Headers

Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

Replace YOUR_API_KEY with the API key generated from Settings → API Keys.

Payload Format

Send a JSON body with the following fields:

FieldRequiredTypeDescription
nameYesstringFull name of the lead
emailYesstringEmail address
phoneNostringPhone number (E.164 format recommended)
sourceNostringWhere the lead came from
utm_sourceNostringUTM source parameter
utm_mediumNostringUTM medium parameter
utm_campaignNostringUTM campaign parameter
utm_contentNostringUTM content parameter
utm_termNostringUTM term parameter
custom_fieldsNoobjectAny additional key-value pairs

Example Request

{
  "name": "Jane Doe",
  "email": "[email protected]",
  "phone": "+15551234567",
  "source": "landing-page",
  "utm_source": "facebook",
  "utm_campaign": "spring-sale",
  "custom_fields": {
    "interest": "premium-plan",
    "company": "Acme Corp"
  }
}

Authentication

All webhook requests must include a valid API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Getting Your API Key

  1. Navigate to Settings → API Keys
  2. Click Generate New Key
  3. Copy the key immediately — it is only shown once
  4. Store it securely in your application's environment variables

Key Scoping

Each API key is scoped to a specific client account. Leads sent with a given key are automatically assigned to that client's data silo. This means:

  • You can use different keys for different lead sources
  • Each source's leads go to the correct client
  • No need to specify a client ID in the payload

Response Codes

The webhook returns standard HTTP status codes:

CodeMeaningDescription
200SuccessLead was created successfully. Response body includes the new lead's ID.
400Bad RequestMissing required fields (name or email). Response body describes which fields are missing.
401UnauthorizedInvalid or missing API key. Check your Authorization header.
409ConflictDuplicate lead — a lead with the same email already exists in this client account.
429Rate LimitedToo many requests. Wait and retry. See Retry-After header for timing.
500Server ErrorInternal error. Retry the request. If persistent, contact support.

Success Response Example

{
  "success": true,
  "lead_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "message": "Lead created successfully"
}

Error Response Example

{
  "success": false,
  "error": "Missing required field: email"
}
#api#ingestion#leads#webhook