API Documentation V2
Lead Gen V2 Batch API
Lead Gen V2 is batch-first. Use the batch endpoints to create and process lead-gen mini sites.
Base URL:
https://1clickwebsite.ai
Authentication
Use an API key from your 1ClickWebsite account in the Authorization header.
Authorization: Bearer YOUR_API_KEY
API keys are the existing account API keys. The raw key is shown once when created, then stored as a SHA-256 hash in the API keys table.
Available Template Keys
Use the top-level templateKey field to choose the Lead Gen V2 template for the whole batch.
| Template key | Template | Status |
|---|---|---|
lightning | Lightning | Available |
lightning is the current production Lead Gen V2 template. More template keys can be added later as new templates are converted.
Create A Batch
POST /api/lead-gen/batches
Creates a Lead Gen V2 batch and reserves credits.
Credit Rules
Lead Gen V2 has a five-credit minimum per batch.
| Rows submitted | Credits reserved |
|---|---|
| 1 | 5 |
| 5 | 5 |
| 20 | 20 |
If the batch cannot be created, credits are not kept. If processing fails for a row, the batch item records the error status.
Request Body
Top-level fields:
| Field | Type | Required | Notes |
|---|---|---|---|
industry | string | No | Shared industry/category for the whole batch. If omitted, the first row industry is used, then Home Services. |
rows | array | Yes | 1 to 500 business rows. |
templateKey or template_key | string | No | Top-level template key for every row in the batch. Use lightning for the current template. |
templateName or template_name | string | No | Deprecated alias for templateKey. Prefer templateKey. |
primaryColor or primary_color | string | No | Hex color, for example #0B1F3A. Used as the batch default. |
backgroundTheme or background_theme | string | No | light or dark. |
contactMode or contact_mode | string | No | form or scheduler. schedule, booking, and survey are accepted as aliases for scheduler. |
Row fields:
| Field | Type | Required | Notes |
|---|---|---|---|
businessName or business_name | string | Yes for new requests | Business name for the generated mini site. Existing integrations may temporarily send a deprecated Google identifier instead. |
phone | string | No | Phone number to show on the generated site. |
email | string | No | Email to show on the generated site. This is saved as text and may be blank. |
address | string | No | Full street address, city/state, or broad area like London. |
industry | string | No | Row-specific industry. Falls back to the batch industry. |
logoUrl or logo_url | string | No | Row-specific logo image URL. Empty values use the default placeholder logo. |
primaryColor or primary_color | string | No | Row-specific hex color. Overrides the batch default. |
backgroundTheme or background_theme | string | No | Row-specific background theme. |
contactMode or contact_mode | string | No | Row-specific contact mode. |
Template selection is batch-level only. Do not send templateKey, template_key, templateName, or template_name inside individual rows.
Each row should include businessName or business_name. The older Google identifier format is still accepted temporarily; see the deprecated section below.
Example Request
curl -X POST "https://1clickwebsite.ai/api/lead-gen/batches" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"industry": "Roofing",
"templateKey": "lightning",
"primaryColor": "#0B1F3A",
"backgroundTheme": "light",
"rows": [
{
"businessName": "RidgeLine Roofing",
"phone": "(555) 010-0199",
"address": "1480 Main St, Denver, CO 80202",
"primaryColor": "#0B1F3A",
"logoUrl": "https://placehold.co/360x120/0B1F3A/FFFFFF.png?text=RidgeLine+Roofing"
},
{
"businessName": "Summit Shield Roofing",
"email": "hello@summitshieldroofing.com",
"address": "Austin, TX",
"primaryColor": "#5B1117",
"logoUrl": "https://placehold.co/360x120/5B1117/FFFFFF.png?text=Summit+Shield"
},
{
"businessName": "Northstar Roofing",
"phone": "(555) 010-0164",
"email": "hello@northstarroofing.com",
"address": "London",
"primaryColor": "#0F3B2E"
}
]
}'
Example Response
{
"ok": true,
"batchId": "24fc4b0b-d1e2-4320-b822-5bb39c4437bf",
"batch": {
"id": "24fc4b0b-d1e2-4320-b822-5bb39c4437bf",
"status": "pending",
"industry": "Roofing",
"template_key": "lightning",
"total_count": 3,
"credits_reserved": 5
},
"creditsReserved": 5,
"creditsRemaining": 42
}
Deprecated Google Identifier Row Format
The older google_cid and google_place_id row format is still accepted for existing integrations, but it is deprecated and scheduled for removal on July 7, 2026.
Prefer the businessName / business_name format shown above for all new integrations.
Deprecated row fields:
| Field | Type | Required | Notes |
|---|---|---|---|
googleCid or google_cid | string | Required if no business name or place ID is sent | Google CID. Send only one Google identifier per row. |
googlePlaceId or google_place_id | string | Required if no business name or CID is sent | Google Place ID. Send only one Google identifier per row. |
Deprecated example:
{
"industry": "Roofing",
"templateKey": "lightning",
"rows": [
{
"google_cid": "12345678901234567890"
},
{
"google_place_id": "ChIJN1t_tDeuEmsRUsoyG83frY4"
}
]
}
If a row includes both a business name and a Google identifier, the Google identifier is still stored and may be used for enrichment. Do not send both google_cid and google_place_id on the same row.
Process A Batch
POST /api/lead-gen/batches/{batchId}/process
Processes queued rows for a batch.
Request body:
{
"limit": 25
}
Example response:
{
"ok": true,
"batchId": "24fc4b0b-d1e2-4320-b822-5bb39c4437bf",
"processed": 5,
"completed": 5,
"failed": 0,
"status": "completed"
}
Get A Batch
GET /api/lead-gen/batches/{batchId}
Returns the batch plus its items. Completed items include the generated public URL and saved site state.
Example response shape:
{
"ok": true,
"batch": {
"id": "24fc4b0b-d1e2-4320-b822-5bb39c4437bf",
"status": "completed",
"industry": "Roofing",
"credits_reserved": 5
},
"items": [
{
"id": "9578efdb-2c93-44bd-8e11-e1a99e25fb3f",
"status": "completed",
"business_name": "RidgeLine Roofing",
"public_url": "https://lg.temphost024.com/lead-gen/ridgeline-roofing",
"primary_color": "#0B1F3A",
"logo_url": "https://placehold.co/360x120/0B1F3A/FFFFFF.png?text=RidgeLine+Roofing",
"template_key": "lightning"
}
]
}
List Batches
GET /api/lead-gen/batches
Returns recent Lead Gen V2 batches for the authenticated account.
Errors
Common error responses:
| Status | Meaning |
|---|---|
| 400 | Invalid request body, invalid row, unsupported field, or a row with no business_name, google_cid, or google_place_id. |
| 401 | Missing or invalid bearer API key. |
| 403 | Lead Gen access is not enabled, credit account is missing, or credits are insufficient. |
| 409 | Credit reservation race or retryable reservation failure. |
| 500 | Unexpected generation or server error. |
Error response shape:
{
"ok": false,
"error": "Invalid lead-gen batch rows",
"details": [
"Row 1 must include business_name."
]
}
Notes
- Use
templateKey: "lightning"for the current Lead Gen V2 design. - Template selection is top-level only. Row-level template fields are not supported.
- Numeric template IDs are not part of the public Lead Gen V2 API.
- Use row-level
primaryColorwhen each generated site needs a different brand color. - Use row-level
logoUrlwhen a CSV or API request includes a business-specific logo. - If
logoUrlis empty, Lightning shows the default placeholder logo. phone,email, andaddressare optional.addresscan be a full street address, city/state, or a broad service area.- The batch service set is shared across every row in the batch.
- Public hosted URLs may require deployment/sync depending on the current environment. Local development URLs can be used for preview testing.