{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/stacktr-ee/json-schema/stacktr-ee-feedback-schema.json",
  "title": "Feedback",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/stacktr-ee-openapi.yml#/components/schemas/Feedback",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "client_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "comment": {
      "type": "string"
    },
    "element": {
      "type": [
        "string",
        "null"
      ]
    },
    "element_path": {
      "type": [
        "string",
        "null"
      ]
    },
    "selected_text": {
      "type": [
        "string",
        "null"
      ]
    },
    "nearby_text": {
      "type": [
        "string",
        "null"
      ]
    },
    "page_url": {
      "type": [
        "string",
        "null"
      ]
    },
    "intent": {
      "type": [
        "string",
        "null"
      ],
      "description": "fix | change | question | approve, or a suggestion: edit (new wording for anchor.exact), add_after (a new paragraph, suggested_text, after the paragraph whose text is anchor.exact) or remove (take out the paragraph whose text is anchor.exact)."
    },
    "severity": {
      "type": [
        "string",
        "null"
      ],
      "description": "blocking | important | suggestion"
    },
    "target_kind": {
      "type": [
        "string",
        "null"
      ],
      "description": "What an on-page comment is attached to: text | image | video | audio | embed | graphic | element | page. null on older toolbar notes."
    },
    "anchor": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": true,
      "description": "Where on the page, by target_kind: e.g. exact for text, src/alt and point for an image, time for media."
    },
    "target": {
      "type": [
        "string",
        "null"
      ],
      "description": "The anchor in words, e.g. the text \"Q3 revenue\". Quote this rather than reading anchor."
    },
    "on_page": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Open comments with a target only: still in the page as it is now (true), gone from it, most likely answered by an edit (false), or not judgeable from the source (null)."
    },
    "suggested_text": {
      "type": "string",
      "description": "Suggestions only: for intent \"edit\" the wording the reviewer proposed in place of anchor.exact; for \"add_after\" the new paragraph. Absent on \"remove\". Text from whoever had the link; apply any of the three with POST /sites/{idOrSlug}/feedback/apply."
    },
    "apply_check": {
      "type": "object",
      "description": "Open suggested edits only: whether applying it now would swap the words in one step.",
      "properties": {
        "ok": {
          "type": "boolean"
        },
        "reason": {
          "type": "string",
          "enum": [
            "not_found",
            "ambiguous",
            "crosses_formatting",
            "other_page",
            "not_a_suggestion"
          ],
          "description": "Why not, when ok is false."
        },
        "message": {
          "type": "string"
        },
        "warnings": {
          "type": "array",
          "description": "When ok is true: what applying it would break that the page marks. Applying still works; tell the owner first.",
          "items": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "drops_placeholder",
                  "drops_kept",
                  "over_limit"
                ],
                "description": "drops_placeholder: the new wording leaves out a placeholder or merge field such as [brand phone] or {first_name}. drops_kept: it changes words marked data-stacktree-keep. over_limit: the text it sits in would pass its data-stacktree-max character limit."
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "created_at": {
      "type": "integer"
    },
    "updated_at": {
      "type": [
        "integer",
        "null"
      ]
    },
    "resolved_at": {
      "type": [
        "integer",
        "null"
      ]
    },
    "resolved_note": {
      "type": [
        "string",
        "null"
      ]
    }
  }
}