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:
| Field | Required | Type | Description |
|---|---|---|---|
name | Yes | string | Full name of the lead |
email | Yes | string | Email address |
phone | No | string | Phone number (E.164 format recommended) |
source | No | string | Where the lead came from |
utm_source | No | string | UTM source parameter |
utm_medium | No | string | UTM medium parameter |
utm_campaign | No | string | UTM campaign parameter |
utm_content | No | string | UTM content parameter |
utm_term | No | string | UTM term parameter |
custom_fields | No | object | Any 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
- Navigate to Settings → API Keys
- Click Generate New Key
- Copy the key immediately — it is only shown once
- 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:
| Code | Meaning | Description |
|---|---|---|
| 200 | Success | Lead was created successfully. Response body includes the new lead's ID. |
| 400 | Bad Request | Missing required fields (name or email). Response body describes which fields are missing. |
| 401 | Unauthorized | Invalid or missing API key. Check your Authorization header. |
| 409 | Conflict | Duplicate lead — a lead with the same email already exists in this client account. |
| 429 | Rate Limited | Too many requests. Wait and retry. See Retry-After header for timing. |
| 500 | Server Error | Internal 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
