{
  "openapi": "3.1.0",
  "info": {
    "title": "KFS Analytics Catcher Events API",
    "version": "1.0.0",
    "description": "Public endpoint for submitting analytics events."
  },
  "paths": {
    "/api/events": {
      "post": {
        "summary": "Submit analytics event",
        "description": "Creates a new analytics event record.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EventSubmission"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event was accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventSubmitResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "EventSubmission": {
        "type": "object",
        "required": ["user_id", "game_version", "event_name"],
        "properties": {
          "user_id": {
            "type": "string",
            "format": "uuid",
            "maxLength": 255
          },
          "game_version": {
            "type": "string",
            "maxLength": 255
          },
          "event_name": {
            "type": "string",
            "maxLength": 255
          },
          "event_val_1": {
            "type": "string",
            "maxLength": 255
          },
          "event_val_2": {
            "type": "string",
            "maxLength": 255
          },
          "event_val_big": {
            "type": "string",
            "maxLength": 25000
          }
        }
      },
      "EventSubmitResponse": {
        "type": "object",
        "properties": {
          "res": {
            "type": "string",
            "enum": ["ok"]
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      }
    }
  }
}
