{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/forward-email/main/json-schema/forward-email-alias-account-schema.json",
  "title": "AliasAccount",
  "x-generated": "2026-10-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/forward-email-openapi.json#/components/schemas/AliasAccount",
  "type": "object",
  "required": [
    "id",
    "object",
    "name",
    "email",
    "domain_id",
    "domain_name",
    "storage_used",
    "storage_quota"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Alias ID"
    },
    "object": {
      "type": "string",
      "description": "Object type"
    },
    "name": {
      "type": "string",
      "description": "Alias name (local part of email)"
    },
    "email": {
      "type": "string",
      "format": "email",
      "description": "Full alias email address"
    },
    "domain_id": {
      "type": "string",
      "description": "Domain ID"
    },
    "domain_name": {
      "type": "string",
      "description": "Domain name"
    },
    "storage_used": {
      "type": "integer",
      "format": "int64",
      "description": "Storage used in bytes for this alias/mailbox"
    },
    "storage_quota": {
      "type": "integer",
      "format": "int64",
      "description": "Storage quota in bytes for this alias/mailbox"
    },
    "has_imap": {
      "type": "boolean",
      "description": "Whether IMAP is enabled for this alias"
    },
    "has_pgp": {
      "type": "boolean",
      "description": "Whether PGP encryption is enabled"
    },
    "public_key": {
      "type": "string",
      "description": "PGP public key if available"
    },
    "has_smime": {
      "type": "boolean",
      "description": "Whether S/MIME encryption is enabled"
    },
    "smime_certificate": {
      "type": "string",
      "description": "S/MIME X.509 certificate in PEM format"
    },
    "has_wkd_disabled": {
      "type": "boolean",
      "description": "Whether WKD (Web Key Directory) public key lookup is disabled for this alias"
    },
    "locale": {
      "type": "string",
      "description": "Locale preference"
    },
    "settings": {
      "type": "object",
      "description": "Alias settings",
      "properties": {
        "mail": {
          "type": "object",
          "properties": {
            "archive_folder": {
              "type": [
                "string",
                "null"
              ],
              "description": "Alias mail archive folder"
            },
            "sent_folder": {
              "type": [
                "string",
                "null"
              ],
              "description": "Alias mail sent folder"
            },
            "drafts_folder": {
              "type": [
                "string",
                "null"
              ],
              "description": "Alias mail drafts folder"
            }
          }
        },
        "label_settings": {
          "type": "object",
          "description": "Alias label map keyed by keyword",
          "additionalProperties": {
            "$ref": "#/$defs/SettingsLabelUpdate"
          }
        },
        "aliases": {
          "type": "object",
          "properties": {
            "defaults": {
              "type": "object",
              "description": "Free-form alias defaults such as display_name or signature.",
              "additionalProperties": true
            }
          }
        }
      }
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Creation timestamp"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Last update timestamp"
    }
  },
  "$defs": {
    "SettingsLabelUpdate": {
      "type": "object",
      "description": "Fields allowed when updating a label definition.",
      "properties": {
        "name": {
          "type": "string",
          "description": "Human-readable label name shown in the UI"
        },
        "color": {
          "type": "string",
          "pattern": "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$",
          "description": "Hex color used for UI rendering"
        },
        "hidden": {
          "type": "boolean",
          "description": "Hide the label in the UI while preserving the keyword"
        },
        "source": {
          "type": "string",
          "description": "Label origin for filtering and migrations",
          "enum": [
            "custom",
            "system",
            "imported"
          ]
        }
      }
    }
  }
}