<?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([
'domain_mode' => '<string>',
'name' => '<string>',
'allow_wildcard_subdomains' => true,
'root_directory' => '<string>',
'web_directory' => '<string>',
'is_isolated' => true,
'isolated_user' => '<string>',
'zero_downtime_deployments' => true,
'nginx_template_id' => 123,
'source_control_provider_id' => 123,
'repository' => '<string>',
'branch' => '<string>',
'database_id' => 123,
'database_user_id' => 123,
'statamic_setup' => '<string>',
'statamic_starter_kit' => '<string>',
'statamic_super_user_email' => 'jsmith@example.com',
'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;
}curl --request POST \
--url https://forge.laravel.com/api/orgs/{organization}/servers/{server}/sites \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"domain_mode": "<string>",
"name": "<string>",
"allow_wildcard_subdomains": true,
"root_directory": "<string>",
"web_directory": "<string>",
"is_isolated": true,
"isolated_user": "<string>",
"zero_downtime_deployments": true,
"nginx_template_id": 123,
"source_control_provider_id": 123,
"repository": "<string>",
"branch": "<string>",
"database_id": 123,
"database_user_id": 123,
"statamic_setup": "<string>",
"statamic_starter_kit": "<string>",
"statamic_super_user_email": "jsmith@example.com",
"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>"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
domain_mode: '<string>',
name: '<string>',
allow_wildcard_subdomains: true,
root_directory: '<string>',
web_directory: '<string>',
is_isolated: true,
isolated_user: '<string>',
zero_downtime_deployments: true,
nginx_template_id: 123,
source_control_provider_id: 123,
repository: '<string>',
branch: '<string>',
database_id: 123,
database_user_id: 123,
statamic_setup: '<string>',
statamic_starter_kit: '<string>',
statamic_super_user_email: 'jsmith@example.com',
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>'}]
})
};
fetch('https://forge.laravel.com/api/orgs/{organization}/servers/{server}/sites', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://forge.laravel.com/api/orgs/{organization}/servers/{server}/sites"
payload := strings.NewReader("{\n \"domain_mode\": \"<string>\",\n \"name\": \"<string>\",\n \"allow_wildcard_subdomains\": true,\n \"root_directory\": \"<string>\",\n \"web_directory\": \"<string>\",\n \"is_isolated\": true,\n \"isolated_user\": \"<string>\",\n \"zero_downtime_deployments\": true,\n \"nginx_template_id\": 123,\n \"source_control_provider_id\": 123,\n \"repository\": \"<string>\",\n \"branch\": \"<string>\",\n \"database_id\": 123,\n \"database_user_id\": 123,\n \"statamic_setup\": \"<string>\",\n \"statamic_starter_kit\": \"<string>\",\n \"statamic_super_user_email\": \"jsmith@example.com\",\n \"statamic_super_user_password\": \"<string>\",\n \"install_composer_dependencies\": true,\n \"generate_deploy_key\": true,\n \"public_deploy_key\": \"<string>\",\n \"private_deploy_key\": \"<string>\",\n \"frontend_package_manager\": \"<string>\",\n \"frontend_build_command\": \"<string>\",\n \"nuxt_next_mode\": \"<string>\",\n \"nuxt_next_port\": 123,\n \"push_to_deploy\": false,\n \"tags\": [\n \"<string>\"\n ],\n \"shared_paths\": [\n {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": {
"id": "<string>",
"type": "sites",
"links": {
"self": {
"href": "<string>",
"rel": "<string>",
"describedby": "<string>",
"title": "<string>",
"type": "<string>",
"hreflang": "<string>",
"meta": {}
}
},
"attributes": {
"name": "<string>",
"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>"
},
"database": "<string>",
"maintenance_mode": {
"enabled": true
},
"zero_downtime_deployments": true,
"deployment_retention": 123,
"deployment_script": "<string>",
"wildcards": true,
"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>"
}
]
}
}
},
"included": [
{
"id": "<string>",
"type": "servers",
"links": {
"self": {
"href": "<string>",
"rel": "<string>",
"describedby": "<string>",
"title": "<string>",
"type": "<string>",
"hreflang": "<string>",
"meta": {}
}
},
"attributes": {
"id": 123,
"credential_id": 123,
"name": "<string>",
"slug": "<string>",
"ubuntu_version": "<string>",
"ssh_port": 123,
"provider": "<string>",
"identifier": "<string>",
"size": "<string>",
"region": "<string>",
"php_version": "<string>",
"php_cli_version": "<string>",
"opcache_status": "<string>",
"database_type": "<string>",
"db_status": "<string>",
"redis_status": "<string>",
"ip_address": "<string>",
"private_ip_address": "<string>",
"revoked": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"connection_status": "<string>",
"timezone": "<string>",
"local_public_key": "<string>",
"is_ready": true
},
"relationships": {
"tags": {
"data": [
{
"type": "tags",
"id": "<string>"
}
]
}
}
}
]
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Create site
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([
'domain_mode' => '<string>',
'name' => '<string>',
'allow_wildcard_subdomains' => true,
'root_directory' => '<string>',
'web_directory' => '<string>',
'is_isolated' => true,
'isolated_user' => '<string>',
'zero_downtime_deployments' => true,
'nginx_template_id' => 123,
'source_control_provider_id' => 123,
'repository' => '<string>',
'branch' => '<string>',
'database_id' => 123,
'database_user_id' => 123,
'statamic_setup' => '<string>',
'statamic_starter_kit' => '<string>',
'statamic_super_user_email' => 'jsmith@example.com',
'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;
}curl --request POST \
--url https://forge.laravel.com/api/orgs/{organization}/servers/{server}/sites \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"domain_mode": "<string>",
"name": "<string>",
"allow_wildcard_subdomains": true,
"root_directory": "<string>",
"web_directory": "<string>",
"is_isolated": true,
"isolated_user": "<string>",
"zero_downtime_deployments": true,
"nginx_template_id": 123,
"source_control_provider_id": 123,
"repository": "<string>",
"branch": "<string>",
"database_id": 123,
"database_user_id": 123,
"statamic_setup": "<string>",
"statamic_starter_kit": "<string>",
"statamic_super_user_email": "jsmith@example.com",
"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>"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
domain_mode: '<string>',
name: '<string>',
allow_wildcard_subdomains: true,
root_directory: '<string>',
web_directory: '<string>',
is_isolated: true,
isolated_user: '<string>',
zero_downtime_deployments: true,
nginx_template_id: 123,
source_control_provider_id: 123,
repository: '<string>',
branch: '<string>',
database_id: 123,
database_user_id: 123,
statamic_setup: '<string>',
statamic_starter_kit: '<string>',
statamic_super_user_email: 'jsmith@example.com',
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>'}]
})
};
fetch('https://forge.laravel.com/api/orgs/{organization}/servers/{server}/sites', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://forge.laravel.com/api/orgs/{organization}/servers/{server}/sites"
payload := strings.NewReader("{\n \"domain_mode\": \"<string>\",\n \"name\": \"<string>\",\n \"allow_wildcard_subdomains\": true,\n \"root_directory\": \"<string>\",\n \"web_directory\": \"<string>\",\n \"is_isolated\": true,\n \"isolated_user\": \"<string>\",\n \"zero_downtime_deployments\": true,\n \"nginx_template_id\": 123,\n \"source_control_provider_id\": 123,\n \"repository\": \"<string>\",\n \"branch\": \"<string>\",\n \"database_id\": 123,\n \"database_user_id\": 123,\n \"statamic_setup\": \"<string>\",\n \"statamic_starter_kit\": \"<string>\",\n \"statamic_super_user_email\": \"jsmith@example.com\",\n \"statamic_super_user_password\": \"<string>\",\n \"install_composer_dependencies\": true,\n \"generate_deploy_key\": true,\n \"public_deploy_key\": \"<string>\",\n \"private_deploy_key\": \"<string>\",\n \"frontend_package_manager\": \"<string>\",\n \"frontend_build_command\": \"<string>\",\n \"nuxt_next_mode\": \"<string>\",\n \"nuxt_next_port\": 123,\n \"push_to_deploy\": false,\n \"tags\": [\n \"<string>\"\n ],\n \"shared_paths\": [\n {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": {
"id": "<string>",
"type": "sites",
"links": {
"self": {
"href": "<string>",
"rel": "<string>",
"describedby": "<string>",
"title": "<string>",
"type": "<string>",
"hreflang": "<string>",
"meta": {}
}
},
"attributes": {
"name": "<string>",
"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>"
},
"database": "<string>",
"maintenance_mode": {
"enabled": true
},
"zero_downtime_deployments": true,
"deployment_retention": 123,
"deployment_script": "<string>",
"wildcards": true,
"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>"
}
]
}
}
},
"included": [
{
"id": "<string>",
"type": "servers",
"links": {
"self": {
"href": "<string>",
"rel": "<string>",
"describedby": "<string>",
"title": "<string>",
"type": "<string>",
"hreflang": "<string>",
"meta": {}
}
},
"attributes": {
"id": 123,
"credential_id": 123,
"name": "<string>",
"slug": "<string>",
"ubuntu_version": "<string>",
"ssh_port": 123,
"provider": "<string>",
"identifier": "<string>",
"size": "<string>",
"region": "<string>",
"php_version": "<string>",
"php_cli_version": "<string>",
"opcache_status": "<string>",
"database_type": "<string>",
"db_status": "<string>",
"redis_status": "<string>",
"ip_address": "<string>",
"private_ip_address": "<string>",
"revoked": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"connection_status": "<string>",
"timezone": "<string>",
"local_public_key": "<string>",
"is_ready": true
},
"relationships": {
"tags": {
"data": [
{
"type": "tags",
"id": "<string>"
}
]
}
}
}
]
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Body
laravel, symfony, statamic, wordpress, phpmyadmin, php, nextjs, nuxtjs, static-html, other, custom The type of www redirection to apply to the domain.
from-www, to-www, none "from-www"
Whether to allow wildcard subdomains for the domain.
false
^[^\s]+$^[^\s]+$32^[a-z][\-a-z0-9_]*$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 ID of the database to use with the site.
The ID of the database user to use with the site.
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.
Show child attributes
Show child attributes
Response
SiteResource
Show child attributes
Show child attributes
- ServerResource
- TagResource
- DeploymentResource
- SecurityRuleResource
- RedirectRuleResource
Show child attributes
Show child attributes
Was this page helpful?