{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/lensmor/json-schema/lensmor-outreach-detail-schema.json",
  "title": "OutreachDetail",
  "description": "Latest generated outreach content and metadata for one personnel-event combination.",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/lensmor-openapi.json#/components/schemas/OutreachDetail",
  "type": "object",
  "required": [
    "found",
    "channels",
    "messages"
  ],
  "properties": {
    "found": {
      "type": "boolean",
      "description": "Whether generated outreach content exists for this personnel-event combination."
    },
    "channels": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Requested or available outreach content channels."
    },
    "messages": {
      "type": "object",
      "properties": {
        "email": {
          "type": [
            "string",
            "null"
          ],
          "description": "Email address when already accessible; otherwise `null`."
        },
        "linkedin_message": {
          "type": [
            "string",
            "null"
          ],
          "description": "Linkedin message returned as part of this outreach detail object."
        },
        "linkedin": {
          "type": "object",
          "properties": {
            "inmail": {
              "type": "object",
              "properties": {
                "subject": {
                  "type": "string",
                  "description": "Generated email or InMail subject when applicable."
                },
                "body": {
                  "type": "string",
                  "description": "Generated message body."
                }
              },
              "description": "Inmail returned as part of this outreach detail object."
            },
            "connection_note": {
              "type": "object",
              "properties": {
                "body": {
                  "type": "string",
                  "description": "Generated message body."
                }
              },
              "description": "Connection note returned as part of this outreach detail object."
            },
            "connected_message": {
              "type": "object",
              "properties": {
                "body": {
                  "type": "string",
                  "description": "Generated message body."
                }
              },
              "description": "Connected message returned as part of this outreach detail object."
            }
          },
          "description": "Linkedin returned as part of this outreach detail object."
        }
      },
      "description": "Generated outreach content organized by channel and message variant."
    },
    "reason": {
      "type": [
        "string",
        "null"
      ],
      "description": "Human-readable reason or absence explanation when available."
    },
    "sources": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Evidence or source references used during generation when available."
    },
    "outreach_purpose": {
      "type": [
        "string",
        "null"
      ],
      "description": "Purpose or offer context used to personalize the outreach."
    },
    "tone": {
      "type": [
        "string",
        "null"
      ],
      "description": "Tone selected or inferred for the generated content."
    },
    "status": {
      "type": [
        "string",
        "null"
      ],
      "description": "Current outreach message status, such as processing, ready, or failed. Null when no record exists."
    },
    "create_time": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int64",
      "description": "Record creation timestamp in milliseconds. Null when no record exists."
    },
    "update_time": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int64",
      "description": "Record update timestamp in milliseconds. Null when no record exists."
    }
  }
}