Skip to content

Zalo — Tin nhắn ​

Gửi tin nhắn văn bản (Send text message) — zalo.send_text ​

Send a text message to a user, optionally quoting an earlier message. Free inside 48 hours of the user's last interaction, paid after that. The user must have interacted with the OA in the last 7 days.

Tác độngRủi roCần duyệtIdempotentScopes
WRITEhighcókhông—

Input

FieldNhãnKiểuBắt buộcMô tả
user_idMã người dùngstringcóZalo user ID of the OA follower.
textNội dungstringcóMessage text, up to 2000 characters. Max length 2000.
quote_message_idTin nhắn trích dẫnstringkhôngmessage_id to quote and reply to.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
dataKết quảobjectResult of the send: message_id, user_id, sent_time and the quota used.
data.message_idstringID of the message Zalo accepted.
data.user_idstringZalo user ID of the recipient.
data.sent_timestringWhen Zalo sent the message, Unix time in milliseconds, as a string.
data.quotaobjectThe quota that paid for the message. Missing when the message was charged instead of using a quota.
data.quota.quota_typestringWhich quota paid for the message: reply, welcome_msg, sub_quota, purchase_quota or reward_quota. The reference example for reply omits it.
data.quota.remainstringMessages left in this quota, as a string. Only for reply, welcome_msg and sub_quota. For reply it is always "8" from 1 Jan 2026 and is no longer returned after 1 Mar 2026.
data.quota.totalstringSize of this quota, as a string. Only for reply, welcome_msg and sub_quota. No longer returned for reply after 1 Mar 2026.
data.quota.expired_datestringDate the free package quota expires, dd/MM/yyyy. Only for sub_quota.
data.quota.owner_typestringWho owns the purchased or reward quota: OA or App. Only for purchase_quota and reward_quota.
data.quota.owner_idstringID of the OA or App that owns the quota. Only for purchase_quota and reward_quota.

Gửi tin nhắn hình ảnh (Send image message) — zalo.send_image ​

Send one image or GIF, from a public url or an uploaded attachment_id (exactly one of them). Free inside 48 hours of the user's last interaction, paid after that. The user must have interacted with the OA in the last 7 days.

Tác độngRủi roCần duyệtIdempotentScopes
WRITEhighcókhông—

Input

FieldNhãnKiểuBắt buộcMô tả
user_idMã người dùngstringcóZalo user ID of the OA follower.
media_typeLoại ảnhstringkhôngOne of: image, gif. Default image.
urlĐường dẫn ảnhstringkhôngHTTPS URL of the image (jpg/png up to 1 MB). Pattern: ^https://.
attachment_idMã tệp đính kèmstringkhôngattachment_id from an upload action.
widthChiều rộngintegerkhôngRequired for gif. Min 1.
heightChiều caointegerkhôngRequired for gif. Min 1.
textChú thíchstringkhôngOptional caption. Max length 2000.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
dataKết quảobjectResult of the send: message_id, user_id, sent_time and the quota used.
data.message_idstringID of the message Zalo accepted.
data.user_idstringZalo user ID of the recipient.
data.sent_timestringWhen Zalo sent the message, Unix time in milliseconds, as a string.
data.quotaobjectThe quota that paid for the message. Missing when the message was charged instead of using a quota.
data.quota.quota_typestringWhich quota paid for the message: reply, welcome_msg, sub_quota, purchase_quota or reward_quota. The reference example for reply omits it.
data.quota.remainstringMessages left in this quota, as a string. Only for reply, welcome_msg and sub_quota. For reply it is always "8" from 1 Jan 2026 and is no longer returned after 1 Mar 2026.
data.quota.totalstringSize of this quota, as a string. Only for reply, welcome_msg and sub_quota. No longer returned for reply after 1 Mar 2026.
data.quota.expired_datestringDate the free package quota expires, dd/MM/yyyy. Only for sub_quota.
data.quota.owner_typestringWho owns the purchased or reward quota: OA or App. Only for purchase_quota and reward_quota.
data.quota.owner_idstringID of the OA or App that owns the quota. Only for purchase_quota and reward_quota.

