{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/annsa-ai/json-schema/annsa-ai-widget-submission-schema.json",
  "title": "WidgetSubmission",
  "description": "A submission from the in-product survey. Note that the credential is the `api_key` field below, not a header.",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/annsa-ai-openapi.json#/components/schemas/WidgetSubmission",
  "type": "object",
  "required": [
    "api_key"
  ],
  "properties": {
    "api_key": {
      "type": "string",
      "description": "The survey key from Settings → Integrations → Survey. This is the credential for this endpoint."
    },
    "text": {
      "type": "string",
      "description": "The feedback content."
    },
    "email": {
      "type": "string",
      "maxLength": 255
    },
    "feedback_type": {
      "type": "string",
      "enum": [
        "bug",
        "feature",
        "question",
        "other"
      ]
    },
    "page_url": {
      "type": "string",
      "maxLength": 2000,
      "description": "Where the feedback was given."
    },
    "screenshot": {
      "type": "string",
      "description": "Base64-encoded image."
    },
    "surface": {
      "type": "string",
      "enum": [
        "float",
        "inline",
        "bar",
        "thumbs",
        "page",
        "widget"
      ],
      "description": "Which collection surface captured this."
    },
    "rating": {
      "type": "integer"
    },
    "user_metadata": {
      "type": "object",
      "description": "Who the submitter is. Recognised keys include `email`, `name`, `full_name`, `displayName`, `id`, `plan`, `tier`, and any of `amount` / `mrr` / `arr` / `revenue` for what they pay.",
      "additionalProperties": true
    }
  }
}