Articles on: API Docs

Creating a Site

Creating a new site using APIs is simple but you need to know a couple of things.

When you create a new site, it may have 2 states:

Status = ready
Status = in progress

In the case of progress, you may need to query our task status API to see when the site will be ready. Lets understand this with examples:

Create Site

To create a site using APIs, you can call this endpoint:



$client = new \GuzzleHttp\Client();

$response = $client->request('POST', '', [
  'body' => '{"site_name":"xyzsitename"}',
  'headers' => [
    'authorization' => 'Bearer <api_key>',
    'content-type' => 'application/json',

echo $response->getBody();

You will get something like this in the output:


   "message":"Site installation work in progress, Wait for installation.",
      "message":"Site installation work in progress, Wait for installation.",

You can extract:

Username: yuwehamebo0993
Password: q0ynLPB8jZMU3rG6DOl9
Autologin Hash: $2y$10$movlRe2FG0R1agav\/prPF.YCCdpYjdoKphSUeF.js.zS3U4Dc0nYK

Check Progress

Also notice the task_id d53a490af3cd, which can now be used to get the status of the site installation progress.

$response = $client->request('GET', "", [
  'headers' => [
    'authorization' => 'Bearer <token>',


   "message":"Task details retrived.",
      "timeout_at":"2022-12-14 11:25:43",

You can query the task status end point every X seconds till you have a complete site.

Complete code

require_once "vendor/autoload.php";

$client = new \GuzzleHttp\Client();
$token = "your token";

$response = $client->request("POST", "", [
    "body" => '{"site_name":"xyzsitename1"}',
    "headers" => [
        "authorization" => "Bearer $token",
        "content-type" => "application/json",

//echo $response->getBody();

$site = json_decode($response->getBody());

$task_id = $site->data->task_id;

while (true) {
    echo "[.] Waiting for the site to be created...\n";

    $response = $client->request(
            "headers" => [
                "authorization" =>
                    "Bearer $token",

    $task = json_decode($response->getBody());

    if ($task->data->status != "progress") {
        echo "[+] Site Created : {$site->data->wp_url}\n";


Github Actions
Add Deployment

Updated on: 21/09/2023

Was this article helpful?

Share your feedback


Thank you!