{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "replies": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "kind": {
                "type": ["string", "null"]
              },
              "occurred_at": {
                "type": ["string", "null"]
              },
              "recipient_email": {
                "type": ["string", "null"]
              },
              "enrollment_id": {
                "type": ["string", "null"]
              },
              "enrollment_status": {
                "type": ["string", "null"]
              },
              "intent": {
                "type": ["string", "null"]
              },
              "from_email": {
                "type": ["string", "null"]
              },
              "review": {
                "type": ["boolean", "null"]
              },
              "person": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "full_name": {
                        "type": ["string", "null"]
                      },
                      "job_title": {
                        "type": ["string", "null"]
                      },
                      "company_name": {
                        "type": ["string", "null"]
                      },
                      "company_domain": {
                        "type": ["string", "null"]
                      },
                      "linkedin_url": {
                        "type": ["string", "null"]
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "thread": {
                "default": null,
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "account_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      "thread_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      "provider": {
                        "type": "string",
                        "enum": ["gmail", "outlook", "instantly"]
                      }
                    },
                    "required": ["account_id", "thread_id", "provider"],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "additionalProperties": false
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "page": {
      "type": "object",
      "properties": {
        "page": {
          "type": ["number", "null"]
        },
        "size": {
          "type": ["number", "null"]
        },
        "total": {
          "type": ["number", "null"]
        },
        "next": {
          "type": ["string", "null"]
        },
        "nextCursor": {
          "type": ["string", "null"]
        },
        "after": {
          "type": ["string", "null"]
        },
        "hasMore": {
          "type": ["boolean", "null"]
        },
        "has_more": {
          "type": ["boolean", "null"]
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
