{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sentfrom-ai/json-schema/sentfrom-ai-account-status-schema.json",
  "title": "AccountStatus",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sentfrom-ai-openapi.json#/components/schemas/AccountStatus",
  "type": "object",
  "properties": {
    "tenant_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "onboarding_state": {
      "type": "string",
      "enum": [
        "unclaimed",
        "claimed"
      ]
    },
    "claimed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "sending_enabled_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Claim-time start of sending warmup for agent-created accounts."
    },
    "unclaimed_expires_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "expired": {
      "type": "boolean"
    },
    "capabilities": {
      "$ref": "#/$defs/AccountCapabilities"
    },
    "limits": {
      "$ref": "#/$defs/AccountLimits"
    },
    "usage": {
      "type": "object",
      "properties": {
        "received_messages": {
          "type": "integer",
          "minimum": 0
        },
        "received_bytes": {
          "type": "integer",
          "minimum": 0
        }
      },
      "required": [
        "received_messages",
        "received_bytes"
      ],
      "description": "Counters consumed by the unclaimed onboarding receive quota. These are not lifetime or billing usage after claim."
    },
    "inboxes": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AccountInbox"
      }
    },
    "sending_status": {
      "type": "string",
      "enum": [
        "enabled",
        "paused",
        "unclaimed",
        "expired",
        "suspended"
      ],
      "description": "Current sending readiness. Check this together with capabilities.send; enabled remains subject to plan, warming, suppression and abuse checks."
    },
    "sending_paused_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When sending was paused, or null if no current pause is recorded."
    }
  },
  "required": [
    "tenant_id",
    "name",
    "onboarding_state",
    "claimed_at",
    "sending_enabled_at",
    "unclaimed_expires_at",
    "expired",
    "capabilities",
    "limits",
    "usage",
    "inboxes",
    "sending_status",
    "sending_paused_at"
  ],
  "$defs": {
    "AccountCapabilities": {
      "type": "object",
      "properties": {
        "receive": {
          "type": "boolean",
          "description": "Account may receive, subject to quotas and message limits."
        },
        "read": {
          "type": "boolean",
          "description": "Account may read its existing inbox and mail."
        },
        "send": {
          "type": "boolean",
          "description": "Account ownership and sending status permit sending. False while paused. Plan, warming, suppression and abuse checks still apply."
        },
        "manage": {
          "type": "boolean",
          "description": "Ownership permits resource mutations; plan limits still apply. Unclaimed accounts may only refresh claim links."
        }
      },
      "required": [
        "receive",
        "read",
        "send",
        "manage"
      ]
    },
    "AccountInbox": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "address": {
          "type": "string",
          "format": "email"
        }
      },
      "required": [
        "id",
        "address"
      ]
    },
    "AccountLimits": {
      "type": "object",
      "properties": {
        "inboxes": {
          "type": "integer",
          "minimum": 1,
          "description": "Inbox cap. One while unclaimed; plan-specific after claim."
        },
        "received_messages": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0,
          "description": "Cumulative unclaimed inbound message cap, default 50. Null means no onboarding-specific cap; plan limits still apply."
        },
        "received_bytes": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0,
          "description": "Cumulative unclaimed inbound byte cap, default 10485760 (10 MiB). Null after claim; plan limits still apply."
        }
      },
      "required": [
        "inboxes",
        "received_messages",
        "received_bytes"
      ]
    }
  }
}