{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/postzen-dev/json-schema/postzen-dev-inbox-comments-response-schema.json",
  "title": "InboxCommentsResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/postzen-dev-inbox-api-openapi.yml#/components/schemas/InboxCommentsResponse",
  "type": "object",
  "required": [
    "status",
    "comments",
    "pagination",
    "meta"
  ],
  "properties": {
    "status": {
      "type": "string",
      "const": "success"
    },
    "comments": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/InboxComment"
      }
    },
    "pagination": {
      "type": "object",
      "required": [
        "hasMore"
      ],
      "properties": {
        "hasMore": {
          "type": "boolean",
          "description": "True when the platform has another page of comments."
        },
        "cursor": {
          "type": "string",
          "description": "Opaque cursor for the next page. Present only when `hasMore` is true."
        }
      }
    },
    "meta": {
      "type": "object",
      "required": [
        "platform",
        "postId",
        "accountId",
        "lastUpdated"
      ],
      "properties": {
        "platform": {
          "type": "string",
          "enum": [
            "instagram",
            "facebook",
            "threads"
          ],
          "description": "Platform the comment lives on."
        },
        "postId": {
          "type": "string",
          "description": "Platform post id the comments were read from. When a PostZen post id was supplied it is the resolved platform id, not the id you sent."
        },
        "accountId": {
          "type": "string",
          "description": "PostZen account id used for the read."
        },
        "lastUpdated": {
          "type": "string",
          "format": "date-time",
          "description": "When PostZen fetched this page from the platform."
        }
      }
    }
  },
  "$defs": {
    "InboxComment": {
      "type": "object",
      "description": "A comment or reply normalized to one shape across Instagram, Facebook, and Threads. A field the platform does not report is absent rather than zero.",
      "required": [
        "id",
        "message",
        "createdTime",
        "from",
        "platform",
        "replies",
        "repliesHasMore",
        "canReply",
        "canDelete",
        "canHide",
        "isHidden",
        "parentId"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Platform comment id. Pass it as `commentId` to the reply, delete, and hide endpoints."
        },
        "message": {
          "type": "string",
          "description": "Comment body as plain text."
        },
        "createdTime": {
          "type": "string",
          "format": "date-time",
          "description": "When the platform recorded the comment."
        },
        "from": {
          "type": "object",
          "description": "Author of the comment.",
          "required": [
            "isOwner"
          ],
          "properties": {
            "id": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "username": {
              "type": "string"
            },
            "picture": {
              "type": "string",
              "format": "uri"
            },
            "isOwner": {
              "type": "boolean",
              "description": "True when the connected account wrote the comment."
            }
          }
        },
        "likeCount": {
          "type": "integer",
          "description": "Likes on the comment, when the platform reports a count. Threads never does."
        },
        "replyCount": {
          "type": "integer",
          "description": "Replies to the comment, when the platform reports a count."
        },
        "platform": {
          "type": "string",
          "enum": [
            "instagram",
            "facebook",
            "threads"
          ],
          "description": "Platform the comment lives on."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "Permalink to the comment, when the platform returns one."
        },
        "replies": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/InboxComment"
          },
          "description": "First page of nested replies, when the listing returned them cheaply. Instagram threads are two levels deep, so a reply's own `replies` is always empty."
        },
        "repliesHasMore": {
          "type": "boolean",
          "description": "True when the comment has replies beyond the ones in `replies`. Fetch them by passing this comment's id as `commentId`."
        },
        "canReply": {
          "type": "boolean",
          "description": "True when the connected account's granted scopes and the platform's own rules allow replying to this comment."
        },
        "canDelete": {
          "type": "boolean",
          "description": "True when this comment can be deleted. Facebook reports it per comment; Threads reports it only for replies the connected account wrote."
        },
        "canHide": {
          "type": "boolean",
          "description": "True when this comment can be hidden. Facebook reports it per comment; on Threads only top-level replies on the account's own posts qualify."
        },
        "isHidden": {
          "type": "boolean",
          "description": "True when the comment is currently hidden. Threads' `HIDDEN` and `COVERED` states both map to true."
        },
        "parentId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Comment this one replies to, or `null` when it is a top-level comment on the post."
        }
      }
    }
  }
}