{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mailshake-com/json-schema/mailshake-com-campaign-stats-schema.json",
  "title": "CampaignStats",
  "x-generated": "2026-12-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mailshake-com-openapi.json#/components/schemas/CampaignStats",
  "type": "object",
  "additionalProperties": true,
  "required": [
    "object",
    "campaignID",
    "from",
    "to",
    "timezone",
    "totals",
    "rates",
    "lifetime"
  ],
  "properties": {
    "object": {
      "const": "campaign-stats"
    },
    "campaignID": {
      "type": "integer"
    },
    "from": {
      "type": "string",
      "format": "date"
    },
    "to": {
      "type": "string",
      "format": "date"
    },
    "timezone": {
      "type": "string"
    },
    "totals": {
      "type": "object",
      "additionalProperties": true,
      "required": [
        "sent",
        "bounced",
        "delivered",
        "replied",
        "autoReplies",
        "opened",
        "clicked",
        "unsubscribed"
      ],
      "properties": {
        "sent": {
          "type": "integer"
        },
        "bounced": {
          "type": "integer"
        },
        "delivered": {
          "type": "integer"
        },
        "replied": {
          "type": "integer"
        },
        "autoReplies": {
          "type": "integer"
        },
        "opened": {
          "type": "integer"
        },
        "clicked": {
          "type": "integer"
        },
        "unsubscribed": {
          "type": "integer"
        }
      }
    },
    "rates": {
      "$ref": "#/$defs/StatsRates"
    },
    "lifetime": {
      "type": "object",
      "additionalProperties": true,
      "required": [
        "recipients",
        "sent",
        "opened",
        "clicked",
        "replied",
        "bounced",
        "unsubscribed",
        "tasksCompleted",
        "callsMade"
      ],
      "properties": {
        "recipients": {
          "type": "integer"
        },
        "sent": {
          "type": "integer"
        },
        "opened": {
          "type": "integer"
        },
        "clicked": {
          "type": "integer"
        },
        "replied": {
          "type": "integer"
        },
        "bounced": {
          "type": "integer"
        },
        "unsubscribed": {
          "type": "integer"
        },
        "tasksCompleted": {
          "type": "integer"
        },
        "callsMade": {
          "type": "integer"
        }
      }
    },
    "bySender": {
      "type": "array",
      "description": "Only with `bySender=true`.",
      "items": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "integrationID",
          "emailAddress",
          "sent",
          "bounced",
          "delivered",
          "replied",
          "bounceRate",
          "replyRate"
        ],
        "properties": {
          "integrationID": {
            "type": "integer"
          },
          "emailAddress": {
            "type": "string"
          },
          "sent": {
            "type": "integer"
          },
          "bounced": {
            "type": "integer"
          },
          "delivered": {
            "type": "integer"
          },
          "replied": {
            "type": "integer"
          },
          "bounceRate": {
            "type": [
              "number",
              "null"
            ]
          },
          "replyRate": {
            "type": [
              "number",
              "null"
            ]
          }
        }
      }
    }
  },
  "$defs": {
    "StatsRates": {
      "type": "object",
      "additionalProperties": true,
      "required": [
        "bounceRate",
        "replyRate"
      ],
      "properties": {
        "bounceRate": {
          "type": [
            "number",
            "null"
          ]
        },
        "replyRate": {
          "type": [
            "number",
            "null"
          ]
        }
      }
    }
  }
}