{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nudg3-ai/json-schema/nudg3-ai-prompt-template-response-schema.json",
  "title": "PromptTemplateResponse",
  "description": "Response schema for prompt template data.",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nudg3-ai-openapi.json#/components/schemas/PromptTemplateResponse",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id",
      "description": "Template unique identifier"
    },
    "workspace_id": {
      "type": "string",
      "format": "uuid",
      "title": "Workspace Id",
      "description": "Workspace this template belongs to"
    },
    "name": {
      "type": "string",
      "title": "Name",
      "description": "Template name"
    },
    "template_text": {
      "type": "string",
      "title": "Template Text",
      "description": "Template content"
    },
    "category": {
      "type": "string",
      "title": "Category",
      "description": "Template category"
    },
    "tags": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Tags",
      "description": "Template tags"
    },
    "topic": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Topic",
      "description": "Consumer curiosity topic (e.g., 'Performance', 'Value')"
    },
    "is_active": {
      "type": "boolean",
      "title": "Is Active",
      "description": "Whether template is active"
    },
    "status": {
      "type": "string",
      "title": "Status",
      "description": "Template status: active, inactive, suggested"
    },
    "location_country": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Location Country"
    },
    "location_city": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Location City"
    },
    "location_region": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Location Region"
    },
    "quality_score": {
      "type": "number",
      "title": "Quality Score",
      "description": "Quality score (0-1) from multi-factor scoring engine",
      "default": 0.0
    },
    "seed_source": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Seed Source",
      "description": "Source of prompt: 'dataforseo', 'serpapi', 'manual', 'generated', 'ai'"
    },
    "seed_query": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Seed Query",
      "description": "Original real-world query if seeded from DataForSEO/SerpAPI"
    },
    "grounding_context": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Grounding Context",
      "description": "Additional context from search results"
    },
    "is_newly_generated": {
      "type": "boolean",
      "title": "Is Newly Generated",
      "description": "Whether prompt was just generated",
      "default": false
    },
    "geo_opportunity_score": {
      "anyOf": [
        {
          "type": "number",
          "maximum": 100.0,
          "minimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Geo Opportunity Score",
      "description": "GEO opportunity score (0-100) based on market signals from DataForSEO"
    },
    "geo_score_grade": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 3
        },
        {
          "type": "null"
        }
      ],
      "title": "Geo Score Grade",
      "description": "Letter grade (A+, A, A-, B+, B, B-, C+, C, C-) corresponding to GEO score"
    },
    "geo_score_components": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "number"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Geo Score Components",
      "description": "Breakdown of GEO score components: mention_likelihood, commercial_viability, market_opportunity, intent_alignment"
    },
    "geo_score_reasoning": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Geo Score Reasoning",
      "description": "Human-readable reasoning for each score component with interpretations and GEO impact analysis"
    },
    "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"
    },
    "collection_scope": {
      "type": "string",
      "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"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At",
      "description": "Creation timestamp"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At",
      "description": "Last update timestamp"
    }
  },
  "type": "object",
  "required": [
    "id",
    "workspace_id",
    "name",
    "template_text",
    "category",
    "tags",
    "is_active",
    "status",
    "created_at",
    "updated_at"
  ]
}