{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/inkseal-net/json-schema/inkseal-net-authorized-sender-schema.json",
  "title": "AuthorizedSender",
  "description": "One address the mail agent will accept documents from. The grant belongs to the workspace, and it authorizes nothing until a workspace person has approved it and the mailbox it names has confirmed it.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/inkseal-net-openapi.json#/components/schemas/AuthorizedSender",
  "type": "object",
  "required": [
    "id",
    "email",
    "kind",
    "status",
    "confirmationSentAt",
    "expiresAt",
    "lastUsedAt",
    "awaitingApproval",
    "createdAt",
    "updatedAt"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "The grant's public identifier."
    },
    "email": {
      "type": "string",
      "format": "email",
      "description": "The address mail must come from. Matching is case-insensitive, and one address can hold only one grant per workspace."
    },
    "kind": {
      "type": "string",
      "enum": [
        "owner",
        "alias",
        "delegate"
      ],
      "description": "`owner` is the workspace owner's own address, authorized by construction and neither enrollable nor revocable here. It authorizes only while it is still the owner's address; one left by a former owner or an old address authorizes nothing and can be revoked. `alias` is another address of someone already in the workspace, `delegate` is somebody else acting for it; the two carry identical trust and differ only as a label for the humans reading the list."
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "active",
        "revoked"
      ],
      "description": "`pending`: not yet confirmed, so mail from this address is still refused. Either a confirmation link was mailed and has not been used, or, when `awaitingApproval` is true, no link exists yet. `active`: confirmed, and mail from it is processed. `revoked`: it was trusted once and is not now."
    },
    "confirmationSentAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the most recent confirmation link was mailed."
    },
    "expiresAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "While `pending`, the deadline for using the confirmation link. Cleared on confirmation, so an active grant ordinarily carries none."
    },
    "lastUsedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When a message from this address was last accepted, or null if never."
    },
    "awaitingApproval": {
      "type": "boolean",
      "description": "True when this non-owner grant has no recorded workspace person approving it. No confirmation can activate it until an owner or admin approves in the dashboard. Legacy active rows lacking an approver also authorize nothing and require review."
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    }
  }
}