{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/izap-ai/json-schema/izap-ai-whats-app-template-update-schema.json",
  "title": "WhatsAppTemplateUpdate",
  "description": "Partial update. Content edits to APPROVED/PAUSED templates are sent to Meta immediately.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/izap-ai-openapi.json#/components/schemas/WhatsAppTemplateUpdate",
  "properties": {
    "body_text": {
      "anyOf": [
        {
          "maxLength": 1024,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Body Text"
    },
    "buttons": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/TemplateButton"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Buttons"
    },
    "call_permission_request": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Call Permission Request"
    },
    "category": {
      "anyOf": [
        {
          "$ref": "#/$defs/TemplateCategory"
        },
        {
          "type": "null"
        }
      ]
    },
    "display_name": {
      "anyOf": [
        {
          "maxLength": 512,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Display Name"
    },
    "example_variables": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Example Variables"
    },
    "footer_text": {
      "anyOf": [
        {
          "maxLength": 60,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Footer Text"
    },
    "header_format": {
      "anyOf": [
        {
          "$ref": "#/$defs/TemplateHeaderFormat"
        },
        {
          "type": "null"
        }
      ]
    },
    "header_media_document_id": {
      "anyOf": [
        {
          "format": "uuid",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Header Media Document Id"
    },
    "header_text": {
      "anyOf": [
        {
          "maxLength": 60,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Header Text"
    },
    "language": {
      "anyOf": [
        {
          "maxLength": 10,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Language"
    }
  },
  "type": "object",
  "$defs": {
    "TemplateButton": {
      "description": "A single template button.\n\n``type`` is one of QUICK_REPLY, URL, PHONE_NUMBER, VOICE_CALL, FLOW, REQUEST_CONTACT_INFO, ORDER_DETAILS. URL/PHONE_NUMBER\nbuttons carry the corresponding ``url``/``phone_number`` field; FLOW buttons carry\n``flow_id`` and, when navigating, ``navigate_screen``. REQUEST_CONTACT_INFO has no\n``text`` because Meta sets its label. Combination rules are checked\non submission by ``validate_for_submission``.",
      "properties": {
        "flow_action": {
          "anyOf": [
            {
              "enum": [
                "navigate",
                "data_exchange"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Flow Action"
        },
        "flow_id": {
          "anyOf": [
            {
              "maxLength": 64,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Flow Id"
        },
        "navigate_screen": {
          "anyOf": [
            {
              "maxLength": 128,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Navigate Screen"
        },
        "phone_number": {
          "anyOf": [
            {
              "maxLength": 20,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Phone Number"
        },
        "text": {
          "default": "",
          "maxLength": 25,
          "title": "Text",
          "type": "string"
        },
        "type": {
          "description": "QUICK_REPLY | URL | PHONE_NUMBER | VOICE_CALL | FLOW | REQUEST_CONTACT_INFO | ORDER_DETAILS",
          "title": "Type",
          "type": "string"
        },
        "url": {
          "anyOf": [
            {
              "maxLength": 2000,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Url"
        }
      },
      "required": [
        "type"
      ],
      "title": "TemplateButton",
      "type": "object"
    },
    "TemplateCategory": {
      "description": "WhatsApp/Meta template category. Drives approval rules and pricing.",
      "enum": [
        "marketing",
        "utility",
        "authentication"
      ],
      "title": "TemplateCategory",
      "type": "string"
    },
    "TemplateHeaderFormat": {
      "enum": [
        "none",
        "text",
        "image",
        "video",
        "document"
      ],
      "title": "TemplateHeaderFormat",
      "type": "string"
    }
  }
}