Bỏ qua tới nội dung

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

Danh sách hội thoại, mới nhất trước

GET/api/v1/accounts/{accountId}/conversationsScope: chat:read

Tham số

accountId
path · 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.
limit
query · tuỳ chọn
integer
≥ 1 · ≤ 200 · default 50
Số bản ghi tối đa (1–200)
offset
query · tuỳ chọn
integer
≥ 0 · default 0
Bỏ qua N bản ghi đầu
search
query · tuỳ chọn
string
max 200
Tìm theo tên/số điện thoại
unread_only
query · tuỳ chọn
boolean
folder
query · tuỳ chọn
"all" | "main" | "others"
default "all"
Zalo: hộp thư chính / khác

Lệnh mẫu

bash
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

GET/api/v1/accounts/{accountId}/conversations/{threadId}Scope: chat:read

Tham số

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · 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

bash
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)

PATCH/api/v1/accounts/{accountId}/conversations/{threadId}Scope: chat:manage

Cá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ố

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · bắt buộc
string
max 200
ID hội thoại (user id hoặc group id của kênh)

Body (JSON)

pinned
tuỳ chọn
boolean
muted
tuỳ chọn
boolean
mute_until
tuỳ chọn
integer
≥ 0
Epoch ms; 0 = vô thời hạn
alias
tuỳ chọn
string
max 100

Lệnh mẫu

bash
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)

DELETE/api/v1/accounts/{accountId}/conversations/{threadId}Scope: chat:manage

Khô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ố

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · bắt buộc
string
max 200
ID hội thoại (user id hoặc group id của kênh)
confirm
query · tuỳ chọn
boolean
default false
Phải là true

Lệnh mẫu

bash
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

GET/api/v1/accounts/{accountId}/unread-countScope: chat:read

Tham số

accountId
path · 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

