v1

latestOpenAPI 3.0.02026-07-14198572488.4 KB
Sites

Create new site

Endpoint that can be used to create a new site.

post/v1/sites

Request body

namestring required

WordPress Site Title

locationinteger

ID of the location. Use the List Site locations API to get the location ID.

restricted_locationinteger

If you have dedicated locations, you can use these by ID to add sites at those dedicated locations. (When passed, do not pass location). Use the List Site locations API to get the restricted location ID.

admin_usernamestring

WordPress admin username

admin_passwordstring

WordPress admin password

admin_emailstring

WordPress admin email

multisiteboolean
template_idstring uuid

An optional Site Template ID to use when creating the site

install_pluginsstring

A comma separated list of plugin slugs to install

sub_pathstring

If the site should be installed outside of public_html, which folder (this is rare)

labelstring nullable

A label which can be used to identify the site separately from the site's domain

site_type0 | 1 | 2

Type of site. 0 == WordPress, 1 == static site

static_siteboolean

DEPRECATED: Use site_type instead. When true, a "static" site will be created without any WordPress install

metadataSiteMetadata
php_versionstring

PHP version to be used

Example request

{
  "location": 1,
  "admin_username": "superlongadminusername",
  "admin_password": "b38yt3M#ORJ#nu3gh3irj3hrug###D%",
  "admin_email": "email@domain.tld",
  "multisite": true,
  "template_id": "2df39219-f15e-4ba9-82b2-09bf585a19bc",
  "install_plugins": "awesome-plugin,great-plugin,ok-plugin",
  "sub_path": "blog",
  "label": "agencypartner1::site1::abcd",
  "metadata": {
    "key": "value"
  },
  "template_replacements": [
    {
      "key": "__contact_email__",
      "value": "hello@rocket.net"
    }
  ]
}

Response

OK

successboolean

whether the request succeeded

errorsstring[]
messagesstring[] nullable

Example response

{
  "success": true,
  "errors": [],
  "messages": []
}