{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/oxvo-com/json-schema/oxvo-com-conversation-message-create-payload-schema.json",
  "title": "conversation_message_create_payload",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/oxvo-com-openapi.json#/components/schemas/conversation_message_create_payload",
  "type": "object",
  "required": [
    "content"
  ],
  "properties": {
    "content": {
      "type": "string",
      "description": "The content of the message"
    },
    "message_type": {
      "type": "string",
      "enum": [
        "outgoing",
        "incoming"
      ],
      "description": "The type of the message"
    },
    "private": {
      "type": "boolean",
      "description": "Flag to identify if it is a private note"
    },
    "content_type": {
      "type": "string",
      "enum": [
        "text",
        "input_email",
        "cards",
        "input_select",
        "form",
        "article"
      ],
      "description": "Content type of the message"
    },
    "content_attributes": {
      "type": "object",
      "description": "Attributes based on the content type"
    },
    "campaign_id": {
      "type": "integer",
      "description": "The campaign id to which the message belongs"
    },
    "template_params": {
      "type": "object",
      "description": "WhatsApp template parameters for sending structured messages",
      "required": [
        "name",
        "category",
        "language",
        "processed_params"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the WhatsApp template (must be approved in WhatsApp Business Manager)"
        },
        "category": {
          "type": "string",
          "enum": [
            "UTILITY",
            "MARKETING",
            "SHIPPING_UPDATE",
            "TICKET_UPDATE",
            "ISSUE_RESOLUTION"
          ],
          "description": "Category of the template"
        },
        "language": {
          "type": "string",
          "description": "Language code of the template (BCP 47 format)"
        },
        "processed_params": {
          "type": "object",
          "description": "Processed template parameters organized by component type",
          "properties": {
            "body": {
              "type": "object",
              "description": "Body component parameters with variable placeholders",
              "additionalProperties": {
                "type": "string"
              }
            },
            "header": {
              "type": "object",
              "description": "Header component parameters for media templates",
              "properties": {
                "media_url": {
                  "type": "string",
                  "format": "uri",
                  "description": "Publicly accessible URL for IMAGE, VIDEO, or DOCUMENT headers"
                },
                "media_type": {
                  "type": "string",
                  "enum": [
                    "image",
                    "video",
                    "document"
                  ],
                  "description": "Type of media for the header"
                }
              }
            },
            "buttons": {
              "type": "array",
              "description": "Button component parameters for interactive templates",
              "items": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "url",
                      "copy_code"
                    ],
                    "description": "Type of button parameter"
                  },
                  "parameter": {
                    "type": "string",
                    "description": "Dynamic parameter value for the button"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}