Gửi sticker (Send sticker) — zalo.send_sticker ​

Send a sticker. Sticker IDs come from stickers.zaloapp.com. Free inside 48 hours of the user's last interaction, paid after that. The user must have interacted with the OA in the last 7 days.

Tác độngRủi roCần duyệtIdempotentScopes
WRITEhighcókhông—

Input

FieldNhãnKiểuBắt buộcMô tả
user_idMã người dùngstringcóZalo user ID of the OA follower.
attachment_idMã stickerstringcóSticker ID.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
dataKết quảobjectResult of the send: message_id, user_id, sent_time and the quota used.
data.message_idstringID of the message Zalo accepted.
data.user_idstringZalo user ID of the recipient.
data.sent_timestringWhen Zalo sent the message, Unix time in milliseconds, as a string.
data.quotaobjectThe quota that paid for the message. Missing when the message was charged instead of using a quota.
data.quota.quota_typestringWhich quota paid for the message: reply, welcome_msg, sub_quota, purchase_quota or reward_quota. The reference example for reply omits it.
data.quota.remainstringMessages left in this quota, as a string. Only for reply, welcome_msg and sub_quota. For reply it is always "8" from 1 Jan 2026 and is no longer returned after 1 Mar 2026.
data.quota.totalstringSize of this quota, as a string. Only for reply, welcome_msg and sub_quota. No longer returned for reply after 1 Mar 2026.
data.quota.expired_datestringDate the free package quota expires, dd/MM/yyyy. Only for sub_quota.
data.quota.owner_typestringWho owns the purchased or reward quota: OA or App. Only for purchase_quota and reward_quota.
data.quota.owner_idstringID of the OA or App that owns the quota. Only for purchase_quota and reward_quota.

Gửi tệp (Send file) — zalo.send_file ​

Send a file using the token returned by the upload_file action. Free inside 48 hours of the user's last interaction, paid after that. The user must have interacted with the OA in the last 7 days.

Tác độngRủi roCần duyệtIdempotentScopes
WRITEhighcókhông—

Input

FieldNhãnKiểuBắt buộcMô tả
user_idMã người dùngstringcóZalo user ID of the OA follower.
tokenMã tệpstringcóFile token from upload_file.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
dataKết quảobjectResult of the send: message_id, user_id, sent_time and the quota used.
data.message_idstringID of the message Zalo accepted.
data.user_idstringZalo user ID of the recipient.
data.sent_timestringWhen Zalo sent the message, Unix time in milliseconds, as a string.
data.quotaobjectThe quota that paid for the message. Missing when the message was charged instead of using a quota.
data.quota.quota_typestringWhich quota paid for the message: reply, welcome_msg, sub_quota, purchase_quota or reward_quota. The reference example for reply omits it.
data.quota.remainstringMessages left in this quota, as a string. Only for reply, welcome_msg and sub_quota. For reply it is always "8" from 1 Jan 2026 and is no longer returned after 1 Mar 2026.
data.quota.totalstringSize of this quota, as a string. Only for reply, welcome_msg and sub_quota. No longer returned for reply after 1 Mar 2026.
data.quota.expired_datestringDate the free package quota expires, dd/MM/yyyy. Only for sub_quota.
data.quota.owner_typestringWho owns the purchased or reward quota: OA or App. Only for purchase_quota and reward_quota.
data.quota.owner_idstringID of the OA or App that owns the quota. Only for purchase_quota and reward_quota.

Gửi tin nhắn có nút (Send message with buttons) — zalo.send_buttons ​

Send text with up to 5 buttons (open URL, quick reply, SMS, phone call). Buttons show on mobile only. The reference has no reply example for buttons; it returns the same reply as the other consultation messages. Free inside 48 hours of the user's last interaction, paid after that. The user must have interacted with the OA in the last 7 days.

Tác độngRủi roCần duyệtIdempotentScopes
WRITEhighcókhông—

Input

