Create ZBS Template
This API allows you to create a Zalo Business Solution (ZBS) Template with full display content and dynamic parameters.
Usage flow:
- Create the template with this API — the template is saved with status
DRAFTand the response returns its_id. - Publish the template with the Publish ZBS Template API to submit it to Zalo for review (
PENDING_REVIEW). - Once Zalo approves it (
ENABLE), the template can be used to send messages.
Template content is described with contentBlocks
Starting from the latest version, the display content of a template is declared through the contentBlocks array (paragraph, table, voucher, rating) instead of the previous paragraphs and tables fields.
Endpoint
🔗Endpoint Staging
Endpoint
POST https://staging-manage.api.miniai.vn/api/external/zns-template/create
🔗Endpoint Production
Endpoint
POST https://manage-api.miniap.vn/api/external/zns-template/create
Parameters (Request Body)
General information
| Field | Type | Required | Description |
|---|---|---|---|
oaId | string | ✅ | ID of the Zalo OA used to send messages. Required before the template can be published. |
name | string | ✅ | Template name (for internal management). |
description | string | ❌ | Short description of the template's purpose. |
title | string | ✅ | Title shown in the message. Dynamic parameters such as <customer_fullname> can be inserted. |
tag | "1" | "2" | "3" | ✅ | Template content level — see Template level. |
templateType | custom | voucher | rating | ✅ | Template type — see Template type. |
imageType | logo | image | ✅ | Header image style: use a logo or a banner image. |
logoLight | string | ❌ | Logo URL for light background. Required when imageType = logo (validated on publish). |
logoDark | string | ❌ | Logo URL for dark background. Required when imageType = logo. |
images | string[] | ❌ | List of image URLs. At least one image is required when imageType = image. |
contentBlocks | object[] | ✅ | Message body content — see contentBlocks. |
buttons | object[] | ✅ | List of buttons, maximum 3 — see buttons. |
params | object[] | ✅ | Dynamic parameter declarations — see params. |
voucher | object | ⚠️ | Required when templateType = voucher — see Voucher template. |
rating | object | ⚠️ | Required when templateType = rating — see Rating template. |
isCustomParams | boolean | ✅ | true if you declare the parameters in params yourself; false to use the system's default parameter set. |
note | string | ❌ | Note sent to Zalo's review team (explaining the message's use case). |
No need to send status
Templates are always created with status DRAFT, even if you include status in the request. Status changes happen through the Publish ZBS Template API.
Template level (tag)
Zalo classifies messages by content level; the level affects review policy and message pricing.
tag | Level | Suitable content |
|---|---|---|
"1" | Transaction | Account verification, OTP, order/transaction confirmation, balance changes… |
"2" | Customer care | Loyalty point updates, policy updates, opinion surveys, birthday greetings… |
"3" | Post-sale | New product/service announcements, discount codes and promotions, renewal invitations… |
Template type (templateType)
| Value | Name | Description |
|---|---|---|
custom | Custom message | Free-form message: transaction notices, OTP, reminders… |
voucher | Voucher template | Send a discount code / voucher with conditions and expiry. |
rating | Rating template | Collect customer feedback after using a product/service. |
Message content (contentBlocks)
contentBlocks is an array of content blocks, rendered in the exact order you declare them.
| Field | Type | Required | Description |
|---|---|---|---|
id | string | ✅ | Unique identifier of the block (a UUID you generate). |
type | paragraph | table | voucher | rating | ✅ | Content block type. |
value | string | ⚠️ | Text content — used by paragraph blocks. Parameters such as <order_code> can be inserted. |
rows | object[] | ⚠️ | Table rows — used by table blocks. |
voucher | object | ⚠️ | Voucher information — used by voucher blocks. |
rating | object | ⚠️ | Rating information — used by rating blocks. |
Table rows (rows)
| Field | Type | Required | Description |
|---|---|---|---|
label | string |