{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nudgelink-co/json-schema/nudgelink-co-message-out-schema.json",
  "title": "MessageOut",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nudgelink-co-openapi.json#/components/schemas/MessageOut",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
    },
    "sequence_id": {
      "type": "string",
      "format": "uuid",
      "title": "Sequence Id"
    },
    "step": {
      "$ref": "#/$defs/OutreachStep"
    },
    "channel": {
      "$ref": "#/$defs/MessageChannel"
    },
    "direction": {
      "$ref": "#/$defs/MessageDirection"
    },
    "content": {
      "type": "string",
      "title": "Content"
    },
    "subject": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Subject"
    },
    "content_ai_original": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Content Ai Original"
    },
    "message_angle": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Message Angle"
    },
    "classification": {
      "anyOf": [
        {
          "$ref": "#/$defs/MessageClassification"
        },
        {
          "type": "null"
        }
      ]
    },
    "preview_status": {
      "anyOf": [
        {
          "$ref": "#/$defs/MessagePreviewStatus"
        },
        {
          "type": "null"
        }
      ]
    },
    "preview_expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Preview Expires At"
    },
    "sent_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Sent At"
    },
    "sent_manually": {
      "type": "boolean",
      "title": "Sent Manually"
    },
    "send_skipped": {
      "type": "boolean",
      "title": "Send Skipped",
      "default": false
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "external_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "External Url"
    },
    "source_post_text": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Source Post Text"
    },
    "source_post_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Source Post Url"
    }
  },
  "type": "object",
  "required": [
    "id",
    "sequence_id",
    "step",
    "channel",
    "direction",
    "content",
    "content_ai_original",
    "message_angle",
    "classification",
    "preview_status",
    "preview_expires_at",
    "sent_at",
    "sent_manually",
    "created_at"
  ],
  "$defs": {
    "MessageChannel": {
      "type": "string",
      "enum": [
        "linkedin",
        "email"
      ],
      "title": "MessageChannel"
    },
    "MessageClassification": {
      "type": "string",
      "enum": [
        "positive",
        "neutral",
        "question",
        "rejection",
        "spam",
        "unclassified"
      ],
      "title": "MessageClassification"
    },
    "MessageDirection": {
      "type": "string",
      "enum": [
        "outbound",
        "inbound"
      ],
      "title": "MessageDirection"
    },
    "MessagePreviewStatus": {
      "type": "string",
      "enum": [
        "pending",
        "approved",
        "edited_and_approved",
        "rejected",
        "auto_sent",
        "expired"
      ],
      "title": "MessagePreviewStatus"
    },
    "OutreachStep": {
      "type": "string",
      "enum": [
        "pending",
        "warmup_view",
        "warmup_like",
        "warmup_comment",
        "linkedin_invite",
        "linkedin_followup_1",
        "linkedin_followup_2",
        "email_1",
        "email_2",
        "completed"
      ],
      "title": "OutreachStep"
    }
  }
}