{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/whatsync-app/json-schema/whatsync-app-send-template-request-schema.json",
  "title": "SendTemplateRequest",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/whatsync-app-openapi.json#/components/schemas/SendTemplateRequest",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "phoneNumber",
    "templateName"
  ],
  "properties": {
    "phoneNumber": {
      "type": "string",
      "minLength": 1,
      "description": "Destination phone number, preferably in E.164 format."
    },
    "templateName": {
      "type": "string",
      "minLength": 1,
      "description": "Name of a Meta-approved template."
    },
    "parameters": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Template body values. param_0, param_1, and so on preserve order."
    },
    "language": {
      "type": "string",
      "default": "en",
      "description": "Approved template language code."
    },
    "header": {
      "$ref": "#/$defs/TemplateHeader"
    }
  },
  "$defs": {
    "TemplateHeader": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "text",
            "image",
            "video",
            "document"
          ]
        },
        "text": {
          "type": "string",
          "minLength": 1
        },
        "link": {
          "type": "string",
          "format": "uri"
        },
        "id": {
          "type": "string",
          "minLength": 1
        },
        "filename": {
          "type": "string",
          "minLength": 1
        }
      },
      "description": "Template header. Text headers require text. Media headers require either link or id. A linked document also requires filename."
    }
  }
}