{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/kawaa-com/json-schema/kawaa-com-email-activity-schema.json",
  "title": "EmailActivity",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/kawaa-com-activity-api-openapi.yml#/components/schemas/EmailActivity",
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "The validated address, echoed unchanged from the path. Malformed or whitespace-padded values are refused before the paid lookup begins. An internationalized domain is echoed in the spelling you sent, Unicode or `xn--`, so this deliberately has no `format: email`: a standard format validator would refuse a successful response for `user@münchen.de`."
    },
    "email_hash": {
      "type": "string"
    },
    "activity": {
      "$ref": "#/$defs/ActivityData"
    },
    "credits_used": {
      "type": "number"
    },
    "credits_remaining": {
      "type": "number",
      "description": "The account's balance after this call. On a charged lookup, the balance the charge left. On a replay (`idempotent_replay: true`), the current balance as read when the replay authenticated, or, for a copy racing the charge, the lower of that and what the charge left. Absent when the balance could not be read."
    },
    "idempotent_replay": {
      "type": "boolean",
      "description": "True when this repeated an earlier lookup and therefore charged nothing: one under the same `Idempotency-Key` (that receipt lasts about 24 hours), or, without a key, the same address looked up by the same account within 15 minutes of the lookup that was charged. **Absent means it was charged**: the field is added only on a replay. `credits_used: 0` alone cannot tell you which happened, because a lookup with nothing to bill also reports 0; this is the field that distinguishes them."
    }
  },
  "required": [
    "email",
    "activity",
    "credits_used"
  ],
  "$defs": {
    "ActivityData": {
      "type": "object",
      "properties": {
        "level": {
          "type": "string",
          "enum": [
            "active",
            "inactive",
            "dormant",
            "unknown"
          ],
          "description": "How recently this address was seen active. `inactive` sits between the active and dormant windows; `unknown` means there was nothing to judge from, not that the address is inactive."
        },
        "score": {
          "type": "number"
        },
        "last_activity_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "engagement": {
          "type": "object",
          "properties": {
            "open_count": {
              "type": "integer"
            },
            "click_count": {
              "type": "integer"
            },
            "reply_count": {
              "type": "integer",
              "description": "Counts replies recorded by Kawaa email warmup campaigns only. It is not a measurement of replies to your own mail, which Kawaa cannot see. Warmup is switched off, so no new replies are recorded, and new opens and clicks come only from your own tracking pixels and links."
            }
          },
          "required": [
            "open_count",
            "click_count",
            "reply_count"
          ]
        },
        "deliverability": {
          "type": "object",
          "properties": {
            "bounce_count": {
              "type": [
                "integer",
                "null"
              ]
            },
            "complaint_count": {
              "type": [
                "integer",
                "null"
              ]
            }
          },
          "required": [
            "bounce_count",
            "complaint_count"
          ]
        },
        "confidence": {
          "type": "number",
          "description": "0 means your account has recorded no activity for this address, not that it is inactive."
        },
        "data_points": {
          "type": "integer"
        },
        "message": {
          "type": "string",
          "description": "Present only when no activity data is available for a single-address lookup."
        }
      },
      "required": [
        "level",
        "score",
        "last_activity_at",
        "engagement",
        "deliverability",
        "confidence",
        "data_points"
      ]
    }
  }
}