{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/keyshortcuts-net/json-schema/keyshortcuts-net-outreach-dashboard-schema.json",
  "title": "OutreachDashboard",
  "x-generated": "2026-11-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/keyshortcuts-net-openapi.json#/components/schemas/OutreachDashboard",
  "type": "object",
  "required": [
    "settings",
    "contacts",
    "suppression",
    "logs",
    "sentToday",
    "nextSendAt",
    "lastPollAt",
    "gmailStatus",
    "scheduler",
    "secretsConfigured"
  ],
  "properties": {
    "settings": {
      "$ref": "#/$defs/OutreachSettings"
    },
    "contacts": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/OutreachContact"
      }
    },
    "suppression": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/OutreachSuppression"
      }
    },
    "logs": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/OutreachLog"
      }
    },
    "sentToday": {
      "type": "integer"
    },
    "nextSendAt": {
      "type": [
        "string",
        "null"
      ]
    },
    "lastPollAt": {
      "type": [
        "string",
        "null"
      ]
    },
    "gmailStatus": {
      "type": "string"
    },
    "scheduler": {
      "type": "string"
    },
    "secretsConfigured": {
      "type": "boolean"
    }
  },
  "$defs": {
    "OutreachContact": {
      "type": "object",
      "required": [
        "id",
        "name",
        "email",
        "org",
        "role",
        "state",
        "matched_page_url",
        "status",
        "sent_at",
        "followup_at",
        "thread_id",
        "last_error"
      ],
      "properties": {
        "id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "org": {
          "type": "string"
        },
        "role": {
          "type": "string"
        },
        "state": {
          "type": "string"
        },
        "matched_page_url": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "new",
            "sent",
            "followed_up",
            "replied",
            "opted_out",
            "bounced"
          ]
        },
        "sent_at": {
          "type": [
            "string",
            "null"
          ]
        },
        "followup_at": {
          "type": [
            "string",
            "null"
          ]
        },
        "thread_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "last_error": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "OutreachLog": {
      "type": "object",
      "required": [
        "id",
        "contact_id",
        "kind",
        "outcome",
        "subject",
        "body",
        "created_at"
      ],
      "properties": {
        "id": {
          "type": "integer"
        },
        "contact_id": {
          "type": [
            "integer",
            "null"
          ]
        },
        "kind": {
          "type": "string"
        },
        "outcome": {
          "type": "string"
        },
        "subject": {
          "type": "string"
        },
        "body": {
          "type": "string"
        },
        "created_at": {
          "type": "string"
        }
      }
    },
    "OutreachSettings": {
      "type": "object",
      "required": [
        "paused",
        "dryRun",
        "mailingAddress",
        "firstSubject",
        "firstBody",
        "followupBody",
        "credentialMode",
        "senderEmail"
      ],
      "properties": {
        "paused": {
          "type": "boolean"
        },
        "dryRun": {
          "type": "boolean"
        },
        "mailingAddress": {
          "type": "string"
        },
        "firstSubject": {
          "type": "string"
        },
        "firstBody": {
          "type": "string"
        },
        "followupBody": {
          "type": "string"
        },
        "credentialMode": {
          "type": "string",
          "enum": [
            "integration",
            "secrets"
          ]
        },
        "senderEmail": {
          "type": "string"
        }
      }
    },
    "OutreachSuppression": {
      "type": "object",
      "required": [
        "value",
        "reason"
      ],
      "properties": {
        "value": {
          "type": "string"
        },
        "reason": {
          "type": "string"
        }
      }
    }
  }
}