---
updatedAt: 2026-06-15T14:41:25.000Z
agentTools:
  projectIndex: https://developers.dexatel.com/llms.txt
---

# Update single Template

<br />

<TitleSetter title="Update Message Templates | Dexatel API" />

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Contacts and Messaging",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://api.dexatel.com",
      "description": "Server base url"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/v1/templates/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "put": {
        "tags": [
          "Templates"
        ],
        "summary": "Update single Template",
        "operationId": "update_template",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplatePutRequestWrapperDto"
              }
            }
          }
        },
        "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>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>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>1268</td> <td>'data.filename' is too long</td> <td>Filename must be at most 512 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>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>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>1293</td> <td>Unable to remove 'data.text' when the template type is 'text'</td> <td>Text can't be removed for Viber(text) template</td> </tr> <tr> <td>1294</td> <td>Unable to update 'data.filename' when the template type is 'data.image' or 'data.video'</td> <td>Only Viber document template can have filename</td> </tr> <tr> <td>1295</td> <td>Either 'data.media_id' or 'data.url' must be provided</td> <td>For image, video or document templates can't remove both values</td> </tr> <tr> <td>1298</td> <td>For 'data.type: video' only 'data.media_id'/'data.url', 'data.name' can be updated</td> <td>Viber video template do not support 'button_text', 'button_value' and 'filename'</td> </tr> <tr> <td>1299</td> <td>For 'data.type: document' only 'data.filename', 'data.media_id'/'data.url', 'data.name' can be updated</td> <td>Viber document template do not support 'text', 'button_text' and 'button_value'</td> </tr> <tr> <td>1300</td> <td>The combination is not supported. Possible combinations include image, text and button</td> <td></td> </tr> <tr> <td>1301</td> <td>'data.button_type' unknown field</td> <td></td> </tr> <tr> <td>1305</td> <td>'data.filename' can't be removed from 'Document' template</td> <td>For document templates can't remove filename value</td> </tr> \n <tr> <td>1270</td> <td>Whatsapp template could not be updated</td> <td>WhatsApp templates, including carousel templates, cannot be updated &mdash; create a new template instead</td> </tr>\n </table>"
          },
          "404": {
            "description": "<p><strong>Not Found:</strong> <table> <tr> <th>Code</th> <th>Message</th> </tr> <tr> <td>1251</td> <td>Template not found</td> </tr> </table>"
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "id": {
        "in": "path",
        "name": "id",
        "required": true,
        "schema": {
          "type": "string",
          "description": "Unique identifier of the resource - {id}"
        }
      }
    },
    "schemas": {
      "EnumChannels": {
        "type": "string",
        "enum": [
          "SMS",
          "VIBER",
          "WHATSAPP"
        ]
      },
      "EnumTemplateStatuses": {
        "type": "string",
        "enum": [
          "COMPLETED",
          "IN_PROCESS",
          "CANCELED"
        ]
      },
      "EnumTemplateTypes": {
        "type": "string",
        "enum": [
          "text",
          "image",
          "video",
          "document",
          "carousel",
          "survey"
        ]
      },
      "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, carousel, survey]"
              }
            ]
          },
          "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"
          },
          "carousel_items": {
            "type": "array",
            "description": "Array of carousel items. Present when type is 'carousel'",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string",
                  "description": "Title of the carousel item"
                },
                "media_id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "Media ID of the carousel item image"
                },
                "image_url": {
                  "type": "string",
                  "nullable": true,
                  "description": "Image URL of the carousel item",
                  "pattern": "^https://",
                  "maxLength": 1000
                },
                "primary_button": {
                  "type": "object",
                  "description": "Primary button of the carousel item",
                  "properties": {
                    "label": {
                      "type": "string",
                      "description": "Button label text",
                      "maxLength": 10
                    },
                    "action_url": {
                      "type": "string",
                      "description": "URL to open when button is clicked"
                    },
                    "inactive_viber_link": {
                      "type": "boolean",
                      "description": "Whether Viber link is inactive"
                    }
                  }
                },
                "secondary_button": {
                  "type": "object",
                  "description": "Secondary button of the carousel item",
                  "properties": {
                    "label": {
                      "type": "string",
                      "description": "Button label text",
                      "maxLength": 12
                    },
                    "action_url": {
                      "type": "string",
                      "description": "URL to open when button is clicked"
                    },
                    "inactive_viber_link": {
                      "type": "boolean",
                      "description": "Whether Viber link is inactive"
                    }
                  }
                }
              }
            }
          },
          "survey_options": {
            "type": "array",
            "description": "Array of survey option strings. Present when type is 'survey'. Minimum 2, maximum 5 options",
            "minItems": 2,
            "maxItems": 5,
            "items": {
              "type": "string",
              "minLength": 2,
              "maxLength": 50,
              "description": "Survey option text. Minimum 2, maximum 50 characters"
            }
          },
          "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"
          },
          "viber_category": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ViberTemplateCategory"
              },
              {
                "description": "Viber template category. Enumeration values [PROMOTIONAL, TRANSACTIONAL, OTP]"
              }
            ]
          },
          "viber_template": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ViberTemplateResponseDto"
              },
              {
                "description": "Viber OTP/Transactional template details. Present when viber_category is OTP or TRANSACTIONAL"
              }
            ]
          },
          "wa_sender_code": {
            "type": "string",
            "description": "WhatsApp sender code associated with the template"
          },
          "wa_category": {
            "type": "string",
            "description": "WhatsApp template category (e.g. MARKETING, UTILITY, AUTHENTICATION)"
          },
          "wa_text_examples": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Example values for placeholders in the template text"
          },
          "wa_carousel": {
            "allOf": [
              {
                "$ref": "#/components/schemas/WaCarouselResponseDto"
              },
              {
                "description": "WhatsApp carousel details. Present when channel is WHATSAPP and type is 'carousel'"
              }
            ]
          },
          "button_url_example": {
            "type": "string",
            "description": "Example value for the dynamic URL segment in a CALL_TO_ACTION button"
          },
          "otp_expiration_seconds": {
            "type": "integer",
            "format": "int64",
            "description": "OTP expiration time in seconds for WhatsApp OTP templates"
          }
        }
      },
      "ViberTemplateCategory": {
        "type": "string",
        "enum": [
          "PROMOTIONAL",
          "TRANSACTIONAL",
          "OTP"
        ],
        "description": "Viber template category"
      },
      "ViberTemplateParamDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 50,
            "description": "Parameter name. Must contain only English letters, digits, and underscores. Maximum 50 characters"
          },
          "type": {
            "type": "string",
            "enum": [
              "TEXT"
            ],
            "description": "Parameter type. Must be TEXT"
          }
        }
      },
      "ViberTemplateLocaleDto": {
        "type": "object",
        "properties": {
          "lang": {
            "type": "string",
            "description": "Language code. Must be one of the supported language codes"
          },
          "template": {
            "type": "string",
            "minLength": 1,
            "maxLength": 875,
            "description": "Template body text. Must be between 1 and 875 characters. Must start and end with static text, not a placeholder. Must not contain consecutive placeholders. Must contain a placeholder for every defined param"
          }
        }
      },
      "ViberTemplateVarExampleDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 50,
            "description": "Variable name. Must match a defined parameter name. Maximum 50 characters"
          },
          "example": {
            "type": "string",
            "maxLength": 100,
            "description": "Example value for the variable. Must not contain a URL, link, or email address. Maximum 100 characters"
          }
        }
      },
      "ViberTemplateResponseDto": {
        "type": "object",
        "properties": {
          "template_id": {
            "type": "string",
            "description": "Viber template ID assigned by the Viber service"
          },
          "sender_code": {
            "type": "string",
            "description": "Viber sender code"
          },
          "status": {
            "type": "string",
            "description": "Viber template registration status"
          },
          "status_note": {
            "type": "string",
            "description": "Additional status information"
          },
          "category": {
            "type": "string",
            "description": "Viber template category as returned by the Viber service"
          },
          "service_id": {
            "type": "integer",
            "format": "int64",
            "description": "Viber service ID"
          },
          "created_at": {
            "type": "integer",
            "format": "int64",
            "description": "Template creation timestamp (Unix epoch)"
          },
          "params": {
            "type": "array",
            "description": "Template parameter definitions",
            "items": {
              "$ref": "#/components/schemas/ViberTemplateParamDto"
            }
          },
          "locales": {
            "type": "array",
            "description": "Template locale entries",
            "items": {
              "$ref": "#/components/schemas/ViberTemplateLocaleDto"
            }
          },
          "var_example": {
            "type": "array",
            "description": "Example values for template variables",
            "items": {
              "$ref": "#/components/schemas/ViberTemplateVarExampleDto"
            }
          }
        }
      },
      "WaCarouselResponseDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name (unique identifier) of the carousel template"
          },
          "text": {
            "type": "string",
            "description": "Text of the message shown above the carousel"
          },
          "wa_text_examples": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Example values for placeholders in the template text"
          },
          "cards": {
            "type": "array",
            "description": "Cards of the carousel",
            "items": {
              "$ref": "#/components/schemas/WaCarouselCardResponseDto"
            }
          }
        }
      },
      "WaCarouselCardResponseDto": {
        "type": "object",
        "properties": {
          "card_index": {
            "type": "integer",
            "format": "int32",
            "description": "Zero-based position of the card in the carousel"
          },
          "header_format": {
            "type": "string",
            "enum": [
              "IMAGE"
            ],
            "description": "Media format of the card header. Only 'IMAGE' is supported"
          },
          "media_id": {
            "type": "string",
            "format": "uuid",
            "description": "Media id of the card header. Null when 'url' was used instead"
          },
          "url": {
            "type": "string",
            "description": "Media url of the card header. Null when 'media_id' was used instead"
          },
          "body_text": {
            "type": "string",
            "description": "Card body text"
          },
          "body_text_examples": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Example values for placeholders in 'body_text'"
          },
          "buttons": {
            "type": "array",
            "description": "Buttons of the card",
            "items": {
              "$ref": "#/components/schemas/WaCarouselCardButtonResponseDto"
            }
          }
        }
      },
      "WaCarouselCardButtonResponseDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "QUICK_REPLY",
              "LINK",
              "PHONE_CALL"
            ],
            "description": "Button type"
          },
          "index": {
            "type": "integer",
            "format": "int32",
            "description": "Zero-based position of the button within the card"
          },
          "text": {
            "type": "string",
            "description": "Button label"
          },
          "value": {
            "type": "string",
            "description": "Url, phone number or quick-reply payload of the button"
          },
          "example": {
            "type": "string",
            "description": "Example value for the dynamic placeholder used in 'value'"
          }
        }
      },
      "TemplateResponseWrapperDto": {
        "type": "object",
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/TemplateResponseDto"
              },
              {
                "type": "object",
                "properties": {
                  "links": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/LinksSelf"
                      },
                      {
                        "$ref": "#/components/schemas/LinksAccount"
                      }
                    ]
                  }
                }
              }
            ]
          }
        }
      },
      "TemplatePutRequestWrapperDto": {
        "required": [
          "data"
        ],
        "type": "object",
        "properties": {
          "data": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/TemplateSMSPutRequestDto"
              },
              {
                "$ref": "#/components/schemas/TemplateViberPutRequestDto"
              }
            ]
          }
        }
      },
      "TemplateSMSPutRequestDto": {
        "title": "SMS Template",
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 50,
            "description": "Name (unique identifier) of the template"
          },
          "text": {
            "type": "string",
            "maxLength": 1000,
            "description": "Text of the template may contain variables. Maximum 1000 characters. If you want to include a URL and have it shortened (with analytics tracking), wrap it in curly braces using the following format: {url=https://dexatel.com}."
          }
        }
      },
      "TemplateViberPutRequestDto": {
        "title": "Viber Template",
        "type": "object",
        "oneOf": [
          {
            "title": "Text Template",
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "maxLength": 45,
                "description": "Name (unique identifier) of the template. Maximum 45 characters. Only letters, numbers, and (- _) are allowed"
              },
              "text": {
                "type": "string",
                "maxLength": 1000,
                "description": "Text of the template may contain variables. Maximum 1000 characters"
              },
              "button_text": {
                "type": "string",
                "description": "When 'button_text' is provided 'button_value' is required"
              },
              "button_value": {
                "type": "string",
                "description": "When 'button_value' is provided 'button_text' is required"
              }
            }
          },
          {
            "title": "Image Template",
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "maxLength": 45,
                "description": "Name (unique identifier) of the template. Maximum 45 characters. Only letters, numbers, and (- _) are allowed"
              },
              "text": {
                "type": "string",
                "maxLength": 1000,
                "description": "Text of the template may contain variables. Maximum 1000 characters. If text is present, button_text and button_value are required"
              },
              "url": {
                "type": "string",
                "description": "Will replace existing 'media_id' if any"
              },
              "media_id": {
                "type": "string",
                "format": "uuid",
                "description": "Will replace existing 'url' if any"
              },
              "button_text": {
                "type": "string",
                "description": "When 'button_text' is provided 'button_value' is required"
              },
              "button_value": {
                "type": "string",
                "description": "When 'button_value' is provided 'button_text' is required"
              }
            }
          },
          {
            "title": "Video Template",
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "maxLength": 45,
                "description": "Name (unique identifier) of the template. Maximum 45 characters. Only letters, numbers, and (- _) are allowed"
              },
              "text": {
                "type": "string",
                "maxLength": 1000,
                "description": "Text of the template may contain variables. Maximum 1000 characters"
              },
              "url": {
                "type": "string",
                "description": "Will replace existing 'media_id' if any"
              },
              "media_id": {
                "type": "string",
                "format": "uuid",
                "description": "Will replace existing 'url' if any"
              }
            }
          },
          {
            "title": "Document Template",
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "maxLength": 45,
                "description": "Name (unique identifier) of the template. Maximum 45 characters. Only letters, numbers, and (- _) are allowed"
              },
              "filename": {
                "type": "string",
                "description": "Filename of the document. Maximum 25 characters which contains only [a-zA-Z0-9_]"
              },
              "url": {
                "type": "string",
                "description": "Will replace existing 'media_id' if any"
              },
              "media_id": {
                "type": "string",
                "format": "uuid",
                "description": "Will replace existing 'url' if any"
              }
            }
          },
          {
            "title": "Carousel Template",
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "maxLength": 45,
                "description": "Name (unique identifier) of the template. Maximum 45 characters. Only letters, numbers, and (- _) are allowed"
              },
              "text": {
                "type": "string",
                "maxLength": 1000,
                "description": "Main title text of the carousel template. Maximum 1000 characters"
              },
              "carousel_items": {
                "type": "array",
                "description": "Array of carousel items",
                "items": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "description": "Title of the carousel item",
                      "minLength": 2,
                      "maxLength": 38
                    },
                    "image_url": {
                      "type": "string",
                      "nullable": true,
                      "description": "Image URL for the carousel item. Will replace existing 'media_id' if any",
                      "pattern": "^https://",
                      "maxLength": 1000
                    },
                    "media_id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Media ID for the carousel item. Will replace existing 'image_url' if any"
                    },
                    "primary_button": {
                      "type": "object",
                      "description": "Primary button of the carousel item",
                      "properties": {
                        "label": {
                          "type": "string",
                          "description": "Button label text",
                          "maxLength": 10
                        },
                        "action_url": {
                          "type": "string",
                          "description": "URL to open when button is clicked"
                        },
                        "inactive_viber_link": {
                          "type": "boolean",
                          "description": "Whether Viber link is inactive"
                        }
                      }
                    },
                    "secondary_button": {
                      "type": "object",
                      "description": "Secondary button of the carousel item",
                      "properties": {
                        "label": {
                          "type": "string",
                          "description": "Button label text",
                          "maxLength": 12
                        },
                        "action_url": {
                          "type": "string",
                          "description": "URL to open when button is clicked"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "title": "Survey Template",
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "maxLength": 45,
                "description": "Name (unique identifier) of the template. Maximum 45 characters. Only letters, numbers, and (- _) are allowed"
              },
              "text": {
                "type": "string",
                "maxLength": 1000,
                "description": "Survey question text. Maximum 1000 characters"
              },
              "survey_options": {
                "type": "array",
                "description": "Array of survey option strings. Minimum 2, maximum 5 options",
                "minItems": 2,
                "maxItems": 5,
                "items": {
                  "type": "string",
                  "minLength": 2,
                  "maxLength": 50,
                  "description": "Survey option text. Minimum 2, maximum 50 characters"
                }
              }
            }
          }
        ]
      },
      "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"
      }
    }
  }
}
```