Chat
Hội thoại và tin nhắn mọi kênh: đọc, tìm, gửi, thu hồi, reaction, ghim, đã đọc. · 44 endpoint
- GET/accounts/{accountId}/conversations
- GET/accounts/{accountId}/conversations/{threadId}
- PATCH/accounts/{accountId}/conversations/{threadId}
- DELETE/accounts/{accountId}/conversations/{threadId}
- GET/accounts/{accountId}/unread-count
- GET/accounts/{accountId}/conversations/{threadId}/messages
- POST/accounts/{accountId}/conversations/{threadId}/messages
- GET/accounts/{accountId}/conversations/{threadId}/messages/{msgId}
- PATCH/accounts/{accountId}/conversations/{threadId}/messages/{msgId}
- DELETE/accounts/{accountId}/conversations/{threadId}/messages/{msgId}
- GET/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/around
- GET/accounts/{accountId}/messages/search
- GET/accounts/{accountId}/conversations/{threadId}/media
- POST/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/forward
- POST/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/reactions
- DELETE/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/reactions
- POST/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/recall
- POST/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/pin
- DELETE/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/pin
- GET/accounts/{accountId}/conversations/{threadId}/pinned-messages
- POST/accounts/{accountId}/conversations/{threadId}/read
- POST/accounts/{accountId}/conversations/{threadId}/typing
- GET/accounts/{accountId}/conversations/{threadId}/draft
- PUT/accounts/{accountId}/conversations/{threadId}/draft
- DELETE/accounts/{accountId}/conversations/{threadId}/draft
- POST/accounts/{accountId}/conversations/{threadId}/unread
- DELETE/accounts/{accountId}/conversations/{threadId}/unread
- POST/accounts/{accountId}/conversations/{threadId}/pin
- DELETE/accounts/{accountId}/conversations/{threadId}/pin
- POST/accounts/{accountId}/conversations/{threadId}/mute
- DELETE/accounts/{accountId}/conversations/{threadId}/mute
- POST/accounts/{accountId}/conversations/{threadId}/others
- DELETE/accounts/{accountId}/conversations/{threadId}/others
- POST/accounts/{accountId}/conversations/{threadId}/history/sync
- GET/accounts/{accountId}/drafts
- POST/accounts/{accountId}/conversations/{threadId}/messages/contact-card
- POST/accounts/{accountId}/conversations/{threadId}/messages/bank-card
- POST/accounts/{accountId}/conversations/{threadId}/messages/voice
- GET/accounts/{accountId}/conversations/{threadId}/reminders
- POST/accounts/{accountId}/conversations/{threadId}/reminders
- PATCH/accounts/{accountId}/conversations/{threadId}/reminders/{reminderId}
- DELETE/accounts/{accountId}/conversations/{threadId}/reminders/{reminderId}
- GET/accounts/{accountId}/conversations/{threadId}/auto-delete
- PUT/accounts/{accountId}/conversations/{threadId}/auto-delete
Danh sách hội thoại, mới nhất trước
/api/v1/accounts/{accountId}/conversationsScope: chat:readTham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản (accounts.zalo_id). Facebook dùng Facebook ID, Telegram dùng ID tài khoản Telegram. |
limitquery · tuỳ chọn | integer ≥ 1 · ≤ 200 · default 50 | Số bản ghi tối đa (1–200) |
offsetquery · tuỳ chọn | integer ≥ 0 · default 0 | Bỏ qua N bản ghi đầu |
searchquery · tuỳ chọn | string max 200 | Tìm theo tên/số điện thoại |
unread_onlyquery · tuỳ chọn | boolean | |
folderquery · tuỳ chọn | "all" | "main" | "others" default "all" | Zalo: hộp thư chính / khác |
Lệnh mẫu
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations" \
-H "Authorization: Bearer dpk_xxx"Một hội thoại kèm nhãn và trạng thái ghim
/api/v1/accounts/{accountId}/conversations/{threadId}Scope: chat:readTham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại (user id hoặc group id của kênh) |
Lệnh mẫu
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}" \
-H "Authorization: Bearer dpk_xxx"Ghim, tắt thông báo, đặt biệt danh (trên Deplao)
/api/v1/accounts/{accountId}/conversations/{threadId}Scope: chat:manageCác cờ lưu trên Deplao như UI: ghim cục bộ (db:setLocalPinnedConversation), tắt thông báo (db:setContactFlags), biệt danh (db:setContactAlias).
Tham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại (user id hoặc group id của kênh) |
Body (JSON)
pinnedtuỳ chọn | boolean | |
mutedtuỳ chọn | boolean | |
mute_untiltuỳ chọn | integer ≥ 0 | Epoch ms; 0 = vô thời hạn |
aliastuỳ chọn | string max 100 |
Lệnh mẫu
curl -X PATCH "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}" \
-H "Authorization: Bearer dpk_xxx" \
-H "Content-Type: application/json" \
-d '{"pinned":false,"muted":false,"mute_until":0}'Xoá hội thoại (toàn bộ tin trong Deplao; Zalo xoá cả trên server)
/api/v1/accounts/{accountId}/conversations/{threadId}Scope: chat:manageKhông thể hoàn tác: bắt buộc ?confirm=true. Như menu "Xóa hội thoại": Zalo gọi zalo:deleteChat theo tin cuối rồi xoá khỏi DB.
Tham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại (user id hoặc group id của kênh) |
confirmquery · tuỳ chọn | boolean default false | Phải là true |
Lệnh mẫu
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}" \
-H "Authorization: Bearer dpk_xxx"Tổng số tin chưa đọc của tài khoản
/api/v1/accounts/{accountId}/unread-countScope: chat:readTham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản (accounts.zalo_id). Facebook dùng Facebook ID, Telegram dùng ID tài khoản Telegram. |
Lệnh mẫu
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/unread-count" \
-H "Authorization: Bearer dpk_xxx"Tin nhắn của hội thoại, mới → cũ, phân trang bằng `before`
/api/v1/accounts/{accountId}/conversations/{threadId}/messagesScope: chat:readTrang sau: gọi lại với before = pagination.next_before. Tin cùng mốc thời gian có thể lặp ở ranh giới trang: khử trùng theo msg_id.
Tham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại (user id hoặc group id của kênh) |
limitquery · tuỳ chọn | integer ≥ 1 · ≤ 200 · default 50 | |
beforequery · tuỳ chọn | integer ≥ 0 | Chỉ lấy tin có timestamp <= before (epoch ms) |
topic_idquery · tuỳ chọn | string | Telegram forum topic |
typequery · tuỳ chọn | string max 50 | Lọc theo msg_type (vd: photo, file) |
Lệnh mẫu
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/messages" \
-H "Authorization: Bearer dpk_xxx"Gửi tin: văn bản, file/ảnh/video, sticker, link (mọi kênh)
/api/v1/accounts/{accountId}/conversations/{threadId}/messagesScope: chat:sendGửi đúng như khi bấm gửi trên app (cùng handler IPC, cùng hàng đợi gửi). Thứ tự: attachments → sticker → link → text.
File đính kèm KHÔNG nhận đường dẫn trên máy: dùng upload_id (POST /media/uploads), library_uuid hoặc url công khai.
Video Zalo đi qua chuỗi getVideoMeta → uploadVideoThumb → uploadVideoFile → sendVideo như UI.
Hỗ trợ header Idempotency-Key để gửi lại an toàn khi mất kết nối.
Tham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại (user id hoặc group id của kênh) |
Body (JSON)
thread_typetuỳ chọn | "user" | "group" | Bỏ trống = tự tra theo hội thoại |
texttuỳ chọn | string max 10000 | |
attachmentstuỳ chọn | object[] max 10 items | |
└upload_idtuỳ chọn | string | ID từ POST /media/uploads |
└library_uuidtuỳ chọn | string | UUID item trong thư viện media |
└urltuỳ chọn | string (uri) | Link http/https công khai, server tự tải về (≤ giới hạn upload) |
└kindtuỳ chọn | "image" | "video" | "audio" | "file" | Bỏ trống = tự nhận theo đuôi file |
└captiontuỳ chọn | string max 2000 | |
sticker_idtuỳ chọn | string | integer | |
linktuỳ chọn | object | |
└urlbắt buộc | string (uri) | |
└texttuỳ chọn | string max 2000 | |
quote_msg_idtuỳ chọn | string | Trả lời tin nhắn này |
mentionstuỳ chọn | object[] max 50 items | |
└user_idbắt buộc | string max 200 | |
└offsetbắt buộc | integer ≥ 0 | |
└lengthbắt buộc | integer ≥ 1 |
Lệnh mẫu
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/messages" \
-H "Authorization: Bearer dpk_xxx" \
-H "Content-Type: application/json" \
-d '{"text":"Đơn #2291 đã giao, cảm ơn anh!","attachments":[{"upload_id":"upl_8f1c..."}]}'Phản hồi mẫu
{
"success": true,
"data": {
"channel": "zalo",
"thread_id": "8899001122",
"sent": [
{
"type": "file",
"msg_id": "7712",
"cli_msg_id": null
},
{
"type": "text",
"msg_id": "7713",
"cli_msg_id": "1760000000123"
}
]
},
"request_id": "3f0c0b6e-6d0a-4b8e-9d1a-1d2f3a4b5c6d"
}Một tin nhắn
/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}Scope: chat:readTham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại |
msgIdpath · bắt buộc | string max 200 | ID tin nhắn (msg_id) |
Lệnh mẫu
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}" \
-H "Authorization: Bearer dpk_xxx"Sửa nội dung tin đã gửi (Facebook, Telegram)
/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}Scope: chat:sendTham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại |
msgIdpath · bắt buộc | string max 200 | ID tin nhắn (msg_id) |
Body (JSON)
textbắt buộc | string max 10000 |
Lệnh mẫu
curl -X PATCH "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}" \
-H "Authorization: Bearer dpk_xxx" \
-H "Content-Type: application/json" \
-d '{"text":"string"}'Xoá tin phía mình
/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}Scope: chat:manageZalo: zalo:deleteMessage (onlyMe) rồi đánh dấu trong DB như UI. Kênh khác: chỉ xoá khỏi DB của Deplao.
Tham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại |
msgIdpath · bắt buộc | string max 200 | ID tin nhắn (msg_id) |
Lệnh mẫu
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}" \
-H "Authorization: Bearer dpk_xxx"Các tin xung quanh một tin (để mở lại ngữ cảnh)
/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/aroundScope: chat:readTham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại |
msgIdpath · bắt buộc | string max 200 | ID tin nhắn (msg_id) |
limitquery · tuỳ chọn | integer ≥ 1 · ≤ 100 · default 30 |
Lệnh mẫu
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/around" \
-H "Authorization: Bearer dpk_xxx"Tìm tin nhắn theo nội dung (full-text)
/api/v1/accounts/{accountId}/messages/searchScope: chat:readTham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản (accounts.zalo_id). Facebook dùng Facebook ID, Telegram dùng ID tài khoản Telegram. |
qquery · bắt buộc | string max 200 | Từ khoá |
thread_idquery · tuỳ chọn | string | Chỉ trong một hội thoại |
limitquery · tuỳ chọn | integer ≥ 1 · ≤ 200 · default 50 |
Lệnh mẫu
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/messages/search" \
-H "Authorization: Bearer dpk_xxx"Ảnh/video, file hoặc link đã chia sẻ trong hội thoại
/api/v1/accounts/{accountId}/conversations/{threadId}/mediaScope: chat:readTham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại (user id hoặc group id của kênh) |
kindquery · tuỳ chọn | "media" | "file" | "link" default "media" | |
limitquery · tuỳ chọn | integer ≥ 1 · ≤ 200 · default 50 | Số bản ghi tối đa (1–200) |
offsetquery · tuỳ chọn | integer ≥ 0 · default 0 | Bỏ qua N bản ghi đầu |
Lệnh mẫu
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/media" \
-H "Authorization: Bearer dpk_xxx"Chuyển tiếp tin sang hội thoại khác (cùng tài khoản)
/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/forwardScope: chat:sendHỗ trợ văn bản, ảnh, video, file (gửi lại từ file local như UI) và forward gốc của Facebook/Telegram. Loại khác trả 422.
Tham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại |
msgIdpath · bắt buộc | string max 200 | ID tin nhắn (msg_id) |
Body (JSON)
targetsbắt buộc | object[] max 20 items | |
└thread_idbắt buộc | string max 200 | |
└thread_typetuỳ chọn | "user" | "group" default "user" | user = chat 1-1, group = nhóm |
Lệnh mẫu
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/forward" \
-H "Authorization: Bearer dpk_xxx" \
-H "Content-Type: application/json" \
-d '{"targets":[]}'Thả reaction (emoji hoặc mã Zalo như HEART, LIKE)
/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/reactionsScope: chat:sendTham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại |
msgIdpath · bắt buộc | string max 200 | ID tin nhắn (msg_id) |
Body (JSON)
emojibắt buộc | string max 32 |
Lệnh mẫu
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/reactions" \
-H "Authorization: Bearer dpk_xxx" \
-H "Content-Type: application/json" \
-d '{"emoji":"string"}'Gỡ reaction của mình
/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/reactionsScope: chat:sendTham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại |
msgIdpath · bắt buộc | string max 200 | ID tin nhắn (msg_id) |
Lệnh mẫu
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/reactions" \
-H "Authorization: Bearer dpk_xxx"Thu hồi tin (với mọi người) rồi đánh dấu đã thu hồi trong DB
/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/recallScope: chat:manageTham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại |
msgIdpath · bắt buộc | string max 200 | ID tin nhắn (msg_id) |
Lệnh mẫu
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/recall" \
-H "Authorization: Bearer dpk_xxx"Ghim tin trong hội thoại
/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/pinScope: chat:manageTham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại |
msgIdpath · bắt buộc | string max 200 | ID tin nhắn (msg_id) |
Lệnh mẫu
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/pin" \
-H "Authorization: Bearer dpk_xxx"Bỏ ghim tin
/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/pinScope: chat:manageTham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại |
msgIdpath · bắt buộc | string max 200 | ID tin nhắn (msg_id) |
Lệnh mẫu
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/pin" \
-H "Authorization: Bearer dpk_xxx"Tin đã ghim của hội thoại
/api/v1/accounts/{accountId}/conversations/{threadId}/pinned-messagesScope: chat:readTham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại (user id hoặc group id của kênh) |
Lệnh mẫu
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/pinned-messages" \
-H "Authorization: Bearer dpk_xxx"Đánh dấu đã đọc (DB + báo "đã xem" lên kênh)
/api/v1/accounts/{accountId}/conversations/{threadId}/readScope: chat:manageTham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại (user id hoặc group id của kênh) |
Lệnh mẫu
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/read" \
-H "Authorization: Bearer dpk_xxx"Hiện trạng thái "đang gõ"
/api/v1/accounts/{accountId}/conversations/{threadId}/typingScope: chat:sendTham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại (user id hoặc group id của kênh) |
Body (JSON)
thread_typetuỳ chọn | "user" | "group" | user = chat 1-1, group = nhóm |
Lệnh mẫu
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/typing" \
-H "Authorization: Bearer dpk_xxx" \
-H "Content-Type: application/json" \
-d '{"thread_type":"user"}'Tin nháp đang soạn
/api/v1/accounts/{accountId}/conversations/{threadId}/draftScope: chat:readTham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại (user id hoặc group id của kênh) |
Lệnh mẫu
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/draft" \
-H "Authorization: Bearer dpk_xxx"Lưu tin nháp (hiện trong ô soạn của app)
/api/v1/accounts/{accountId}/conversations/{threadId}/draftScope: chat:manageTham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại (user id hoặc group id của kênh) |
Body (JSON)
contentbắt buộc | string max 10000 |
Lệnh mẫu
curl -X PUT "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/draft" \
-H "Authorization: Bearer dpk_xxx" \
-H "Content-Type: application/json" \
-d '{"content":"string"}'Xoá tin nháp
/api/v1/accounts/{accountId}/conversations/{threadId}/draftScope: chat:manageTham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại (user id hoặc group id của kênh) |
Lệnh mẫu
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/draft" \
-H "Authorization: Bearer dpk_xxx"Đánh dấu chưa đọc (đồng bộ lên Zalo)
/api/v1/accounts/{accountId}/conversations/{threadId}/unreadScope: chat:manageNhư menu "Đánh dấu chưa đọc": Zalo gắn dấu chưa đọc trên server (zalo:addUnreadMark). Bỏ dấu bằng DELETE …/unread.
Tham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại (user id hoặc group id của kênh) |
Lệnh mẫu
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/unread" \
-H "Authorization: Bearer dpk_xxx"Bỏ đánh dấu chưa đọc (đã đọc + gỡ dấu trên Zalo)
/api/v1/accounts/{accountId}/conversations/{threadId}/unreadScope: chat:manageNhư menu "Đánh dấu đã đọc": đánh dấu đã đọc như POST …/read, Zalo gỡ thêm dấu chưa đọc trên server (zalo:removeUnreadMark).
Tham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại (user id hoặc group id của kênh) |
Lệnh mẫu
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/unread" \
-H "Authorization: Bearer dpk_xxx"Ghim hội thoại (trên kênh nếu kênh hỗ trợ)
/api/v1/accounts/{accountId}/conversations/{threadId}/pinScope: chat:manageNhư menu "Ghim hội thoại": Zalo/Telegram ghim trên server (hiện ở mọi thiết bị); kênh không hỗ trợ thì ghim trong Deplao. where cho biết đã ghim ở đâu.
Tham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại (user id hoặc group id của kênh) |
Lệnh mẫu
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/pin" \
-H "Authorization: Bearer dpk_xxx"Bỏ ghim hội thoại
/api/v1/accounts/{accountId}/conversations/{threadId}/pinScope: chat:manageNhư menu "Ghim hội thoại": Zalo/Telegram ghim trên server (hiện ở mọi thiết bị); kênh không hỗ trợ thì ghim trong Deplao. where cho biết đã ghim ở đâu.
Tham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại (user id hoặc group id của kênh) |
Lệnh mẫu
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/pin" \
-H "Authorization: Bearer dpk_xxx"Tắt thông báo (lưu trong Deplao + đồng bộ lên Zalo/Telegram)
/api/v1/accounts/{accountId}/conversations/{threadId}/muteScope: chat:manageuntil = epoch ms hết hạn; bỏ trống hoặc 0 = vô thời hạn. synced = đã đồng bộ lên kênh hay chưa (kênh không hỗ trợ / lỗi mạng vẫn tắt trong Deplao).
Tham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại (user id hoặc group id của kênh) |
Body (JSON)
untiltuỳ chọn | integer ≥ 0 · default 0 |
Lệnh mẫu
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/mute" \
-H "Authorization: Bearer dpk_xxx" \
-H "Content-Type: application/json" \
-d '{"until":0}'Bật lại thông báo
/api/v1/accounts/{accountId}/conversations/{threadId}/muteScope: chat:manageTham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại (user id hoặc group id của kênh) |
Lệnh mẫu
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/mute" \
-H "Authorization: Bearer dpk_xxx"Chuyển vào "Khác (lưu trữ)" (tắt thông báo, Telegram: lưu trữ)
/api/v1/accounts/{accountId}/conversations/{threadId}/othersScope: chat:manageTham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại (user id hoặc group id của kênh) |
Lệnh mẫu
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/others" \
-H "Authorization: Bearer dpk_xxx"Đưa về danh sách chính (bật thông báo)
/api/v1/accounts/{accountId}/conversations/{threadId}/othersScope: chat:manageTham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại (user id hoặc group id của kênh) |
Lệnh mẫu
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/others" \
-H "Authorization: Bearer dpk_xxx"Tải tin cũ từ server của kênh vào Deplao
/api/v1/accounts/{accountId}/conversations/{threadId}/history/syncScope: chat:readLưu vào DB rồi đọc bằng GET …/messages. Telegram: before_msg_id = msg_id cũ nhất bạn đang có để lấy trang cũ hơn. Facebook: dùng next_cursor của lần trước làm before_cursor. Zalo: chỉ nhóm (Zalo không cho tải lịch sử chat 1-1).
Tham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại (user id hoặc group id của kênh) |
Body (JSON)
limittuỳ chọn | integer ≥ 1 · ≤ 200 · default 50 | |
before_msg_idtuỳ chọn | string max 64 | |
before_cursortuỳ chọn | string max 500 | |
topic_idtuỳ chọn | string max 64 | Telegram forum topic |
Lệnh mẫu
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/history/sync" \
-H "Authorization: Bearer dpk_xxx" \
-H "Content-Type: application/json" \
-d '{"limit":50,"before_msg_id":"string","before_cursor":"string"}'Mọi tin nháp đang soạn của tài khoản (mới sửa trước)
/api/v1/accounts/{accountId}/draftsScope: chat:readTham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản (accounts.zalo_id). Facebook dùng Facebook ID, Telegram dùng ID tài khoản Telegram. |
Lệnh mẫu
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/drafts" \
-H "Authorization: Bearer dpk_xxx"Gửi danh thiếp (Zalo: theo user_id; Telegram bot: theo số điện thoại)
/api/v1/accounts/{accountId}/conversations/{threadId}/messages/contact-cardScope: chat:sendTham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại (user id hoặc group id của kênh) |
Body (JSON)
user_idtuỳ chọn | string max 200 | Zalo: ID người được giới thiệu |
phonetuỳ chọn | string max 30 | Zalo: tuỳ chọn; Telegram bot: bắt buộc |
nametuỳ chọn | string max 100 | Telegram bot: tên hiển thị (bắt buộc) |
thread_typetuỳ chọn | "user" | "group" | user = chat 1-1, group = nhóm |
quote_msg_idtuỳ chọn | string |
Lệnh mẫu
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/messages/contact-card" \
-H "Authorization: Bearer dpk_xxx" \
-H "Content-Type: application/json" \
-d '{"user_id":"8412345678901234567","phone":"0912345678"}'Gửi thẻ ngân hàng (Zalo), thẻ đã lưu hoặc nhập trực tiếp
/api/v1/accounts/{accountId}/conversations/{threadId}/messages/bank-cardScope: chat:sendTruyền bank_card_id (từ GET /accounts/{accountId}/bank-cards) hoặc đủ bin_bank, account_number, account_name.
Tham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại (user id hoặc group id của kênh) |
Body (JSON)
bank_card_idtuỳ chọn | integer ≥ 1 | |
bin_banktuỳ chọn | integer ≥ 100000 · ≤ 999999 | Mã BIN ngân hàng (6 số) |
account_numbertuỳ chọn | string max 40 | |
account_nametuỳ chọn | string max 100 | |
thread_typetuỳ chọn | "user" | "group" | user = chat 1-1, group = nhóm |
Lệnh mẫu
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/messages/bank-card" \
-H "Authorization: Bearer dpk_xxx" \
-H "Content-Type: application/json" \
-d '{"bin_bank":970436,"account_number":"0011001234567","account_name":"NGUYEN VAN A"}'Gửi tin nhắn thoại (Zalo, Telegram bot)
/api/v1/accounts/{accountId}/conversations/{threadId}/messages/voiceScope: chat:sendFile âm thanh (m4a/mp3/ogg…) qua upload_id, library_uuid hoặc url. Zalo: upload rồi gửi dạng ghi âm như nút micro trong app. Kênh khác: gửi file âm thanh bằng POST …/messages.
Tham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại (user id hoặc group id của kênh) |
Body (JSON)
upload_idtuỳ chọn | string | ID từ POST /media/uploads |
library_uuidtuỳ chọn | string | UUID item trong thư viện media |
urltuỳ chọn | string (uri) | Link http/https công khai, server tự tải về |
Lệnh mẫu
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/messages/voice" \
-H "Authorization: Bearer dpk_xxx" \
-H "Content-Type: application/json" \
-d '{"upload_id":"string","library_uuid":"string","url":"https://example.com/file.jpg"}'Nhắc hẹn trong hội thoại (Zalo)
/api/v1/accounts/{accountId}/conversations/{threadId}/remindersScope: chat:readTham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại (user id hoặc group id của kênh) |
limitquery · tuỳ chọn | integer ≥ 1 · ≤ 50 · default 20 |
Lệnh mẫu
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/reminders" \
-H "Authorization: Bearer dpk_xxx"Tạo nhắc hẹn (Zalo)
/api/v1/accounts/{accountId}/conversations/{threadId}/remindersScope: chat:manageTham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại (user id hoặc group id của kênh) |
Body (JSON)
titlebắt buộc | string max 200 | |
start_timebắt buộc | integer ≥ 0 | Epoch ms, phải ở tương lai |
repeattuỳ chọn | "none" | "daily" | "weekly" | "monthly" default "none" | |
emojituỳ chọn | string max 16 · default "⏰" |
Lệnh mẫu
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/reminders" \
-H "Authorization: Bearer dpk_xxx" \
-H "Content-Type: application/json" \
-d '{"title":"Gọi lại cho khách","start_time":1767225600000,"repeat":"none"}'Sửa nhắc hẹn (Zalo)
/api/v1/accounts/{accountId}/conversations/{threadId}/reminders/{reminderId}Scope: chat:manageTham số
accountIdpath · bắt buộc | string max 200 | |
threadIdpath · bắt buộc | string max 200 | |
reminderIdpath · bắt buộc | string max 200 |
Body (JSON)
titlebắt buộc | string max 200 | |
start_timebắt buộc | integer ≥ 0 | |
repeattuỳ chọn | "none" | "daily" | "weekly" | "monthly" default "none" | |
emojituỳ chọn | string max 16 · default "⏰" |
Lệnh mẫu
curl -X PATCH "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/reminders/{reminderId}" \
-H "Authorization: Bearer dpk_xxx" \
-H "Content-Type: application/json" \
-d '{"title":"string","start_time":0,"repeat":"none"}'Xoá nhắc hẹn (Zalo)
/api/v1/accounts/{accountId}/conversations/{threadId}/reminders/{reminderId}Scope: chat:manageTham số
accountIdpath · bắt buộc | string max 200 | |
threadIdpath · bắt buộc | string max 200 | |
reminderIdpath · bắt buộc | string max 200 |
Lệnh mẫu
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/reminders/{reminderId}" \
-H "Authorization: Bearer dpk_xxx"Tự xoá tin nhắn của hội thoại trên Zalo
/api/v1/accounts/{accountId}/conversations/{threadId}/auto-deleteScope: chat:readĐọc lại từ Zalo (Zalo không báo khi đổi trên điện thoại). ttl_ms (ms): 0 = Tắt, 86400000 = 1 ngày, 604800000 = 7 ngày, 1209600000 = 14 ngày. Zalo xoá tin trên các thiết bị Zalo; Deplao vẫn giữ tin đã lưu.
Tham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại (user id hoặc group id của kênh) |
Lệnh mẫu
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/auto-delete" \
-H "Authorization: Bearer dpk_xxx"Bật / tắt tự xoá tin nhắn trên Zalo
/api/v1/accounts/{accountId}/conversations/{threadId}/auto-deleteScope: chat:manageNhư mục "Tự xoá tin nhắn" trong chi tiết hội thoại. ttl_ms (ms): 0 = Tắt, 86400000 = 1 ngày, 604800000 = 7 ngày, 1209600000 = 14 ngày. Zalo xoá tin trên các thiết bị Zalo; Deplao vẫn giữ tin đã lưu. Nhóm có thể chỉ cho trưởng / phó nhóm đổi.
Tham số
accountIdpath · bắt buộc | string max 200 | ID tài khoản |
threadIdpath · bắt buộc | string max 200 | ID hội thoại (user id hoặc group id của kênh) |
Body (JSON)
ttl_msbắt buộc | integer ≥ 0 | 0 = tắt; 86400000 = 1 ngày; 604800000 = 7 ngày; 1209600000 = 14 ngày |
thread_typetuỳ chọn | "user" | "group" default "user" | user = chat 1-1, group = nhóm |
Lệnh mẫu
curl -X PUT "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/auto-delete" \
-H "Authorization: Bearer dpk_xxx" \
-H "Content-Type: application/json" \
-d '{"ttl_ms":0,"thread_type":"user"}'