{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nudg3-ai/json-schema/nudg3-ai-create-prompt-template-request-schema.json",
  "title": "CreatePromptTemplateRequest",
  "description": "Request schema for creating a new prompt template.",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nudg3-ai-openapi.json#/components/schemas/CreatePromptTemplateRequest",
  "properties": {
    "name": {
      "type": "string",
      "maxLength": 255,
      "minLength": 1,
      "title": "Name",
      "description": "Template name"
    },
    "template_text": {
      "type": "string",
      "minLength": 1,
      "title": "Template Text",
      "description": "Template content with placeholders"
    },
    "category": {
      "type": "string",
      "maxLength": 100,
      "minLength": 1,
      "title": "Category",
      "description": "Template category"
    },
    "tags": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Tags",
      "description": "Template tags for filtering"
    },
    "topic": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 100
        },
        {
          "type": "null"
        }
      ],
      "title": "Topic",
      "description": "Consumer curiosity topic (e.g., 'Performance', 'Value')"
    },
    "is_active": {
      "type": "boolean",
      "title": "Is Active",
      "description": "Whether template is active",
      "default": true
    },
    "status": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 20
        },
        {
          "type": "null"
        }
      ],
      "title": "Status",
      "description": "Template status: active, inactive, suggested",
      "default": "active"
    },
    "location_country": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 2,
          "minLength": 2
        },
        {
          "type": "null"
        }
      ],
      "title": "Location Country",
      "description": "Override ISO country code"
    },
    "location_city": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 100
        },
        {
          "type": "null"
        }
      ],
      "title": "Location City",
      "description": "Override city"
    },
    "location_region": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 100
        },
        {
          "type": "null"
        }
      ],
      "title": "Location Region",
      "description": "Override region/state"
    },
    "premium_providers": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Premium Providers",
      "description": "List of premium model product slugs to use for this prompt (e.g., ['gpt-4o', 'claude-3-5-sonnet'])"
    },
    "collection_scope": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "all",
            "base",
            "premium"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Collection Scope",
      "description": "Collection scope: all (base+premium), base (base only), premium (premium only)",
      "default": "all"
    },
    "config_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "title": "Config Id",
      "description": "Configuration ID that generated this prompt (V2 only)"
    },
    "funnel_stage": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "discovery",
            "research",
            "purchase"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Funnel Stage",
      "description": "Funnel stage: discovery, research, or purchase (V2 only)"
    },
    "parent_prompt_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "title": "Parent Prompt Id",
      "description": "Direct parent prompt in fan-out chain"
    },
    "root_prompt_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "title": "Root Prompt Id",
      "description": "Root prompt in fan-out chain"
    }
  },
  "type": "object",
  "required": [
    "name",
    "template_text",
    "category"
  ]
}