Site Creation API
The Site Creation API lets an agency create white-label website requests from a server-to-server integration. It is available on the Unlimited plan.
Base URL
Use your white-label workspace domain:
https://sites.yourdomain.com
You can also use:
https://1clickwebsite.ai
Authentication
Create an agency API key in your white-label workspace under Settings → API Keys. The same agency key can also be used with the Lead Gen API.
Send the key as a bearer token with every request:
Authorization: Bearer 1cw_agency_...
The full key is shown once. Store it like a password and never place it in browser code or a public file.
Get Available Templates
GET /api/agency/v1/templates
Returns the V2 templates available in your workspace.
curl "https://sites.yourdomain.com/api/agency/v1/templates" \
-H "Authorization: Bearer YOUR_AGENCY_API_KEY"
{
"templates": [
{
"id": "lightning",
"templateId": "lightning",
"themeId": null,
"name": "Lightning",
"description": "A fast, modern service-business template.",
"version": "v2",
"hasServices": true,
"hasServiceAreas": true,
"featureImage": "https://example.com/template-thumbnail.jpg",
"previewUrl": "https://example.com/template-preview"
}
]
}
Send the returned templateId in a site-creation request. When themeId is not null, send that value too.
Create a Site Request
POST /api/agency/v1/site-requests
Creates a new website request. With auto approval enabled, the website build is queued immediately. Otherwise, the request waits for approval in the workspace.
Only V2 templates are supported. Use a templateId returned by the templates endpoint.
Required Fields
| Field | Type | Notes |
|---|---|---|
templateId | string | ID returned by GET /api/agency/v1/templates. |
businessName | string | Business name used for the website. |
email | string | Valid business or owner email address. |
Common Optional Fields
| Field | Type | Notes |
|---|---|---|
autoApprove | boolean | Overrides the agency's default approval setting for this request. |
templateName | string | Display name for the chosen template. |
industry | string | Business type or category. |
phone | string | Main business phone number. |
address | string | Main address or service area. |
businessWebsite | string | Existing business website. |
aboutBusiness | string | Short business description. |
businessHours | string | Business hours as text. |
services | string[] | Services offered by the business. |
serviceAreas | string[] | Cities or areas served. |
logoUrl | string | Public URL for the business logo. |
primaryColor | string | Six-digit hex color, such as #2F6B55. |
backgroundTheme | string | light or dark. |
Example Request
curl -X POST "https://sites.yourdomain.com/api/agency/v1/site-requests" \
-H "Authorization: Bearer YOUR_AGENCY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"templateId": "lightning",
"templateName": "Lightning",
"autoApprove": true,
"businessName": "Austin Patio Pros",
"industry": "Patio contractor",
"email": "owner@example.com",
"phone": "+15125550123",
"address": "123 Main St, Austin, TX 78701",
"businessWebsite": "https://example.com",
"aboutBusiness": "Austin Patio Pros builds patios, outdoor kitchens, and stone walkways.",
"businessHours": "Mon-Fri 8am-5pm",
"services": ["Patio installation", "Outdoor kitchens", "Stone walkways"],
"serviceAreas": ["Austin", "Round Rock", "Cedar Park"],
"primaryColor": "#d23832",
"backgroundTheme": "light"
}'
Split Payload
The API also accepts separate formPayload and provisionPayload objects:
{
"builderVersion": "v2",
"templateId": "lightning",
"templateName": "Lightning",
"autoApprove": false,
"formPayload": {
"businessName": "Austin Patio Pros",
"email": "owner@example.com"
},
"provisionPayload": {
"businessName": "Austin Patio Pros",
"email": "owner@example.com",
"services": ["Patio installation"]
}
}
Top-level site fields are merged into both objects. Values inside formPayload and provisionPayload win when the same field is also sent at the top level.
Auto Approval
| Value | Result |
|---|---|
| Omitted | Uses the agency's default approval setting. |
true | Approves the request and queues the website build. |
false | Leaves the request pending in the agency dashboard. |
Pending requests can be approved by an owner or admin in the workspace. API endpoints for listing and approving pending requests are not currently available.
Response
{
"id": "agency-site-request-id",
"autoApproved": false,
"approvalStatus": "pending_approval",
"buildStatus": "not_started"
}
Save the returned id; it is required to check the request later.
Check a Site Request
GET /api/agency/v1/site-requests/{requestId}
Returns the current approval and build status for a request.
curl "https://sites.yourdomain.com/api/agency/v1/site-requests/REQUEST_ID" \
-H "Authorization: Bearer YOUR_AGENCY_API_KEY"
{
"id": "agency-site-request-id",
"approvalStatus": "approved",
"buildStatus": "complete",
"siteUrl": "https://site-name.preview-domain.com",
"siteStatus": "complete",
"error": null
}
siteUrl is null until the build has been assigned to a server. When buildStatus is complete, siteUrl contains the generated website address.
Status Values
| Field | Values |
|---|---|
approvalStatus | pending_approval, approved, rejected, or cancelled |
buildStatus | not_started, queued, building, complete, or failed |
When buildStatus is failed, check the error field in the response.
Errors
| Status | Meaning |
|---|---|
400 | A required field is missing or the request body is invalid. |
401 | The agency API key is missing, invalid, or revoked. |
404 | The request was not found. |
500 | The request could not be created or read. |