{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mojeeb-app/json-schema/mojeeb-app-comment-schema.json",
  "title": "Comment",
  "description": "A Facebook or Instagram comment on one of the agent's pages, with the reply under it and its moderation.",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mojeeb-app-openapi.yaml#/components/schemas/Comment",
  "type": "object",
  "required": [
    "id",
    "agent_id",
    "platform",
    "post_id",
    "platform_comment_id",
    "parent_platform_comment_id",
    "text",
    "author",
    "reply",
    "moderation",
    "commented_at",
    "created_at"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "agent_id": {
      "type": "string",
      "format": "uuid"
    },
    "platform": {
      "type": "string",
      "description": "`facebook` or `instagram`."
    },
    "post_id": {
      "type": "string",
      "format": "uuid",
      "description": "Mojeeb's id for the post the comment is on; filter `listComments` with it."
    },
    "platform_comment_id": {
      "type": "string",
      "description": "Facebook's or Instagram's id for the comment."
    },
    "parent_platform_comment_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "For a reply to another comment, the platform's id of that comment; null for a comment on the post itself."
    },
    "text": {
      "type": [
        "string",
        "null"
      ],
      "description": "What the commenter wrote."
    },
    "author": {
      "type": "object",
      "required": [
        "name",
        "username"
      ],
      "description": "Who wrote the comment, as the platform names them.",
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "username": {
          "type": [
            "string",
            "null"
          ],
          "description": "The platform's username, when it gives one."
        }
      }
    },
    "reply": {
      "type": "object",
      "required": [
        "status",
        "text",
        "replied_at"
      ],
      "description": "The reply under the comment, by the AI or a teammate.",
      "properties": {
        "status": {
          "type": "string",
          "description": "`pending` (waiting for a reply), `processing`, `replied`, `failed` or `skipped` (no reply: replies are off, the comment is hidden, a usage limit was reached, or there was nothing to say); new values may appear. It tracks the reply only, so a hidden comment can be `skipped`, `failed` or `replied`."
        },
        "text": {
          "type": [
            "string",
            "null"
          ],
          "description": "The reply posted, once there is one."
        },
        "replied_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "moderation": {
      "type": "object",
      "required": [
        "status",
        "hidden_at",
        "hidden_by",
        "reason"
      ],
      "description": "The comment's moderation, by auto-hide, a teammate or the platform.",
      "properties": {
        "status": {
          "type": [
            "string",
            "null"
          ],
          "description": "`kept` (the AI checked it and left it visible), `hidden`, `unhidden` (hidden, then shown again by a teammate or on the platform; never auto-hidden again) or `failed` (the check or the hide didn't work). Null when it wasn't checked, for example because auto-hide was off. New values may appear."
        },
        "hidden_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When it was hidden; null unless `status` is `hidden`."
        },
        "hidden_by": {
          "type": [
            "string",
            "null"
          ],
          "description": "`ai` (auto-hide), `user` (a teammate, or a key through `hideComment`) or `platform` (Facebook's own filter, or someone in Meta Business Suite); null unless `status` is `hidden`. New values may appear."
        },
        "reason": {
          "type": [
            "string",
            "null"
          ],
          "description": "The AI's one-line reason whenever it decided to hide the comment, also when the hide failed or the platform had hidden it already. It stays after an unhide, so you can still see why."
        }
      }
    },
    "commented_at": {
      "type": "string",
      "format": "date-time",
      "description": "When the commenter posted it."
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "When Mojeeb received it."
    }
  }
}