Skip to main content
POST
/
orgs
/
{organization}
/
servers
/
{server}
/
sites
Create site
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://forge.laravel.com/api/orgs/{organization}/servers/{server}/sites",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'type' => 'laravel',
    'domain_mode' => '<string>',
    'name' => '<string>',
    'www_redirect_type' => '<string>',
    'allow_wildcard_subdomains' => '<string>',
    'web_directory' => '<string>',
    'is_isolated' => null,
    'isolated_user' => '<string>',
    'php_version' => 'php5',
    'zero_downtime_deployments' => null,
    'nginx_template_id' => 123,
    'source_control_provider' => 'github',
    'repository' => '<string>',
    'branch' => '<string>',
    'database_id' => 123,
    'database_user_id' => '<string>',
    'statamic_setup' => '<string>',
    'statamic_starter_kit' => '<string>',
    'statamic_super_user_email' => '<string>',
    'statamic_super_user_password' => '<string>',
    'install_composer_dependencies' => null,
    'generate_deploy_key' => null,
    'public_deploy_key' => '<string>',
    'private_deploy_key' => '<string>',
    'nuxt_next_mode' => '<string>',
    'nuxt_next_build_command' => '<string>',
    'nuxt_next_port' => 123,
    'push_to_deploy' => null,
    'shared_paths' => [
        [
                'from' => '<string>',
                'to' => '<string>'
        ]
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
{
  "data": {
    "id": "<string>",
    "type": "sites",
    "attributes": {
      "name": "<string>",
      "url": "<string>",
      "user": "<string>",
      "https": true,
      "web_directory": "<string>",
      "root_directory": "<string>",
      "aliases": [
        "<any>"
      ],
      "php_version": "<string>",
      "deployment_status": "<string>",
      "quick_deploy": true,
      "isolated": true,
      "shared_paths": {},
      "repository": {
        "provider": "<string>",
        "url": "<string>",
        "branch": "<string>",
        "status": "installed"
      },
      "database": "<string>",
      "maintenance_mode": {
        "enabled": true,
        "status": "disabling"
      },
      "zero_downtime_deployments": true,
      "deployment_script": "<string>",
      "wildcards": true,
      "app_type": "<string>",
      "uses_envoyer": true,
      "deployment_url": "<string>",
      "healthcheck_url": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z"
    },
    "relationships": {
      "tags": {
        "data": [
          {
            "type": "tags",
            "id": "<string>"
          }
        ]
      },
      "latestDeployment": {
        "data": {
          "type": "deployments",
          "id": "<string>"
        }
      }
    },
    "links": {
      "self": {
        "href": "<string>",
        "rel": "<string>",
        "describedby": "<string>",
        "title": "<string>",
        "type": "<string>",
        "hreflang": "<string>",
        "meta": {}
      }
    }
  }
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

organization
string
required

The organization slug

server
integer
required

The server ID

Body

application/json
type
enum<string>
required
Available options:
laravel,
symfony,
statamic,
wordpress,
phpmyadmin,
php,
next.js,
nuxt.js,
static-html,
other,
custom
domain_mode
name
string
www_redirect_type
string
allow_wildcard_subdomains
string
web_directory
string | null
is_isolated
boolean
isolated_user
string
php_version
enum<string>
Available options:
php5,
php56-old,
php56,
php70,
php71,
php72,
php73,
php74,
php80,
php81,
php82,
php83,
php84,
php85
zero_downtime_deployments
boolean
nginx_template_id
integer
source_control_provider
enum<string>

All supported source control providers.

Available options:
github,
gitlab,
bitbucket,
gitlab-custom,
custom
repository
string | null
branch
string | null
database_id
integer | null
database_user_id
string
statamic_setup
string

The type of setup for Statmic apps.

statamic_starter_kit
string

The starter kit for the Statamic app.

statamic_super_user_email
string
statamic_super_user_password
string
install_composer_dependencies
boolean
generate_deploy_key
boolean
public_deploy_key
string
private_deploy_key
string
nuxt_next_mode
string

The render mode for Next/Nuxt applications.

nuxt_next_build_command
string

The build command for Next/Nuxt applications.

nuxt_next_port
integer

The port used for Next/Nuxt applications.

push_to_deploy
boolean
default:false

Automatically trigger a new deployment when changes are pushed to the environment's Git branch.

shared_paths
object[]

A list of files or directories to be shared between releases for zero-downtime deployments.

Response

SiteResource

data
object
required
I