{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/postplanify-com/json-schema/postplanify-com-conversation-schema.json",
  "title": "Conversation",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/postplanify-com-api-openapi.json#/components/schemas/Conversation",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Conversation ID. Use it in the other `/conversations` endpoints."
    },
    "workspaceId": {
      "type": "string",
      "format": "uuid"
    },
    "participant": {
      "type": "object",
      "description": "The customer on the other side of the conversation.",
      "properties": {
        "id": {
          "type": "string",
          "description": "Platform-scoped user ID (Instagram IGSID or Facebook PSID)."
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "username": {
          "type": [
            "string",
            "null"
          ],
          "description": "Instagram handle. Always `null` for Facebook, which does not share one."
        },
        "profilePictureUrl": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "lastMessagePreview": {
      "type": [
        "string",
        "null"
      ]
    },
    "lastMessageAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "lastCustomerMessageAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the customer last wrote. The 24-hour reply window counts from this time."
    },
    "messageCount": {
      "type": "integer"
    },
    "isRead": {
      "type": "boolean",
      "description": "Internal read state in PostPlanify. Not shown to the customer."
    },
    "needsReply": {
      "type": "boolean",
      "description": "True when the latest message is from the customer and nobody has answered yet."
    },
    "replyWindow": {
      "type": "object",
      "description": "Instagram and Facebook only allow a business to reply within 24 hours of the customer's last message. Check `canReply` before sending.\n",
      "properties": {
        "canReply": {
          "type": "boolean"
        },
        "expiresAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When the window closes, or `null` if it is already closed."
        }
      }
    },
    "label": {
      "type": [
        "object",
        "null"
      ],
      "description": "The inbox label set on this conversation in PostPlanify.",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "type": "string"
        },
        "color": {
          "type": "string"
        }
      }
    },
    "assignedTo": {
      "type": [
        "object",
        "null"
      ],
      "description": "The teammate this conversation is assigned to.",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "fullName": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "socialAccount": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "platform": {
          "type": "string",
          "enum": [
            "INSTAGRAM",
            "FACEBOOK"
          ]
        },
        "accountName": {
          "type": "string"
        },
        "profilePictureUrl": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    }
  }
}