{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/telesign/json-schema/telesign-template-record-schema.json",
  "title": "TemplateRecord",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/telesign-templates-api-openapi.yml#/components/schemas/TemplateRecord",
  "allOf": [
    {
      "$ref": "#/$defs/TemplateDetails"
    },
    {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "description": "The place of this template in Telesign's approval process. Note that WhatsApp templates used to initiate a conversation with a user also must be approved by WhatsApp. Telesign submits these templates for approval on your behalf and passes through the WhatsApp approval status in this same property."
        },
        "mandatory_parameters": {
          "type": "array",
          "description": "Lists each parameter you must include when you use this template in a Telesign Messaging request.",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "status",
        "mandatory_parameters"
      ]
    }
  ],
  "$defs": {
    "Template": {
      "title": "Template",
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "pattern": "^[a-z_]*",
          "description": "The name of this template. Use only lowercase alpha characters and underscores. For WhatsApp, the name must include \"telesign_otp\" if you want Telesign to generate the OTP for you. For example: \"verofinto_telesign_otp_wa_template\". To enable this feature and create SMS templates with the OTP auto-generated by Telesign, contact our [Customer Support Team](mailto:support@telesign.com).",
          "maxLength": 512
        }
      },
      "required": [
        "name"
      ]
    },
    "TemplateDetails": {
      "title": "TemplateDetails",
      "allOf": [
        {
          "$ref": "#/$defs/Template"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "description": "Specifies whether the template requires verification by the channel provider or not.",
              "enum": [
                "standard",
                "verified"
              ]
            },
            "channel": {
              "type": "string",
              "enum": [
                "whatsapp",
                "sms"
              ],
              "description": "The channel the template is used with. Each template can only be used with one channel. "
            },
            "category": {
              "type": "string",
              "description": "The category name specifying this template's use case. Only required for WhatsApp templates. Do not include any whitespace characters.",
              "enum": [
                "marketing",
                "utility",
                "authentication",
                "1way"
              ]
            },
            "language": {
              "type": "string",
              "description": "An abbreviation specifying the language of the text in the template. This is required for WhatsApp templates and not supported for other templates. See  [Messaging - Supported languages for WhatsApp templates](/enterprise/docs/messaging-supported-languages-for-whatsapp-templates) for a list of valid abbreviations. "
            }
          },
          "required": [
            "type",
            "channel"
          ]
        }
      ]
    }
  }
}