{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/anjal-app/json-schema/anjal-app-inbox-schema.json",
  "title": "Inbox",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/anjal-app-inboxes-api-openapi.yml#/components/schemas/Inbox",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "email": {
      "type": "string",
      "description": "Current primary outbound address — may be a custom-domain alias."
    },
    "canonicalEmail": {
      "type": "string",
      "description": "Stable identity used for IMAP/SMTP auth. Never changes after creation."
    },
    "username": {
      "type": "string"
    },
    "domain": {
      "type": "string"
    },
    "displayName": {
      "type": "string"
    },
    "workspaceId": {
      "type": "string",
      "format": "uuid"
    },
    "addresses": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/InboxAddress"
      }
    },
    "imapPassword": {
      "type": "string",
      "description": "Only returned on creation and GET /inboxes/{id}. Stored plaintext so IMAP clients can log in."
    },
    "imap": {
      "$ref": "#/$defs/ImapCreds"
    },
    "smtp": {
      "$ref": "#/$defs/SmtpCreds"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "ImapCreds": {
      "type": "object",
      "properties": {
        "host": {
          "type": "string"
        },
        "port": {
          "type": "integer"
        },
        "tls": {
          "type": "boolean"
        },
        "username": {
          "type": "string"
        },
        "password": {
          "type": "string"
        }
      }
    },
    "InboxAddress": {
      "type": "object",
      "properties": {
        "address": {
          "type": "string"
        },
        "isPrimary": {
          "type": "boolean"
        }
      }
    },
    "SmtpCreds": {
      "type": "object",
      "properties": {
        "host": {
          "type": "string"
        },
        "port": {
          "type": "integer"
        },
        "starttls": {
          "type": "boolean"
        },
        "username": {
          "type": "string"
        },
        "password": {
          "type": "string"
        }
      }
    }
  }
}