Environment

Creates a Environment resource.

Creates a Environment resource.

post/v1/environments

Request

  • Base URL: https://api.fortrabbit.com
  • URL: https://api.fortrabbit.com/v1/environments
  • Auth: HTTP bearer

Request body

appIdstring nullable
namestring required
softwareVersionstring nullable

Major version only, e.g. "11". Optional; defaults to the app software's version.

componentsobject

Component plans keyed by component slug. The value is a size key (e.g. "sm") or "off" to disable an optional component.

autoscalingboolean required

Enable autoscaling. Optional; defaults to true.

phpVersionstring nullable

PHP runtime version; defaults to the platform default.

sourceEnvironmentstring nullable

Public ID of an existing environment to clone component plans and settings from.

environmentVariablesobject

Environment variables to set on the new environment, keyed by name.

Example request

{
  "appId": "ap-a1b2c3",
  "name": "staging",
  "deployment": {
    "git": {
      "branch": "main",
      "directory": "/"
    },
    "buildCommands": [
      "composer install --no-dev"
    ],
    "postDeployCommands": [
      "php artisan migrate --force"
    ],
    "startFirstDeployment": true
  },
  "softwareVersion": "11",
  "components": {
    "php": "sm",
    "storage": "xs",
    "traffic": "xs",
    "backups": "xs"
  },
  "autoscaling": true,
  "phpVersion": "8.4",
  "sourceEnvironment": "en-a1b2c3",
  "environmentVariables": {
    "APP_ENV": "production"
  }
}

Response

Environment resource created

publicIdstring
namestring
softwareVersionstring nullable
createdAtstring date-time
updatedAtstring date-time
domainsstring[]
componentsobject
phpVersionstring nullable
buildCommandsstring[]
postDeployCommandsstring[]
environmentVariablesobject

Variables set on this environment by its owners, keyed by name.

Example response

{
  "environmentVariables": {
    "APP_ENV": "production"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.