{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/talkjs/json-schema/talkjs-send-message-input-schema.json",
  "title": "SendMessageInput",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/talkjs-messages-api-openapi.yml#/components/schemas/SendMessageInput",
  "type": "object",
  "required": [
    "type"
  ],
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "UserMessage",
        "SystemMessage"
      ]
    },
    "text": {
      "type": "string",
      "description": "The message text. Mutually exclusive with content."
    },
    "content": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Rich content blocks. Mutually exclusive with text."
    },
    "sender": {
      "type": "string",
      "description": "Sender user id; required for UserMessage, omitted for SystemMessage."
    },
    "referencedMessageId": {
      "type": [
        "string",
        "null"
      ]
    },
    "custom": {
      "$ref": "#/$defs/Custom"
    },
    "idempotencyKey": {
      "type": "string",
      "description": "Ensures exactly-once delivery for 24 hours."
    }
  },
  "$defs": {
    "Custom": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Custom key-value metadata (string values)."
    }
  }
}