<?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>',
'root_directory' => '<string>',
'web_directory' => '<string>',
'is_isolated' => true,
'isolated_user' => '<string>',
'php_version' => 'php5',
'zero_downtime_deployments' => true,
'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' => true,
'generate_deploy_key' => true,
'public_deploy_key' => '<string>',
'private_deploy_key' => '<string>',
'frontend_package_manager' => '<string>',
'frontend_build_command' => '<string>',
'nuxt_next_mode' => '<string>',
'nuxt_next_port' => 123,
'push_to_deploy' => false,
'tags' => [
'<string>'
],
'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",
"links": {
"self": {
"href": "<string>",
"rel": "<string>",
"describedby": "<string>",
"title": "<string>",
"type": "<string>",
"hreflang": "<string>",
"meta": {}
}
},
"attributes": {
"name": "<string>",
"status": "installed",
"url": "<string>",
"user": "<string>",
"https": true,
"web_directory": "<string>",
"root_directory": "<string>",
"aliases": [
"<unknown>"
],
"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": {
"server": {
"data": {
"type": "servers",
"id": "<string>"
}
},
"tags": {
"data": [
{
"type": "tags",
"id": "<string>"
}
]
},
"latestDeployment": {
"data": {
"type": "deployments",
"id": "<string>"
}
},
"securityRules": {
"data": [
{
"type": "securityRules",
"id": "<string>"
}
]
},
"redirectRules": {
"data": [
{
"type": "redirect-rules",
"id": "<string>"
}
]
}
}
}
}Add a new site to the server.
Processing mode: async
<?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>',
'root_directory' => '<string>',
'web_directory' => '<string>',
'is_isolated' => true,
'isolated_user' => '<string>',
'php_version' => 'php5',
'zero_downtime_deployments' => true,
'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' => true,
'generate_deploy_key' => true,
'public_deploy_key' => '<string>',
'private_deploy_key' => '<string>',
'frontend_package_manager' => '<string>',
'frontend_build_command' => '<string>',
'nuxt_next_mode' => '<string>',
'nuxt_next_port' => 123,
'push_to_deploy' => false,
'tags' => [
'<string>'
],
'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",
"links": {
"self": {
"href": "<string>",
"rel": "<string>",
"describedby": "<string>",
"title": "<string>",
"type": "<string>",
"hreflang": "<string>",
"meta": {}
}
},
"attributes": {
"name": "<string>",
"status": "installed",
"url": "<string>",
"user": "<string>",
"https": true,
"web_directory": "<string>",
"root_directory": "<string>",
"aliases": [
"<unknown>"
],
"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": {
"server": {
"data": {
"type": "servers",
"id": "<string>"
}
},
"tags": {
"data": [
{
"type": "tags",
"id": "<string>"
}
]
},
"latestDeployment": {
"data": {
"type": "deployments",
"id": "<string>"
}
},
"securityRules": {
"data": [
{
"type": "securityRules",
"id": "<string>"
}
]
},
"redirectRules": {
"data": [
{
"type": "redirect-rules",
"id": "<string>"
}
]
}
}
}
}The access token received from the authorization server in the OAuth 2.0 flow.
laravel, symfony, statamic, wordpress, phpmyadmin, php, next.js, nuxt.js, static-html, other, custom php5, php56-old, php56, php70, php71, php72, php73, php74, php80, php81, php82, php83, php84, php85 All supported source control providers.
github, gitlab, bitbucket, gitlab-custom, custom The type of setup for Statmic apps.
The starter kit for the Statamic app.
The package manager for frontend applications.
The build command for frontend assets.
The render mode for Next/Nuxt applications.
The port used for Next/Nuxt applications.
Automatically trigger a new deployment when changes are pushed to the environment's Git branch.
A list of files or directories to be shared between releases for zero-downtime deployments.
SiteResource
Show child attributes
sites Show child attributes
installed, creating, removing, installing, uninstalling, deployed, never-deployed, deploying, failed, maintenance Show child attributes
Was this page helpful?