{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/talkjs/json-schema/talkjs-import-message-input-schema.json",
  "title": "ImportMessageInput",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/talkjs-import-api-openapi.yml#/components/schemas/ImportMessageInput",
  "allOf": [
    {
      "$ref": "#/$defs/SendMessageInput"
    },
    {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": "integer",
          "format": "int64",
          "description": "Original Unix timestamp in milliseconds to preserve."
        },
        "readBy": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }
  ],
  "$defs": {
    "Custom": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Custom key-value metadata (string values)."
    },
    "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."
        }
      }
    }
  }
}