{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cubi-estate/json-schema/cubi-estate-admin-announce-request-schema.json",
  "title": "AdminAnnounceRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cubi-estate-admin-api-openapi.yml#/components/schemas/AdminAnnounceRequest",
  "properties": {
    "body": {
      "type": "string",
      "title": "Body",
      "description": "Message text. HTML by default (parse_mode)."
    },
    "targets": {
      "items": {
        "type": "string",
        "enum": [
          "channel",
          "subscribers",
          "whatsapp",
          "x",
          "email",
          "blog"
        ]
      },
      "type": "array",
      "title": "Targets",
      "description": "Where to send. channel = TG broadcast channel; subscribers = DM approved allow-list ids; x = post to X; email = confirmed newsletter list; blog = publish to the web blog (GET /blog)."
    },
    "title": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Title",
      "description": "Optional label stored in the audit log."
    },
    "lang": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Lang",
      "description": "ISO 639-1 tag (audit only; body is sent as-is).",
      "default": "en"
    },
    "channel_chat_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Channel Chat Id",
      "description": "Channel @username or numeric -100… id. Overrides TELEGRAM_ANNOUNCE_CHAT_ID."
    },
    "button_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Button Url",
      "description": "URL for an 'Open Cubi' button on the channel post. Overrides TELEGRAM_ANNOUNCE_BUTTON_URL."
    },
    "button_text": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Button Text",
      "description": "Label for the channel button. Defaults to TELEGRAM_ANNOUNCE_BUTTON_TEXT or 'Open Cubi 🐉'."
    },
    "x_text": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "X Text",
      "description": "≤280-char text posted to X (target 'x'). Falls back to the HTML-stripped, truncated body."
    },
    "dedup_key": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Dedup Key",
      "description": "Idempotency key; a re-fire with the same key is a no-op."
    },
    "parse_mode": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Parse Mode",
      "description": "'HTML' (default) or 'none' for plain text.",
      "default": "HTML"
    },
    "disable_preview": {
      "type": "boolean",
      "title": "Disable Preview",
      "description": "Suppress link preview (default true).",
      "default": true
    },
    "dry_run": {
      "type": "boolean",
      "title": "Dry Run",
      "description": "Validate + render, send nothing.",
      "default": false
    }
  },
  "type": "object",
  "required": [
    "body"
  ]
}