---
title: "Create a website"
method: POST
path: "/v1/hosting/website"
tags: ["Website"]
---

# Create a website

`POST /v1/hosting/website`

## Request

- Base URL: `https://api.10web.io`
- URL: `https://api.10web.io/v1/hosting/website`
- Auth: none declared. Required headers: `x-api-key`
- TypeScript: <https://skmtc.dev/10web/apis/10web-api-v1/docs/v1/hosting/website/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a WordPress website. Two mutually exclusive modes:

**Claim mode (ghost pool)** — omit `subdomain` and omit all hosting fields
(`region`, `site_title`, `admin_username`, `admin_password`, `is_trial`,
`trial_website_delete_after_days`, `enable_wp_ai_generation`; legacy aliases
`is_demo` / `demo_domain_delete_after_days` also count as hosting fields). Uses a warm-pool
ghost on the reseller workspace when available; otherwise cold-creates with a
generated subdomain. Requires an eligible reseller workspace (active reseller
agreement and active client main domain). A successful claim emits webhook
`website_generation_completed` with `generation_flow: reseller_ghost_claim`.
The returned URL is the pool site URL (you do not choose the subdomain).

**Cold-create mode** — pass `subdomain` plus `region`, `site_title`,
`admin_username`, and `admin_password`. Honors the requested subdomain. On completion,
emits `website_generation_completed` with `generation_flow: create_website` (or
`create_website_dedicated_vm` for dedicated-VM accounts).

Passing any hosting field without `subdomain` returns HTTP 400.

## Headers

- `x-api-key` string, required

## Request body

- CreateWebsiteRequest
  - `subdomain` string, required: Subdomain for the website (3-63 characters, lowercase letters, numbers, and hyphens only)
  - `region` string, required: Region of the website
  - `site_title` string, required: Title of the website
  - `admin_username` string, required: Admin username for the website (max 60 characters, can contain alphanumeric characters, space, _, ., -, *, @)
  - `admin_password` string, required: Admin password for the website (must contain 1 lowercase, 1 uppercase, 1 digit, minimum 8 chars). Cold-create only; forbidden in claim mode.
  - `is_trial` 0 | 1: Specifies if this website is a trial (0 = regular website, 1 = trial website). Cold-create only; forbidden in claim mode. Legacy alias `is_demo` is still accepted temporarily and mapped to `is_trial`. With `b2b_trial_limitations`, max trial sites = `b2b_trial_website_create_limit_hard` (legacy fallback: `demo_website_count`). Trial sites do not consume paid slots.
  - `trial_website_delete_after_days` integer: Optional. Number of days after which a trial website will be deleted (only applicable when is_trial = 1). Cold-create only; forbidden in claim mode. Default is 3. Maximum is enforced by Core using the plan `b2b_trial_period_days` parameter (values above the plan max are clamped). Legacy alias `demo_domain_delete_after_days` is still accepted temporarily.
  - `enable_wp_ai_generation` boolean: Enable AI website builder functionality in WordPress admin panel

## Response `200`

Website created successfully

- WebsiteResponse
  - `status` 'ok' | 'error'
  - `data` object
    - `website_id` integer: The ID of the created website

## Other responses

- `400`: Bad request
- `403`: Unauthorized access
- `429`: Too many requests
- `500`: Something went wrong

---

[API](https://skmtc.dev/10web/apis/10web-api-v1.md) - [All operations](https://skmtc.dev/10web/apis/10web-api-v1/llms.txt) - [OpenAPI document](https://skmtc.dev/10web/apis/10web-api-v1/revisions/01afc9651dfc?raw)
