{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/reviewflowz-com/json-schema/reviewflowz-com-review-schema.json",
  "title": "Review",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/reviewflowz-com-openapi.json#/components/schemas/Review",
  "type": "object",
  "required": [
    "id",
    "source",
    "platform",
    "rating",
    "created_at",
    "updated_at"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "source": {
      "type": "string"
    },
    "platform": {
      "type": "string"
    },
    "location": {
      "type": [
        "string",
        "null"
      ]
    },
    "rating": {
      "type": [
        "number",
        "null"
      ]
    },
    "title": {
      "type": [
        "string",
        "null"
      ]
    },
    "text": {
      "type": [
        "string",
        "null"
      ]
    },
    "pros": {
      "type": [
        "string",
        "null"
      ]
    },
    "cons": {
      "type": [
        "string",
        "null"
      ]
    },
    "language": {
      "type": [
        "string",
        "null"
      ],
      "description": "ISO 639-1."
    },
    "reviewer": {
      "type": "object",
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "company": {
          "type": [
            "string",
            "null"
          ]
        },
        "avatar_url": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "url": {
      "type": [
        "string",
        "null"
      ]
    },
    "date": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Posted on the platform."
    },
    "removed": {
      "type": "boolean"
    },
    "removed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "previous_version": {
      "type": [
        "string",
        "null"
      ],
      "description": "The version this edit replaced."
    },
    "root_review": {
      "type": "string",
      "description": "The first version of this review."
    },
    "latest_version": {
      "type": "boolean"
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      }
    },
    "owners": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      }
    },
    "owner_suggestions": {
      "type": "array",
      "description": "Owners we think the review mentions, waiting to be accepted or rejected (POST /owner-suggestions/{id}/accept or reject).",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "owner": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            }
          },
          "certainty": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      }
    },
    "topics": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "topic": {
            "type": "string"
          },
          "subtopic": {
            "type": "string"
          },
          "sentiment": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "positive",
              "negative",
              "neutral",
              null
            ]
          },
          "sentiment_score": {
            "type": [
              "number",
              "null"
            ]
          },
          "excerpt": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Found by Reviewflowz."
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "The latest change: found, edited, removed, reinstated, replied to, tagged or given an owner. updated_after= returns the reviews whose updated_at is after its time. Start your next sync from when this one started, not from the largest updated_at: a change made while you page can land on a page you've already read."
    },
    "columns": {
      "type": "object",
      "description": "columns= only: each requested export column, as a CSV export writes it (null where no source of the account fills it).",
      "additionalProperties": true
    },
    "media": {
      "type": "object",
      "description": "include=media",
      "properties": {
        "photos": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string"
              }
            }
          }
        },
        "videos": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "reply": {
      "description": "include=reply. The current reply, or null.",
      "oneOf": [
        {
          "$ref": "#/$defs/Reply"
        },
        {
          "type": "null"
        }
      ]
    },
    "events": {
      "type": "array",
      "description": "include=events. The review's history, oldest first, named like the webhook events.",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "reason": {
            "type": "string"
          }
        }
      }
    }
  },
  "$defs": {
    "Reply": {
      "type": "object",
      "required": [
        "review",
        "origin",
        "status"
      ],
      "properties": {
        "id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Null for a reply written directly on the platform."
        },
        "review": {
          "type": "string"
        },
        "origin": {
          "type": "string",
          "enum": [
            "reviewflowz",
            "platform"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "draft",
            "submitted",
            "published",
            "failed"
          ]
        },
        "text": {
          "type": [
            "string",
            "null"
          ]
        },
        "author": {
          "description": "Who wrote it (ReplySerializer#author): a team member, or the AI agent, for a reply written in Reviewflowz; the name the platform shows, or null, for one written on the platform.",
          "oneOf": [
            {
              "type": "object",
              "description": "A team member.",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "user"
                  ]
                },
                "name": {
                  "type": "string"
                }
              }
            },
            {
              "type": "object",
              "description": "The AI reply agent.",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "agent"
                  ]
                },
                "id": {
                  "type": "string",
                  "description": "The reply agent's id (GET /v3/reply-agents)."
                },
                "name": {
                  "type": "string"
                }
              }
            },
            {
              "type": "string",
              "description": "The replier's name as the platform shows it (origin platform)."
            },
            {
              "type": "null"
            }
          ]
        },
        "via": {
          "type": "string",
          "description": "Where it was written (reviewflowz, reply_rule, slack...)."
        },
        "published_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When it went live. Null until it does."
        },
        "editable": {
          "type": "boolean"
        },
        "deletable": {
          "type": "boolean"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  }
}