{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Create Environment",
  "description": "Create a new environment. Environments are isolated deployment contexts like production, staging, or development, each with independent secrets and configurations.",
  "type": "object",
  "required": ["name", "id"],
  "properties": {
    "name": {
      "type": "string",
      "title": "Environment Name",
      "description": "A human-readable name for the environment",
      "minLength": 1,
      "examples": ["Production", "Staging", "Development", "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 package identifiers. For example, project 'ecomm' with environment 'prod' and component 'db' creates 'ecomm-prod-db'. Use familiar names like 'prod', 'staging', 'dev'—human-readable, not a UUID. Max 20 characters, lowercase alphanumeric only (a-z, 0-9). Immutable after creation.",
      "minLength": 1,
      "maxLength": 20,
      "pattern": "^[a-z0-9]{1,20}$",
      "examples": ["prod", "staging", "dev", "preview"]
    },
    "description": {
      "type": "string",
      "title": "Environment Description",
      "description": "An optional description of the environment's purpose",
      "maxLength": 255,
      "examples": ["Production environment for customer-facing services"]
    },
    "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"
    }
  }
}