bash
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`

GET/api/v1/accounts/{accountId}/conversations/{threadId}/messagesScope: chat:read

Trang 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ố

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · bắt buộc
string
max 200
ID hội thoại (user id hoặc group id của kênh)
limit
query · tuỳ chọn
integer
≥ 1 · ≤ 200 · default 50
before
query · tuỳ chọn
integer
≥ 0
Chỉ lấy tin có timestamp <= before (epoch ms)
topic_id
query · tuỳ chọn
stringTelegram forum topic
type
query · tuỳ chọn
string
max 50
Lọc theo msg_type (vd: photo, file)

Lệnh mẫu

bash
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)

POST/api/v1/accounts/{accountId}/conversations/{threadId}/messagesScope: chat:send

Gử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ố

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · 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_type
tuỳ chọn
"user" | "group"Bỏ trống = tự tra theo hội thoại
text
tuỳ chọn
string
max 10000
attachments
tuỳ chọn
object[]
max 10 items
└upload_id
tuỳ chọn
stringID từ POST /media/uploads
└library_uuid
tuỳ chọn
stringUUID item trong thư viện media
└url
tuỳ chọn
string (uri)Link http/https công khai, server tự tải về (≤ giới hạn upload)
└kind
tuỳ chọn
"image" | "video" | "audio" | "file"Bỏ trống = tự nhận theo đuôi file
└caption
tuỳ chọn
string
max 2000
sticker_id
tuỳ chọn
string | integer
link
tuỳ chọn
object
└url
bắt buộc
string (uri)
└text
tuỳ chọn
string
max 2000
quote_msg_id
tuỳ chọn
stringTrả lời tin nhắn này
mentions
tuỳ chọn
object[]
max 50 items
└user_id
bắt buộc
string
max 200
└offset
bắt buộc
integer
≥ 0
└length
bắt buộc
integer
≥ 1

Lệnh mẫu

bash
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

json
{
  "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

GET/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}Scope: chat:read

Tham số

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · bắt buộc
string
max 200
ID hội thoại
msgId
path · bắt buộc
string
max 200
ID tin nhắn (msg_id)

Lệnh mẫu

bash
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)

PATCH/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}Scope: chat:send

Tham số

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · bắt buộc
string
max 200
ID hội thoại
msgId
path · bắt buộc
string
max 200
ID tin nhắn (msg_id)

Body (JSON)

text
bắt buộc
string
max 10000

Lệnh mẫu

bash
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

DELETE/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}Scope: chat:manage

Zalo: 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ố

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · bắt buộc
string
max 200
ID hội thoại
msgId
path · bắt buộc
string
max 200
ID tin nhắn (msg_id)

Lệnh mẫu

bash
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)

GET/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/aroundScope: chat:read

Tham số

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · bắt buộc
string
max 200
ID hội thoại
msgId
path · bắt buộc
string
max 200
ID tin nhắn (msg_id)
limit
query · tuỳ chọn
integer
≥ 1 · ≤ 100 · default 30

Lệnh mẫu

bash
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)

GET/api/v1/accounts/{accountId}/messages/searchScope: chat:read

Tham số

accountId
path · 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.
q
query · bắt buộc
string
max 200
Từ khoá
thread_id
query · tuỳ chọn
stringChỉ trong một hội thoại
limit
query · tuỳ chọn
integer
≥ 1 · ≤ 200 · default 50

Lệnh mẫu

bash
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

GET/api/v1/accounts/{accountId}/conversations/{threadId}/mediaScope: chat:read

Tham số

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · bắt buộc
string
max 200
ID hội thoại (user id hoặc group id của kênh)
kind
query · tuỳ chọn
"media" | "file" | "link"
default "media"
limit
query · tuỳ chọn
integer
≥ 1 · ≤ 200 · default 50
Số bản ghi tối đa (1–200)
offset
query · tuỳ chọn
integer
≥ 0 · default 0
Bỏ qua N bản ghi đầu

Lệnh mẫu

bash
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)

POST/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/forwardScope: chat:send

Hỗ 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ố

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · bắt buộc
string
max 200
ID hội thoại
msgId
path · bắt buộc
string
max 200
ID tin nhắn (msg_id)

Body (JSON)

targets
bắt buộc
object[]
max 20 items
└thread_id
bắt buộc
string
max 200
└thread_type
tuỳ chọn
"user" | "group"
default "user"
user = chat 1-1, group = nhóm

Lệnh mẫu

bash
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)

POST/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/reactionsScope: chat:send

Tham số

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · bắt buộc
string
max 200
ID hội thoại
msgId
path · bắt buộc
string
max 200
ID tin nhắn (msg_id)

Body (JSON)

emoji
bắt buộc
string
max 32

Lệnh mẫu

bash
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

DELETE/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/reactionsScope: chat:send

Tham số

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · bắt buộc
string
max 200
ID hội thoại
msgId
path · bắt buộc
string
max 200
ID tin nhắn (msg_id)

Lệnh mẫu

bash
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

POST/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/recallScope: chat:manage

Tham số

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · bắt buộc
string
max 200
ID hội thoại
msgId
path · bắt buộc
string
max 200
ID tin nhắn (msg_id)

Lệnh mẫu

bash
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

POST/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/pinScope: chat:manage

Tham số

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · bắt buộc
string
max 200
ID hội thoại
msgId
path · bắt buộc
string
max 200
ID tin nhắn (msg_id)

Lệnh mẫu

bash
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

DELETE/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/pinScope: chat:manage

Tham số

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · bắt buộc
string
max 200
ID hội thoại
msgId
path · bắt buộc
string
max 200
ID tin nhắn (msg_id)

Lệnh mẫu

bash
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

GET/api/v1/accounts/{accountId}/conversations/{threadId}/pinned-messagesScope: chat:read

Tham số

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · 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

bash
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)

POST/api/v1/accounts/{accountId}/conversations/{threadId}/readScope: chat:manage

Tham số

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · 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

bash
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õ"

POST/api/v1/accounts/{accountId}/conversations/{threadId}/typingScope: chat:send

Tham số

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · 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_type
tuỳ chọn
"user" | "group"user = chat 1-1, group = nhóm

Lệnh mẫu

bash
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

GET/api/v1/accounts/{accountId}/conversations/{threadId}/draftScope: chat:read

Tham số

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · 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

bash
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)

PUT/api/v1/accounts/{accountId}/conversations/{threadId}/draftScope: chat:manage

Tham số

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · bắt buộc
string
max 200
ID hội thoại (user id hoặc group id của kênh)

Body (JSON)

content
bắt buộc
string
max 10000

Lệnh mẫu

bash
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

DELETE/api/v1/accounts/{accountId}/conversations/{threadId}/draftScope: chat:manage

Tham số

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · 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

bash
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)

POST/api/v1/accounts/{accountId}/conversations/{threadId}/unreadScope: chat:manage

Như 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ố

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · 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

bash
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)

DELETE/api/v1/accounts/{accountId}/conversations/{threadId}/unreadScope: chat:manage

Như 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ố

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · 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

bash
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ợ)

POST/api/v1/accounts/{accountId}/conversations/{threadId}/pinScope: chat:manage

Như 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ố

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · 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

bash
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

DELETE/api/v1/accounts/{accountId}/conversations/{threadId}/pinScope: chat:manage

Như 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ố

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · 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

bash
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)

POST/api/v1/accounts/{accountId}/conversations/{threadId}/muteScope: chat:manage

until = 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ố

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · bắt buộc
string
max 200
ID hội thoại (user id hoặc group id của kênh)

Body (JSON)

until
tuỳ chọn
integer
≥ 0 · default 0

Lệnh mẫu

bash
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

DELETE/api/v1/accounts/{accountId}/conversations/{threadId}/muteScope: chat:manage

Tham số

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · 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

bash
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ữ)

POST/api/v1/accounts/{accountId}/conversations/{threadId}/othersScope: chat:manage

Tham số

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · 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

bash
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)

DELETE/api/v1/accounts/{accountId}/conversations/{threadId}/othersScope: chat:manage

Tham số

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · 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

bash
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

POST/api/v1/accounts/{accountId}/conversations/{threadId}/history/syncScope: chat:read

Lư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ố

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · bắt buộc
string
max 200
ID hội thoại (user id hoặc group id của kênh)

Body (JSON)

limit
tuỳ chọn
integer
≥ 1 · ≤ 200 · default 50
before_msg_id
tuỳ chọn
string
max 64
before_cursor
tuỳ chọn
string
max 500
topic_id
tuỳ chọn
string
max 64
Telegram forum topic

Lệnh mẫu

bash
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)

GET/api/v1/accounts/{accountId}/draftsScope: chat:read

Tham số

accountId
path · 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

bash
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)

POST/api/v1/accounts/{accountId}/conversations/{threadId}/messages/contact-cardScope: chat:send

Tham số

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · 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_id
tuỳ chọn
string
max 200
Zalo: ID người được giới thiệu
phone
tuỳ chọn
string
max 30
Zalo: tuỳ chọn; Telegram bot: bắt buộc
name
tuỳ chọn
string
max 100
Telegram bot: tên hiển thị (bắt buộc)
thread_type
tuỳ chọn
"user" | "group"user = chat 1-1, group = nhóm
quote_msg_id
tuỳ chọn
string

Lệnh mẫu

bash
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

POST/api/v1/accounts/{accountId}/conversations/{threadId}/messages/bank-cardScope: chat:send

Truyền bank_card_id (từ GET /accounts/{accountId}/bank-cards) hoặc đủ bin_bank, account_number, account_name.

Tham số

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · 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_id
tuỳ chọn
integer
≥ 1
bin_bank
tuỳ chọn
integer
≥ 100000 · ≤ 999999
Mã BIN ngân hàng (6 số)
account_number
tuỳ chọn
string
max 40
account_name
tuỳ chọn
string
max 100
thread_type
tuỳ chọn
"user" | "group"user = chat 1-1, group = nhóm

Lệnh mẫu

bash
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)

POST/api/v1/accounts/{accountId}/conversations/{threadId}/messages/voiceScope: chat:send

File â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ố

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · 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_id
tuỳ chọn
stringID từ POST /media/uploads
library_uuid
tuỳ chọn
stringUUID item trong thư viện media
url
tuỳ chọn
string (uri)Link http/https công khai, server tự tải về

Lệnh mẫu

bash
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)

GET/api/v1/accounts/{accountId}/conversations/{threadId}/remindersScope: chat:read

Tham số

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · bắt buộc
string
max 200
ID hội thoại (user id hoặc group id của kênh)
limit
query · tuỳ chọn
integer
≥ 1 · ≤ 50 · default 20

Lệnh mẫu

bash
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)

POST/api/v1/accounts/{accountId}/conversations/{threadId}/remindersScope: chat:manage

Tham số

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · bắt buộc
string
max 200
ID hội thoại (user id hoặc group id của kênh)

Body (JSON)

title
bắt buộc
string
max 200
start_time
bắt buộc
integer
≥ 0
Epoch ms, phải ở tương lai
repeat
tuỳ chọn
"none" | "daily" | "weekly" | "monthly"
default "none"
emoji
tuỳ chọn
string
max 16 · default "⏰"

Lệnh mẫu

bash
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)

PATCH/api/v1/accounts/{accountId}/conversations/{threadId}/reminders/{reminderId}Scope: chat:manage

Tham số

accountId
path · bắt buộc
string
max 200
threadId
path · bắt buộc
string
max 200
reminderId
path · bắt buộc
string
max 200

Body (JSON)

title
bắt buộc
string
max 200
start_time
bắt buộc
integer
≥ 0
repeat
tuỳ chọn
"none" | "daily" | "weekly" | "monthly"
default "none"
emoji
tuỳ chọn
string
max 16 · default "⏰"

Lệnh mẫu

bash
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)

DELETE/api/v1/accounts/{accountId}/conversations/{threadId}/reminders/{reminderId}Scope: chat:manage

Tham số

accountId
path · bắt buộc
string
max 200
threadId
path · bắt buộc
string
max 200
reminderId
path · bắt buộc
string
max 200

Lệnh mẫu

bash
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

GET/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ố

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · 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

bash
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

PUT/api/v1/accounts/{accountId}/conversations/{threadId}/auto-deleteScope: chat:manage

Như 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ố

accountId
path · bắt buộc
string
max 200
ID tài khoản
threadId
path · 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_ms
bắt buộc
integer
≥ 0
0 = tắt; 86400000 = 1 ngày; 604800000 = 7 ngày; 1209600000 = 14 ngày
thread_type
tuỳ chọn
"user" | "group"
default "user"
user = chat 1-1, group = nhóm

Lệnh mẫu

bash
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"}'