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

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://forge.laravel.com/api/orgs/{organization}/servers",
  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([
    'name' => '<string>',
    'provider' => '<string>',
    'credential_id' => '<string>',
    'team_id' => 123,
    'type' => 'app',
    'ubuntu_version' => '22.04',
    'php_version' => '<string>',
    'database_type' => '<string>',
    'recipe_id' => 123,
    'aws' => [
        'region_id' => '<string>',
        'size_id' => '<string>',
        'vpc_uuid' => '<string>',
        'subnet_uuid' => '<string>',
        'disk_size' => '<string>'
    ],
    'ocean2' => [
        'region_id' => '<string>',
        'size_id' => '<string>',
        'vpc_uuid' => '<string>',
        'enable_weekly_backups' => '<string>'
    ],
    'hetzner' => [
        'region_id' => '<string>',
        'size_id' => '<string>',
        'network_id' => '<string>',
        'enable_daily_backups' => '<string>',
        'enable_weekly_backups' => null
    ],
    'vultr' => [
        'region_id' => '<string>',
        'size_id' => '<string>',
        'network_id' => '<string>'
    ],
    'akamai' => [
        'region_id' => '<string>',
        'size_id' => '<string>'
    ],
    'laravel' => [
        'region_id' => '<string>',
        'size_id' => '<string>',
        'vpc_uuid' => '<string>'
    ],
    'custom' => [
        'ip_address' => '<string>',
        'private_ip_address' => '<string>',
        'ssh_port' => '<string>',
        'behind_nat' => '<string>',
        'nat_ssh_port' => '<string>'
    ],
    'add_key_to_source_control' => null,
    'database' => '<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;
}
{}

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

Body

application/json
name
string
required
Maximum length: 30
provider
string
required
type
enum<string>
required
Available options:
app,
web,
loadbalancer,
database,
cache,
worker,
meilisearch
ubuntu_version
enum<string>
required
Available options:
22.04,
24.04
credential_id
string
team_id
integer | null
php_version
string
database_type
string
recipe_id
integer | null
aws
object
ocean2
object
hetzner
object
vultr
object
akamai
object
laravel
object
custom
object
add_key_to_source_control
boolean
default:true
database
string

Response

The response is of type object.

I