{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/foxform-app/json-schema/foxform-app-get-aggregated-stats-response-schema.json",
  "title": "GetAggregatedStatsResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/foxform-app-analytics-api-openapi.yml#/components/schemas/GetAggregatedStatsResponse",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean"
    },
    "data": {
      "$ref": "#/$defs/AggregatedStats"
    },
    "message": {
      "type": "string"
    }
  },
  "$defs": {
    "AggregatedStats": {
      "type": "object",
      "properties": {
        "form_id": {
          "type": "string"
        },
        "overview": {
          "type": "object",
          "properties": {
            "total_responses": {
              "type": "integer"
            },
            "first_response_at": {
              "type": [
                "string",
                "null"
              ]
            },
            "last_response_at": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        },
        "timeline": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string"
              },
              "count": {
                "type": "integer"
              }
            }
          }
        },
        "questions": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "question_id": {
                "type": "string"
              },
              "question_type": {
                "$ref": "#/$defs/QuestionType"
              },
              "question_title": {
                "type": "string"
              },
              "data": {
                "type": "object",
                "description": "One of choice/boolean/numeric/date/text/file stats.",
                "additionalProperties": true
              }
            }
          }
        }
      }
    },
    "QuestionType": {
      "type": "string",
      "enum": [
        "welcome",
        "loading",
        "result",
        "end",
        "short_text",
        "long_text",
        "dropdown",
        "checkboxes",
        "multiple_choice",
        "email",
        "phone",
        "number",
        "date",
        "rating",
        "opinion_scale",
        "nps",
        "yes_no",
        "file_upload",
        "picture_choice",
        "url",
        "slider",
        "alert",
        "testimonials",
        "media",
        "timer",
        "arguments",
        "price",
        "progress_bar"
      ]
    }
  }
}