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
PATCH https://staging.manage-api.miniap.vn/api/external/zns-template/<template_id>
PATCH https://manage-api.miniap.vn/api/external/zns-template/<template_id>
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 status | Can 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 |
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:
| Field | Type | Required | Description |
|---|---|---|---|
oaId | string | ✅ | ID of the Zalo OA used to send messages. |
name | string | ✅ | Template name. |
description | string | ❌ | Short description. |
title | string | ✅ | Title shown in the message. |
tag | "1" | "2" | "3" | ✅ | Content level (Transaction / Customer care / Post-sale). |
templateType | custom | voucher | rating | ✅ | Template type. |
imageType | logo | image | ✅ | Use a logo or a banner image. |
logoLight, logoDark | string | ❌ | Light / dark background logo (required when imageType = logo). |
images | string[] | ❌ | Image list (at least one required when imageType = image). |
contentBlocks | object[] | ✅ | Message content (paragraph, table, voucher, rating). |
buttons | object[] | ✅ | Button list, maximum 3. |
params | object[] | ✅ | Dynamic parameters with techSetting, maxLength, sampleValue. |
voucher / rating | object | ⚠️ | Required for the matching templateType. |
isCustomParams | boolean | ✅ | Declare the parameters in params yourself or use the default set. |
note | string | ❌ | Note for Zalo's review team. |
For the meaning of tag, techSetting, rowType, and button type, see Create ZBS Template.
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
- Request
{
"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
- Success
- 404 Error
- 403 Error
{
"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"
}
}
{
"message": "Không tìm thấy mẫu tin nhắn ZNS"
}
{
"message": "Chỉ có thể cập nhật mẫu tin nhắn ZNS ở trạng thái nháp hoặc bị từ chối"
}
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.