{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Fork Environment",
  "description": "Attributes for the new environment. The fork references the parent via `parentId`, starts with blank instances, and does not copy any instance-level configuration. Use `copyInstance` per-instance if you want to seed configuration from the parent.",
  "type": "object",
  "required": ["name", "id"],
  "properties": {
    "name": {
      "type": "string",
      "title": "Environment Name",
      "description": "A human-readable name for the forked environment",
      "minLength": 1,
      "examples": ["Staging", "Feature Branch", "Preview"]
    },
    "id": {
      "type": "string",
      "title": "Environment ID",
      "description": "A short, memorable identifier for looking up this environment in the API and CLI. This becomes the second segment of instance identifiers. Max 20 characters, lowercase alphanumeric only (a-z, 0-9). Immutable after creation.",
      "minLength": 1,
      "maxLength": 20,
      "pattern": "^[a-z0-9]{1,20}$",
      "examples": ["staging", "preview", "feature1"]
    },
    "description": {
      "type": "string",
      "title": "Environment Description",
      "description": "An optional description of the forked environment's purpose",
      "maxLength": 255,
      "examples": ["Preview environment for the payments refactor"]
    },
    "attributes": {
      "type": "object",
      "title": "Attributes",
      "description": "Key-value attributes for this environment. Keys and values must be strings. Must conform to the organization's custom attributes for the environment scope.",
      "additionalProperties": { "type": "string" },
      "default": {},
      "x-gql-type": "map"
    },
    "copyEnvironmentDefaults": {
      "type": "boolean",
      "title": "Copy Environment Defaults",
      "description": "When true, copies the parent environment's default resource connections into the fork. Instance-level configuration is never copied — use `copyInstance` to seed instance params.",
      "default": false
    }
  }
}
