> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Create Site from Template

## Article: Create Site from Template

## Article Link: https://dev.wix.com/docs/api-reference/account-level/sites/skills/create-site-from-template.md

## Article Content:

# Create Site from Template

This recipe guides you through creating a new Wix site from a template, including template selection and optional publishing.

## Prerequisites

- Wix account with site creation permissions
- Account-level API access

## Required APIs

- **Templates Search API**: `GET https://www.wix.com/_api/template-cms-view-service/view/v2/templates/search`
- **Create Site API**: `POST https://www.wixapis.com/msm/v1/meta-site/create-from-template`
- **Publish Site API**: `POST https://www.wixapis.com/site-publisher/v1/site/publish`

---

## Step 1: Understand User Requirements

Before searching templates, gather information:

1. **Ask the user** to describe the site they want in a few sentences
2. **Ask if they want** Wix Editor or Wix Studio
3. **Identify main apps** needed (Stores, Bookings, Blog, etc.)

### Quick Start (Skip Template Search)

If user wants an empty/blank site:
- **Wix Studio blank**: `fe86a14e-ef67-49b4-a409-d086f3abaa1a`
- **Wix Editor blank**: `b55bdf43-95e0-4cef-b9bb-92dcc7af2742`

Skip to Step 3 with these template IDs.

---

## Step 2: Search for Templates

**Endpoint**: `GET https://www.wix.com/_api/template-cms-view-service/view/v2/templates/search`

**Query Parameters**:
| Parameter | Description | Values |
|-----------|-------------|--------|
| `language` | Always use | `en` |
| `limit` | Results per page | `24` |
| `offset` | Pagination offset | Start at `0`, increment by 24 |
| `bookType` | Editor type | `studio` or `main-v2` |
| `query` | Search keywords | `yoga+studio`, `ecommerce`, etc. |

**Example Request**:
```bash
curl -X GET \
  'https://www.wix.com/_api/template-cms-view-service/view/v2/templates/search?language=en&limit=24&offset=0&bookType=studio&query=yoga+studio' \
  -H 'Authorization: <AUTH>'
```

**Response** includes for each template:
- `metaSiteId` - Template ID for creation
- `templateSlug` - For preview URL
- Template name and description
- Color scheme

### Present Templates to User

For each relevant template, show:
- Template name
- Description (without "Click Edit" text)
- "Good for" description
- Color scheme
- Preview link: `https://www.wix.com/website-template/view/html/{templateSlug}`

---

## Step 3: Create the Site

**Endpoint**: `POST https://www.wixapis.com/msm/v1/meta-site/create-from-template`

**Request Body**:
```json
{
  "originTemplateId": "<TEMPLATE_METASITE_ID>",
  "siteName": "my-new-site"
}
```

**Request**:
```bash
curl -X POST \
  'https://www.wixapis.com/msm/v1/meta-site/create-from-template' \
  -H 'Authorization: <AUTH>' \
  -H 'Content-Type: application/json' \
  -d '{
    "originTemplateId": "<TEMPLATE_ID>",
    "siteName": "my-new-site"
  }'
```

### Site Name Requirements

The `siteName` must follow these rules:
- 4-20 characters
- Only lowercase letters, numbers, hyphens, underscores
- Pattern: `[a-z0-9_-]{4,20}`
- Must be unique

If `siteName` is not provided, one is generated automatically.

**Response** includes the new site's `metaSiteId`.

### IMPORTANT NOTES:
- This API creates regular Wix sites. Do NOT use it for headless sites (even with a `namespace` field) — use [Create Headless Site](https://dev.wix.com/docs/api-reference/account-level/sites/skills/create-headless-site.md) instead

---

## Step 4: Publish the Site (Optional)

**Ask the user** if they want to publish their site before proceeding.

**Endpoint**: `POST https://www.wixapis.com/site-publisher/v1/site/publish`

This is a **site-level API** - use the site ID from the creation response.

**Request**:
```bash
curl -X POST \
  'https://www.wixapis.com/site-publisher/v1/site/publish' \
  -H 'Authorization: <AUTH>' \
  -H 'Content-Type: application/json' \
  -d '{}'
```

### IMPORTANT NOTES:
- NEVER publish without asking the user first
- This makes the site publicly accessible

---

## Common Template IDs

For quick access without searching:

| Type | Template ID |
|------|-------------|
| Blank (Studio) | `fe86a14e-ef67-49b4-a409-d086f3abaa1a` |
| Blank (Editor) | `b55bdf43-95e0-4cef-b9bb-92dcc7af2742` |
| Store | `b783f9f9-4f4d-4139-9659-cc95a51b9ee5` |
| Bookings/Services | `17b2bf9e-8661-4c92-973c-67502b415e58` |
| Beauty | `0281d415-0682-42ac-b35e-49b349f19332` |

---

## Next Steps

After creating the site:
- Install required apps using [Install Wix Apps](https://dev.wix.com/docs/api-reference/business-management/app-installation/skills/install-wix-apps.md)
- Configure site settings
- Add content (products, services, blog posts, etc.)