Environment
Update an environment
Changes only the fields supplied; omitted fields are left unchanged. Environment variables are merged, not replaced: Add or change a variable by sending its name with a string value. Remove a variable by sending its name with a null value. Variables you do not name are left unchanged; omit the field entirely to change nothing. Platform-injected variables cannot be added, changed or removed.
patch/v1/environments/{publicId}
Request
- Base URL: https://api.fortrabbit.com
- URL: https://api.fortrabbit.com/v1/environments/{publicId}
- Auth: HTTP bearer
Path parameters
publicIdstring required
Environment identifier
Request body
Example request
{
"name": "staging",
"git": {
"branch": "main",
"directory": null
},
"buildCommands": [
"composer install --no-dev"
],
"postDeployCommands": [
"php artisan migrate --force"
],
"phpVersion": "8.4",
"environmentVariables": {
"APP_ENV": "production",
"OLD_FLAG": null
}
}Response
Environment resource updated
Example response
{
"environmentVariables": {
"APP_ENV": "production"
}
}Changes
No recorded changes to this operation across all 1 revision of this API.