Skip to main content

Update ZBS Template

This API lets you edit the content of an existing Zalo Business Solution (ZBS) Template before publishing it to Zalo (or after it has been rejected).

The request body uses exactly the same structure as the Create ZBS Template API — including all required fields. This is an overwrite operation: fields you omit are removed from the template, so always send the complete template content after editing.


Endpoint

🔗Endpoint Staging
Endpoint
PATCH https://staging.manage-api.miniap.vn/api/external/zns-template/<template_id>
🔗Endpoint Production
Endpoint
PATCH https://manage-api.miniap.vn/api/external/zns-template/<template_id>
Example
PATCH https://manage-api.miniap.vn/api/external/zns-template/68c8ee675f8f83fc813e7830

template_id is the _id returned when you created the template (a 24-character hex ObjectId).


Update conditions

Only templates in draft (DRAFT) or rejected (REJECTED) status can be edited.

Current statusCan update?
DRAFT✅ Yes
REJECTED✅ Yes — fix it per Zalo's feedback, then publish again
PENDING_REVIEW❌ Awaiting Zalo review
ENABLE❌ Approved and in use
DISABLE❌ Disabled
Approved templates cannot be edited

For a template in ENABLE status you must create a new template instead of editing it. Zalo requires every content change to go through a new review cycle.


Parameters (Request Body)

All fields and rules are identical to the Create ZBS Template API:

FieldTypeRequiredDescription
oaIdstringID of the Zalo OA used to send messages.
namestringTemplate name.
descriptionstringShort description.
titlestringTitle shown in the message.
tag"1" | "2" | "3"Content level (Transaction / Customer care / Post-sale).
templateTypecustom | voucher | ratingTemplate type.
imageTypelogo | imageUse a logo or a banner image.
logoLight, logoDarkstringLight / dark background logo (required when imageType = logo).
imagesstring[]Image list (at least one required when imageType = image).
contentBlocksobject[]Message content (paragraph, table, voucher, rating).
buttonsobject[]Button list, maximum 3.
paramsobject[]Dynamic parameters with techSetting, maxLength, sampleValue.
voucher / ratingobject⚠️Required for the matching templateType.
isCustomParamsbooleanDeclare the parameters in params yourself or use the default set.
notestringNote for Zalo's review team.

For the meaning of tag, techSetting, rowType, and button type, see Create ZBS Template.

Status is unchanged

This API does not change the template status — it stays DRAFT / REJECTED. To submit it to Zalo for review, call the Publish ZBS Template API.


Request Body example

{
"oaId": "2288954399991473926",
"name": "Xác nhận đơn hàng (bản cập nhật)",
"description": "Thông báo xác nhận đơn hàng cho khách",
"title": "Xin chào <customer_fullname>,",
"tag": "1",
"templateType": "custom",
"imageType": "logo",
"logoLight": "https://cdn.miniap.vn/zns/logo-light.png",
"logoDark": "https://cdn.miniap.vn/zns/logo-dark.png",
"images": [],
"isCustomParams": true,
"contentBlocks": [
{
"id": "10c8db12-7f66-4b53-a79c-22b5a01dac49",
"type": "paragraph",
"value": "Đơn hàng của bạn đã được xác nhận và đang được chuẩn bị."
},
{
"id": "6f2b0a54-1f5a-4f0f-9a52-0f5b2b6c7d10",
"type": "table",
"rows": [
{ "label": "Mã đơn hàng", "key": "<order_code>", "rowType": 0 },
{ "label": "Trạng thái", "key": "<order_status>", "rowType": 1 }
]
}
],
"buttons": [
{
"label": "Theo dõi đơn hàng",
"value": "https://manage.miniai.vn/orders",
"type": "1"
}
],
"params": [
{
"key": "customer_fullname",
"label": "Customer fullname",
"techSetting": "1",
"maxLength": 30,
"sampleValue": "Nguyễn Văn A"
},
{
"key": "order_code",
"label": "Order code",
"techSetting": "4",
"maxLength": 30,
"sampleValue": "DH123456"
},
{
"key": "order_status",
"label": "Order status",
"techSetting": "6",
"maxLength": 30,
"sampleValue": "Đang chuẩn bị"
}
],
"note": "Cập nhật nội dung theo góp ý kiểm duyệt"
}

Response

{
"template": {
"name": "Xác nhận đơn hàng (bản cập nhật)",
"description": "Thông báo xác nhận đơn hàng cho khách",
"oaId": "2288954399991473926",
"tag": "1",
"templateType": "custom",
"imageType": "logo",
"title": "Xin chào <customer_fullname>,",
"contentBlocks": [
{
"id": "10c8db12-7f66-4b53-a79c-22b5a01dac49",
"type": "paragraph",
"value": "Đơn hàng của bạn đã được xác nhận và đang được chuẩn bị."
},
{
"id": "6f2b0a54-1f5a-4f0f-9a52-0f5b2b6c7d10",
"type": "table",
"rows": [
{ "label": "Mã đơn hàng", "key": "<order_code>", "rowType": 0 },
{ "label": "Trạng thái", "key": "<order_status>", "rowType": 1 }
]
}
],
"buttons": [
{
"label": "Theo dõi đơn hàng",
"value": "https://manage.miniai.vn/orders",
"type": "1"
}
],
"params": [
{
"key": "customer_fullname",
"label": "Customer fullname",
"techSetting": "1",
"maxLength": 30,
"sampleValue": "Nguyễn Văn A"
},
{
"key": "order_code",
"label": "Order code",
"techSetting": "4",
"maxLength": 30,
"sampleValue": "DH123456"
},
{
"key": "order_status",
"label": "Order status",
"techSetting": "6",
"maxLength": 30,
"sampleValue": "Đang chuẩn bị"
}
],
"logoDark": "https://cdn.miniap.vn/zns/logo-dark.png",
"logoLight": "https://cdn.miniap.vn/zns/logo-light.png",
"images": [],
"note": "Cập nhật nội dung theo góp ý kiểm duyệt",
"status": "DRAFT",
"isSync": false,
"isCustomParams": true,
"_id": "68c8ee675f8f83fc813e7830",
"createdAt": "2025-09-16T04:58:15.668Z",
"updatedAt": "2025-09-18T09:12:04.221Z",
"id": "68c8ee675f8f83fc813e7830"
}
}
Note about the response

The fields in the response reflect the template after the update. To submit the edited version to Zalo for review, call the Publish ZBS Template API.