{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fortrabbit-com/json-schema/fortrabbit-com-app-app-create-api-request-schema.json",
  "title": "App.AppCreateApiRequest",
  "x-generated": "2026-11-08",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/fortrabbit-com-api-openapi.json#/components/schemas/App.AppCreateApiRequest",
  "type": "object",
  "properties": {
    "teamId": {
      "pattern": "^(([a-z]{2})-[0-9a-z]{6})$",
      "type": [
        "string",
        "null"
      ]
    },
    "name": {
      "minLength": 1,
      "maxLength": 32,
      "type": "string"
    },
    "region": {
      "type": "string",
      "description": "Region identifier, e.g. \"eu-w1a\" or \"us-e1a\"."
    },
    "softwarePresetName": {
      "minLength": 1,
      "maxLength": 64,
      "type": [
        "string",
        "null"
      ],
      "description": "Software preset slug; defaults to \"general-php\"."
    },
    "initialEnvironment": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "softwareVersion": {
          "type": [
            "string",
            "null"
          ],
          "description": "Major version only, e.g. \"11\"."
        },
        "phpVersion": {
          "type": [
            "string",
            "null"
          ],
          "description": "PHP runtime version for the initial environment, e.g. \"8.4\". Defaults to the platform default. Setting it stops the environment from being auto-updated to newer PHP versions."
        },
        "cloudDomain": {
          "type": [
            "string",
            "null"
          ],
          "description": "Cloud domain label without the root, e.g. \"acme-shop\". Omit to derive one from the app name; none is created when that name is invalid, reserved or taken. Set null to create no cloud domain."
        },
        "components": {
          "type": "object",
          "description": "Component plans keyed by component slug. The value is a size key (e.g. \"sm\") or \"off\" to disable an optional component. Omitted optional components default to \"off\".",
          "additionalProperties": {
            "type": "string"
          }
        },
        "autoscaling": {
          "type": "boolean",
          "default": true,
          "description": "Enable autoscaling for the initial environment. Optional; defaults to true."
        },
        "deployment": {
          "type": [
            "object",
            "null"
          ],
          "description": "Deployment configuration. The git field is required to configure deployment; omit the whole object to skip deployment.",
          "required": [
            "git"
          ],
          "properties": {
            "git": {
              "type": "object",
              "required": [
                "repository",
                "branch"
              ],
              "properties": {
                "repository": {
                  "type": "string",
                  "maxLength": 255
                },
                "branch": {
                  "type": "string",
                  "maxLength": 255
                },
                "directory": {
                  "type": "string",
                  "maxLength": 255,
                  "default": "/",
                  "description": "Deploy directory. Optional; defaults to \"/\". Must not be null or empty when provided."
                }
              }
            },
            "buildCommands": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "postDeployCommands": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "startFirstDeployment": {
              "type": "boolean",
              "description": "Trigger a first deployment right after the app is created."
            }
          }
        }
      },
      "additionalProperties": false,
      "description": "Initial environment configuration."
    },
    "paymentMethodId": {
      "pattern": "^(([a-z]{2})-[0-9a-z]{6})$",
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "name",
    "region"
  ]
}