MagicWP Docs
Sites

Create a new site

POST
/v1/sites

Permission: sites.create

Authorization

apiToken
headerAuthorizationBearer <token>

An API token (mwp_…) from Settings → API tokens. Only accepted on this host.

Header Parameters

Idempotency-Key?string

Any unique string up to 255 characters. Retrying with the same key returns the first request's stored response (header Idempotent-Replayed: true) instead of doing it again, for 24 hours. The same key with a different request is refused (idempotency_key_reused).

Length1 <= length <= 255

Request Body

application/json
  1. body
domain?Domain

Base domain for subdomain (e.g. magicwp.net, magicwp.app)

Default"magicwp.net"
site_label?|

Display name for the site (5-15 characters)

site_type?Site Type

full_site (with demo content) or empty_site (clean WP)

Default"full_site"
region?|

Preferred server region (e.g. us, eu, ap)

php_version?|

PHP version

Default"8.4"
storage_limit?|

Storage limit in GB (defaults to subscription total)

wp_admin_email?|

WordPress admin email used by wp core install. Defaults to the site owner's account email.

template_id?|

Build this site from a template. Forces site_type=full_site and refuses subdomain / theme_slugs / active_theme_slug / plugin_slugs. The response task is the site_create_from_template orchestrator, not a site_deploy task.

subdomain?|

Chosen subdomain, 5-15 characters, e.g. 'my-shop' for my-shop.magicwp.net. Omit for a generated one. Validated and reserved-checked by services/subdomain.py; unique across every base domain.

theme_slugs?array<>

wordpress.org slugs of themes to install after provisioning. Each must be an active theme recommendation. Only one is activated — see active_theme_slug.

Itemsitems <= 10
active_theme_slug?|

Which of theme_slugs to activate. Defaults to the first when omitted; must be one of theme_slugs when given. The stock WordPress themes are removed once this one is active.

plugin_slugs?array<>

wordpress.org slugs of plugins to install and activate after provisioning. Each must be an active plugin recommendation.

Itemsitems <= 20

Response Body

Successful Response

application/json
  1. response
success*boolean
data*

The site (new, or the one being overwritten by a push) and the task working on it; poll the task until it finishes.

message*string
status_code*integer
timestamp*string
Formatdate-time
meta?|null
curl -X POST "https://example.com/v1/sites" \  -H "Content-Type: application/json" \  -d '{    "domain": "magicwp.net",    "site_label": "My Blog",    "site_type": "full_site",    "region": "us",    "php_version": "8.2",    "storage_limit": 10,    "wp_admin_email": "[email protected]"  }'
{  "message": "string",  "status_code": 0,  "timestamp": "2019-08-24T14:15:22Z",  "meta": {},  "success": true,  "data": {    "site": {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "stack_number": 0,      "server_id": "820efca4-4a15-4ab7-82fc-9e76f6d61325",      "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",      "subscription_id": "aa11a4c2-a467-43db-b413-c4ab0f5cf627",      "domain_name": "string",      "custom_domain": "string",      "site_label": "string",      "region": "string",      "status": "string",      "message": "string",      "site_type": "string",      "template_id": null,      "template_version": null,      "wp_version": "string",      "wp_installed": true,      "php_hardened": null,      "config_profile": null,      "php_version": "string",      "storage_limit": 0,      "storage_usage": 0,      "maintenance_mode": true,      "notes": null,      "notes_updated_at": null,      "notes_updated_by": null,      "parent_site_id": null,      "expires_at": null,      "extend_count": 0,      "demo_expires_at": null,      "demo_stopped_at": null,      "demo_converted_at": null,      "site_lock": true,      "lock_reason": "string",      "locked_at": "2019-08-24T14:15:22Z",      "billing_suspended_at": "2019-08-24T14:15:22Z",      "admin_suspended_at": "2019-08-24T14:15:22Z",      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z",      "completed_at": "2019-08-24T14:15:22Z"    },    "task": {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "task_type": "string",      "site_id": "72771e6a-6f5e-4de4-a5b9-1266c4197811",      "status": "string",      "result": "string",      "error_message": "string",      "metadata_json": {},      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z",      "completed_at": "2019-08-24T14:15:22Z"    }  }}