Skip to main content
PATCH
/
environments
/
{environment}
Update environment
curl --request PATCH \
  --url https://cloud.laravel.com/api/environments/{environment} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "slug": "<string>",
  "color": "blue",
  "branch": "<string>",
  "uses_push_to_deploy": true,
  "uses_deploy_hook": true,
  "timeout": 32,
  "php_version": "8.2:1",
  "build_command": "<string>",
  "node_version": "20",
  "deploy_command": "<string>",
  "uses_vanity_domain": true,
  "database_schema_id": "<string>",
  "cache_id": "<string>",
  "websocket_application_id": "<string>",
  "uses_octane": true,
  "sleep_timeout": 30,
  "shutdown_timeout": 300,
  "uses_purge_edge_cache_on_deploy": true,
  "nightwatch_token": "<string>",
  "cache_strategy": "default",
  "response_headers_frame": "deny",
  "response_headers_content_type": "nosniff",
  "response_headers_robots_tag": "index, follow",
  "response_headers_hsts": {
    "max_age": 1,
    "include_subdomains": true,
    "preload": true
  },
  "filesystem_keys": [
    {
      "id": "<string>",
      "disk": "<string>",
      "is_default_disk": true
    }
  ],
  "firewall_rate_limit_level": "challenge",
  "firewall_under_attack_mode": false
}
'
{
  "data": {
    "id": "<string>",
    "type": "environments",
    "links": {
      "self": {
        "href": "<string>",
        "rel": "<string>",
        "describedby": "<string>",
        "title": "<string>",
        "type": "<string>",
        "hreflang": "<string>",
        "meta": {}
      }
    },
    "attributes": {
      "name": "<string>",
      "slug": "<string>",
      "status": "deploying",
      "created_from_automation": true,
      "vanity_domain": "<string>",
      "php_major_version": "8.2",
      "build_command": "<string>",
      "node_version": "20",
      "deploy_command": "<string>",
      "uses_octane": true,
      "uses_hibernation": true,
      "uses_push_to_deploy": true,
      "uses_deploy_hook": true,
      "environment_variables": [
        {
          "key": "<string>",
          "value": "<string>"
        }
      ],
      "network_settings": {
        "cache": {
          "strategy": "<string>"
        },
        "response_headers": {
          "frame": "<string>",
          "content_type": "<string>",
          "hsts": {
            "max_age": 123,
            "include_subdomains": true,
            "preload": true
          }
        },
        "firewall": {
          "bot_categories": [
            "academic_research"
          ],
          "rate_limit": {
            "429": true,
            "level": "challenge",
            "per_minute": 100,
            "4xx": true
          },
          "under_attack_mode_started_at": "<string>"
        }
      },
      "created_at": "2023-11-07T05:31:56Z"
    },
    "relationships": {
      "application": {
        "data": {
          "type": "applications",
          "id": "<string>"
        }
      },
      "branch": {
        "data": {
          "type": "branches",
          "id": "<string>"
        }
      },
      "deployments": {
        "data": [
          {
            "type": "deployments",
            "id": "<string>"
          }
        ]
      },
      "currentDeployment": {
        "data": {
          "type": "deployments",
          "id": "<string>"
        }
      },
      "domains": {
        "data": [
          {
            "type": "domains",
            "id": "<string>"
          }
        ]
      },
      "primaryDomain": {
        "data": {
          "type": "domains",
          "id": "<string>"
        }
      },
      "instances": {
        "data": [
          {
            "type": "instances",
            "id": "<string>"
          }
        ]
      }
    }
  },
  "included": [
    {
      "id": "<string>",
      "type": "applications",
      "attributes": {
        "name": "<string>",
        "slug": "<string>",
        "region": "us-east-2",
        "slack_channel": "<string>",
        "avatar_url": "<string>",
        "created_at": "2023-11-07T05:31:56Z",
        "repository": {
          "full_name": "<string>",
          "default_branch": "<string>"
        }
      },
      "relationships": {
        "repository": {
          "data": {
            "type": "repositories",
            "id": "<string>"
          }
        },
        "organization": {
          "data": {
            "type": "organizations",
            "id": "<string>"
          }
        },
        "environments": {
          "data": [
            {
              "type": "environments",
              "id": "<string>"
            }
          ]
        },
        "deployments": {
          "data": [
            {
              "type": "deployments",
              "id": "<string>"
            }
          ]
        },
        "defaultEnvironment": {
          "data": {
            "type": "environments",
            "id": "<string>"
          }
        }
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

The Bearer Token generated on the Cloud UI.

Path Parameters

environment
string
required

The environment identifier

Body

application/json
name
string
Required string length: 1 - 40
slug
string
Minimum string length: 1
color
enum<string>
Available options:
blue,
green,
orange,
purple,
red,
yellow,
cyan,
gray
branch
string
uses_push_to_deploy
boolean
uses_deploy_hook
boolean
timeout
integer
Required range: 5 <= x <= 60
php_version
enum<string>
Available options:
8.2:1,
8.3:1,
8.4:1,
8.5:1
build_command
string | null
Maximum string length: 2000
node_version
enum<string>
Available options:
20,
22,
24
deploy_command
string | null
Maximum string length: 2000
uses_vanity_domain
boolean
database_schema_id
string | null

The identifier of the database schema to attach to the environment. Send null or an empty string to detach the database, or skip it entirely to leave it unchanged.

cache_id
string | null

The identifier of the cache to attach to the environment. Send null or an empty string to detach the cache, or skip it entirely to leave it unchanged.

websocket_application_id
string

The identifier of the WebSocket application to attach to the environment. Send null or an empty string to detach the WebSocket application, or skip it entirely to leave it unchanged.

uses_octane
boolean
sleep_timeout
integer
Required range: 1 <= x <= 60
shutdown_timeout
integer
Required range: 1 <= x <= 600
uses_purge_edge_cache_on_deploy
boolean
nightwatch_token
string | null
Required string length: 44
cache_strategy
enum<string>
Available options:
default,
bypass
response_headers_frame
enum<string>
Available options:
deny,
sameorigin,
all
response_headers_content_type
enum<string>
Available options:
nosniff,
none
response_headers_robots_tag
enum<string>
Available options:
index, follow,
noindex, nofollow
response_headers_hsts
object
filesystem_keys
object[]

An array of the object storage buckets that should be attached to the environment. Send an emtpy array ([]) to detach all buckets.

firewall_rate_limit_level
enum<string>
Available options:
challenge,
throttle,
ban
firewall_under_attack_mode
boolean
default:false

Response

EnvironmentResource

data
EnvironmentResource · object
required
included
(ApplicationResource · object | BranchResource · object | DeploymentResource · object | DomainResource · object | InstanceResource · object)[]