---
updatedAt: 2026-03-17T07:58:39.000Z
agentTools:
  projectIndex: https://developers.dexatel.com/llms.txt
---

# Create Template

<br />

<TitleSetter title="Create Verification Template | Dexatel API" />

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Verify APIs",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://api.dexatel.com",
      "description": "Server base url"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/v1/templates": {
      "post": {
        "tags": [
          "Verification Templates"
        ],
        "summary": "Create Template",
        "operationId": "create_template",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplatePostRequestWrapperDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateResponseWrapperDto"
                }
              }
            }
          },
          "400": {
            "description": "<p><strong>Bad Request:</strong> <table> <tr> <th>Code</th> <th>Message</th> <th>Description</th> </tr> <tr> <td>1241</td> <td>'data.wa_sender_code' required for WhatsApp template</td> <td></td> </tr> <tr> <td>1254</td> <td>'data.text' is required</td> <td>Required for SMS, WhatsApp and Viber(text) templates</td> </tr> <tr> <td>1256</td> <td>'data.channel' is required</td> <td></td> </tr> <tr> <td>1257</td> <td>'data.channel' value should be: [SMS, VIBER, WHATSAPP]</td> <td></td> </tr> <tr> <td>1259</td> <td>'data.name' is invalid</td> <td></td> </tr> <tr> <td>1260</td> <td>'data.text' is too long</td> <td>Text must be at most 1000 characters</td> </tr> <tr> <td>1261</td> <td>'data.name' is required</td> <td>For WhatsApp name is required</td> </tr> <tr> <td>1263</td> <td>'data.name' is too long</td> <td>Name must be at most 45 characters</td> </tr> <tr> <td>1264</td> <td>'data.url' is required</td> <td>Required for image, video and document templates without 'media_id'</td> </tr> <tr> <td>1265</td> <td>'data.url' is too long</td> <td>URL must be at most 2083 characters</td> </tr> <tr> <td>1266</td> <td>'data.url' contains invalid characters</td> <td>URL must be valid</td> </tr> <tr> <td>1267</td> <td>'data.filename' is required</td> <td>Required for document templates</td> </tr> <tr> <td>1268</td> <td>'data.filename' is too long</td> <td>Filename must be at most 25 characters</td> </tr> <tr> <td>1269</td> <td>'data.filename' contains invalid characters</td> <td>Filename must only contain [a-zA-Z0-9_] characters</td> </tr> <tr> <td>1272</td> <td>'data.button_text' is required</td> <td></td> </tr> <tr> <td>1273</td> <td>'date.button_value' is invalid it should be a valid phone number in case of PHONE_CALL type, or valid URL in case of LINK type</td> <td></td> </tr> <tr> <td>1274</td> <td>'data.button_text' too long</td> <td>Button Text must be at most 20 characters</td> </tr> <tr> <td>1275</td> <td>The image can be Max 5 MB, format JPG</td> <td>For WhatsApp image template</td> </tr> <tr> <td>1276</td> <td>The video can be Max 16 MB, format MP4</td> <td>For WhatsApp video template</td> </tr> <tr> <td>1277</td> <td>The document can be Max 100 MB, format PDF</td> <td>For WhatsApp document template</td> </tr> <tr> <td>1278</td> <td>File extension can be only: .bmp, .gif, .jpg, .jpeg, .png, .svg, .webp. maximum size 24 MB</td> <td>For Viber image template</td> </tr> <tr> <td>1279</td> <td>File extension can be only: .3gpp, .m4v, .mov, .mp4. maximum size is 200 MB</td> <td>For Viber video template</td> </tr> <tr> <td>1280</td> <td>File extension can be only: .txt, .doc, .docx, .dot, .dotx, .rtf, .odt, .odf, .fodt, .info.pdf, .xps, .pdax, .eps.xls, .xlsx, .xltx, .xlsm, .csv, .ods, .fods. maximum size 200 MB</td> <td>For Viber document template</td> </tr> <tr> <td>1282</td> <td>URL should start with with 'https://' and have maximum length of 1000 characters</td> <td>For Viber URLs</td> </tr> <tr> <td>1283</td> <td>Document name should be Maximum 25 characters</td> <td>Viber filename must be at most 25 characters</td> </tr> <tr> <td>1284</td> <td>Both 'data.button_value' and 'data.button_text' are required in case one of them specified or both of them must be removed</td> <td>For Viber template with buttons</td> </tr> <tr> <td>1285</td> <td>Text + Image combination not allowed (button is missing)</td> <td>For Viber image template</td> </tr> <tr> <td>1287</td> <td>Image and Text combination not supported by Viber</td> <td>For Viber image template</td> </tr> <tr> <td>1289</td> <td>'data.media_id' is invalid</td> <td>Should be valid UUID</td> </tr> <tr> <td>1291</td> <td>'data.type' is invalid for the selected channel</td> <td>For Viber and Whatsapp should pass valid type</td> </tr> </table>"
          },
          "409": {
            "description": "<p><strong>Conflict:</strong> <table> <tr> <th>Code</th> <th>Message</th> </tr> <tr> <td>1258</td> <td>'data.name' should be unique</td> </tr> </table>"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "EnumChannels": {
        "type": "string",
        "enum": [
          "SMS",
          "VIBER",
          "WHATSAPP"
        ]
      },
      "EnumTemplateStatuses": {
        "type": "string",
        "enum": [
          "COMPLETED",
          "IN_PROCESS",
          "CANCELED"
        ]
      },
      "EnumTemplateTypes": {
        "type": "string",
        "enum": [
          "text",
          "image",
          "video",
          "document"
        ]
      },
      "TemplateResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier of the template"
          },
          "account_id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier of the account"
          },
          "name": {
            "type": "string",
            "description": "Name (unique identifier) of the template"
          },
          "text": {
            "type": "string",
            "description": "Text of the template may contain variables. Maximum 1000 characters"
          },
          "channel": {
            "allOf": [
              {
                "$ref": "#/components/schemas/EnumChannels"
              },
              {
                "description": "Template channel. Enumeration values [SMS, VIBER, WHATSAPP]"
              }
            ]
          },
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/EnumTemplateStatuses"
              },
              {
                "description": "Template status. Enumeration values [COMPLETED, IN_PROCESS, CANCELED]"
              }
            ]
          },
          "type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/EnumTemplateTypes"
              },
              {
                "description": "Template type. Enumeration values [text, image, video, document]"
              }
            ]
          },
          "url": {
            "type": "string",
            "description": "Template media url for image,video or document types"
          },
          "filename": {
            "type": "string",
            "description": "Template filename for document type"
          },
          "button_type": {
            "type": "string",
            "description": "WhatsApp Template button type"
          },
          "button_text": {
            "type": "string",
            "description": "Template button text"
          },
          "button_value": {
            "type": "string",
            "description": "Template button value"
          },
          "placeholder_count": {
            "type": "integer",
            "format": "int32",
            "description": "Indicates the number of attributes. Values wrapped in {}"
          },
          "media_id": {
            "type": "string",
            "format": "uuid",
            "description": "Template media id for image,video or document types"
          },
          "create_date": {
            "type": "string",
            "format": "date-time",
            "description": "Creation date of the template in UTC, formatted as yyyy-mm-dd hh:mm:ss"
          },
          "update_date": {
            "type": "string",
            "format": "date-time",
            "description": "Update date of the template in UTC, formatted as yyyy-mm-dd hh:mm:ss"
          }
        }
      },
      "TemplateResponseWrapperDto": {
        "type": "object",
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/TemplateResponseDto"
              },
              {
                "type": "object",
                "properties": {
                  "links": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/LinksSelf"
                      },
                      {
                        "$ref": "#/components/schemas/LinksAccount"
                      }
                    ]
                  }
                }
              }
            ]
          }
        }
      },
      "TemplatePostRequestWrapperDto": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/TemplateSMSPostRequestDto"
              },
              {
                "$ref": "#/components/schemas/TemplateViberPostRequestDto"
              },
              {
                "$ref": "#/components/schemas/TemplateWhatsAppPostRequestDto"
              }
            ],
            "discriminator": {
              "propertyName": "channel",
              "mapping": {
                "SMS": "#/components/schemas/TemplateSMSPostRequestDto",
                "VIBER": "#/components/schemas/TemplateViberPostRequestDto",
                "WHATSAPP": "#/components/schemas/TemplateWhatsAppPostRequestDto"
              }
            }
          }
        }
      },
      "TemplateSMSPostRequestDto": {
        "title": "SMS Template",
        "type": "object",
        "required": [
          "text",
          "channel"
        ],
        "properties": {
          "channel": {
            "type": "string",
            "description": "Template channel. Enumeration values [SMS, VIBER, WHATSAPP]"
          },
          "name": {
            "type": "string",
            "maxLength": 50,
            "description": "Name (unique identifier) of the template"
          },
          "text": {
            "type": "string",
            "maxLength": 1000,
            "description": "Text of the template, which should always contain the {code} attribute"
          }
        }
      },
      "TemplateViberPostRequestDto": {
        "title": "Viber Template",
        "type": "object",
        "required": [
          "text",
          "channel",
          "type"
        ],
        "properties": {
          "channel": {
            "type": "string",
            "description": "Template channel. Enumeration values [SMS, VIBER, WHATSAPP]"
          },
          "type": {
            "type": "string",
            "enum": [
              "text"
            ],
            "description": "Verification templates can contain only text. Value for type should always be text"
          },
          "name": {
            "type": "string",
            "maxLength": 50,
            "description": "Name (unique identifier) of the template"
          },
          "text": {
            "type": "string",
            "maxLength": 1000,
            "description": "Text of the template, which should always contain the {code} attribute"
          }
        }
      },
      "TemplateWhatsAppPostRequestDto": {
        "title": "WhatsApp Template",
        "type": "object",
        "required": [
          "name",
          "channel",
          "wa_sender_code",
          "wa_category",
          "text",
          "type",
          "button_type",
          "button_text"
        ],
        "properties": {
          "channel": {
            "type": "string",
            "description": "Template channel. Enumeration values [SMS, VIBER, WHATSAPP]"
          },
          "type": {
            "type": "string",
            "enum": [
              "text"
            ],
            "description": "Verification templates can contain only text. Value for type should always be 'text'"
          },
          "name": {
            "type": "string",
            "maxLength": 50,
            "description": "Name (unique identifier) of the template"
          },
          "text": {
            "type": "string",
            "enum": [
              "{code} is your verification code"
            ],
            "description": "Custom text is not supported for WA Verification Templates"
          },
          "wa_category": {
            "type": "string",
            "enum": [
              "AUTHENTICATION"
            ],
            "description": "WhatsApp category should always be 'AUTHENTICATION'"
          },
          "wa_sender_code": {
            "type": "string",
            "description": "Code (unique identifier) of the WhatsApp sender"
          },
          "button_type": {
            "type": "string",
            "enum": [
              "copy_code"
            ],
            "description": "WhatsApp Verification template button_type should always be 'COPY_CODE'"
          },
          "button_text": {
            "type": "string",
            "enum": [
              "Copy"
            ],
            "description": "WhatsApp Verification template button_text should always be 'Copy'"
          }
        }
      },
      "LinksSelf": {
        "type": "object",
        "properties": {
          "self": {
            "type": "string",
            "description": "URL of the requested resource"
          }
        }
      },
      "LinksAccount": {
        "type": "object",
        "properties": {
          "account": {
            "type": "string",
            "description": "URL of the account"
          }
        }
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Dexatel-Key"
      }
    }
  }
}
```