FieldNhãnKiểuBắt buộcMô tả
user_idMã người dùngstringcóZalo user ID of the OA follower.
textNội dungstringcóMessage text, up to 2000 characters. Max length 2000.
buttonsCác nútarray of objectcóButtons, up to 5.
buttons[].titlestringcóMax length 100.
buttons[].typestringcóOne of: oa.open.url, oa.query.show, oa.query.hide, oa.open.sms, oa.open.phone.
buttons[].payloadobject | stringcóoa.open.url: {url}; oa.query.show / oa.query.hide: string up to 1000 chars; oa.open.sms: {content up to 160 chars, phone_code}; oa.open.phone: {phone_code}.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
dataKết quảobjectResult of the send: message_id, user_id, sent_time and the quota used.
data.message_idstringID of the message Zalo accepted.
data.user_idstringZalo user ID of the recipient.
data.sent_timestringWhen Zalo sent the message, Unix time in milliseconds, as a string.
data.quotaobjectThe quota that paid for the message. Missing when the message was charged instead of using a quota.
data.quota.quota_typestringWhich quota paid for the message: reply, welcome_msg, sub_quota, purchase_quota or reward_quota. The reference example for reply omits it.
data.quota.remainstringMessages left in this quota, as a string. Only for reply, welcome_msg and sub_quota. For reply it is always "8" from 1 Jan 2026 and is no longer returned after 1 Mar 2026.
data.quota.totalstringSize of this quota, as a string. Only for reply, welcome_msg and sub_quota. No longer returned for reply after 1 Mar 2026.
data.quota.expired_datestringDate the free package quota expires, dd/MM/yyyy. Only for sub_quota.
data.quota.owner_typestringWho owns the purchased or reward quota: OA or App. Only for purchase_quota and reward_quota.
data.quota.owner_idstringID of the OA or App that owns the quota. Only for purchase_quota and reward_quota.

Yêu cầu thông tin người dùng (Request user info) — zalo.request_user_info ​

Send a card asking the user to share name, phone and address. The answer arrives as a user_submit_info event. Free inside 48 hours of the user's last interaction, paid after that. The user must have interacted with the OA in the last 7 days.

Tác độngRủi roCần duyệtIdempotentScopes
WRITEhighcókhông—

Input

FieldNhãnKiểuBắt buộcMô tả
user_idMã người dùngstringcóZalo user ID of the OA follower.
titleTiêu đềstringcóMax length 100.
subtitleMô tảstringcóMax length 500.
image_urlẢnhstringcóPattern: ^https://.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
dataKết quảobjectResult of the send: message_id, user_id, sent_time and the quota used.
data.message_idstringID of the message Zalo accepted.
data.user_idstringZalo user ID of the recipient.
data.sent_timestringWhen Zalo sent the message, Unix time in milliseconds, as a string.
data.quotaobjectThe quota that paid for the message. Missing when the message was charged instead of using a quota.
data.quota.quota_typestringWhich quota paid for the message: reply, welcome_msg, sub_quota, purchase_quota or reward_quota. The reference example for reply omits it.
data.quota.remainstringMessages left in this quota, as a string. Only for reply, welcome_msg and sub_quota. For reply it is always "8" from 1 Jan 2026 and is no longer returned after 1 Mar 2026.
data.quota.totalstringSize of this quota, as a string. Only for reply, welcome_msg and sub_quota. No longer returned for reply after 1 Mar 2026.
data.quota.expired_datestringDate the free package quota expires, dd/MM/yyyy. Only for sub_quota.
data.quota.owner_typestringWho owns the purchased or reward quota: OA or App. Only for purchase_quota and reward_quota.
data.quota.owner_idstringID of the OA or App that owns the quota. Only for purchase_quota and reward_quota.

Gửi tin mẫu theo mã người dùng (Send template message by user ID) — zalo.send_template_by_uid ​

Send an approved ZBS template to a follower by user_id. Charged per message.

Tác độngRủi roCần duyệtIdempotentScopes
WRITEhighcókhông—

Input

FieldNhãnKiểuBắt buộcMô tả
user_idMã người dùngstringcóZalo user ID of the OA follower.
template_idMã mẫustringcóApproved ZBS template ID.
template_dataDữ liệu mẫuobjectcóValues for the template parameters.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
dataKết quảobjectZalo response data.