Site Creation API Docs | 1ClickWebsite.ai
Docs
Unlimited plan only

Site Creation API Docs

Create white-label websites and check each request and build from your own systems.

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

FieldTypeNotes
templateIdstringID returned by GET /api/agency/v1/templates.
businessNamestringBusiness name used for the website.
emailstringValid business or owner email address.

Common Optional Fields

FieldTypeNotes
autoApprovebooleanOverrides the agency's default approval setting for this request.
templateNamestringDisplay name for the chosen template.
industrystringBusiness type or category.
phonestringMain business phone number.
addressstringMain address or service area.
businessWebsitestringExisting business website.
aboutBusinessstringShort business description.
businessHoursstringBusiness hours as text.
servicesstring[]Services offered by the business.
serviceAreasstring[]Cities or areas served.
logoUrlstringPublic URL for the business logo.
primaryColorstringSix-digit hex color, such as #2F6B55.
backgroundThemestringlight 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

ValueResult
OmittedUses the agency's default approval setting.
trueApproves the request and queues the website build.
falseLeaves 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

FieldValues
approvalStatuspending_approval, approved, rejected, or cancelled
buildStatusnot_started, queued, building, complete, or failed

When buildStatus is failed, check the error field in the response.

Errors

StatusMeaning
400A required field is missing or the request body is invalid.
401The agency API key is missing, invalid, or revoked.
404The request was not found.
500The request could not be created or read.