Chat
Conversations and messages on every channel: read, search, send, recall, react, pin, mark as read. · 44 endpoints
- 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
List conversations, most recent first
/api/v1/accounts/{accountId}/conversationsScope: chat:readParameters
accountIdpath · required | string max 200 | Account ID (accounts.zalo_id). Facebook uses the Facebook ID, Telegram uses the Telegram account ID. |
limitquery · optional | integer ≥ 1 · ≤ 200 · default 50 | Maximum number of records (1–200) |
offsetquery · optional | integer ≥ 0 · default 0 | Skip the first N records |
searchquery · optional | string max 200 | Search by name/phone number |
unread_onlyquery · optional | boolean | |
folderquery · optional | "all" | "main" | "others" default "all" | Zalo: main inbox / others |
Example request
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations" \
-H "Authorization: Bearer dpk_xxx"Get a conversation with its labels and pin status
/api/v1/accounts/{accountId}/conversations/{threadId}Scope: chat:readParameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID (the channel's user id or group id) |
Example request
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}" \
-H "Authorization: Bearer dpk_xxx"Pin, mute, set a nickname (in Deplao)
/api/v1/accounts/{accountId}/conversations/{threadId}Scope: chat:manageFlags stored in Deplao, as in the UI: local pin (db:setLocalPinnedConversation), mute (db:setContactFlags), nickname (db:setContactAlias).
Parameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID (the channel's user id or group id) |
Request body (JSON)
pinnedoptional | boolean | |
mutedoptional | boolean | |
mute_untiloptional | integer ≥ 0 | Epoch ms; 0 = indefinitely |
aliasoptional | string max 100 |
Example request
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}'Delete the conversation (all its messages in Deplao; for Zalo, also deleted on the server)
/api/v1/accounts/{accountId}/conversations/{threadId}Scope: chat:manageCannot be undone: ?confirm=true is required. Same as the "Delete conversation" menu item (Xóa hội thoại): for Zalo it calls zalo:deleteChat with the last message, then deletes the conversation from the DB.
Parameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID (the channel's user id or group id) |
confirmquery · optional | boolean default false | Must be true |
Example request
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}" \
-H "Authorization: Bearer dpk_xxx"Total number of unread messages for the account
/api/v1/accounts/{accountId}/unread-countScope: chat:readParameters
accountIdpath · required | string max 200 | Account ID (accounts.zalo_id). Facebook uses the Facebook ID, Telegram uses the Telegram account ID. |
Example request
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/unread-count" \
-H "Authorization: Bearer dpk_xxx"Messages of a conversation, newest → oldest, paginated with `before`
/api/v1/accounts/{accountId}/conversations/{threadId}/messagesScope: chat:readNext page: call again with before = pagination.next_before. Messages sharing the same timestamp may repeat at the page boundary: deduplicate by msg_id.
Parameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID (the channel's user id or group id) |
limitquery · optional | integer ≥ 1 · ≤ 200 · default 50 | |
beforequery · optional | integer ≥ 0 | Only messages with timestamp <= before (epoch ms) |
topic_idquery · optional | string | Telegram forum topic |
typequery · optional | string max 50 | Filter by msg_type (e.g. photo, file) |
Example request
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/messages" \
-H "Authorization: Bearer dpk_xxx"Send a message: text, file/photo/video, sticker, link (all channels)
/api/v1/accounts/{accountId}/conversations/{threadId}/messagesScope: chat:sendSends exactly as if you clicked Send in the app (same IPC handler, same send queue). Order: attachments → sticker → link → text.
Attachments do NOT accept local file paths: use upload_id (POST /media/uploads), library_uuid or a public url.
Zalo videos go through the getVideoMeta → uploadVideoThumb → uploadVideoFile → sendVideo chain, just like the UI.
Supports the Idempotency-Key header so you can safely resend after a dropped connection.
Parameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID (the channel's user id or group id) |
Request body (JSON)
thread_typeoptional | "user" | "group" | Empty = looked up from the conversation |
textoptional | string max 10000 | |
attachmentsoptional | object[] max 10 items | |
└upload_idoptional | string | ID from POST /media/uploads |
└library_uuidoptional | string | UUID of an item in the media library |
└urloptional | string (uri) | Public http/https link; the server downloads it itself (≤ the upload limit) |
└kindoptional | "image" | "video" | "audio" | "file" | Empty = detected from the file extension |
└captionoptional | string max 2000 | |
sticker_idoptional | string | integer | |
linkoptional | object | |
└urlrequired | string (uri) | |
└textoptional | string max 2000 | |
quote_msg_idoptional | string | Reply to this message |
mentionsoptional | object[] max 50 items | |
└user_idrequired | string max 200 | |
└offsetrequired | integer ≥ 0 | |
└lengthrequired | integer ≥ 1 |
Example request
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..."}]}'Example response
{
"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"
}Get a message
/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}Scope: chat:readParameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID |
msgIdpath · required | string max 200 | Message ID (msg_id) |
Example request
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}" \
-H "Authorization: Bearer dpk_xxx"Edit the text of a sent message (Facebook, Telegram)
/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}Scope: chat:sendParameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID |
msgIdpath · required | string max 200 | Message ID (msg_id) |
Request body (JSON)
textrequired | string max 10000 |
Example request
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"}'Delete a message on your side only
/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}Scope: chat:manageZalo: zalo:deleteMessage (onlyMe), then marks it in the DB as the UI does. Other channels: only removed from Deplao's DB.
Parameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID |
msgIdpath · required | string max 200 | Message ID (msg_id) |
Example request
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}" \
-H "Authorization: Bearer dpk_xxx"Messages around a message (to reopen its context)
/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/aroundScope: chat:readParameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID |
msgIdpath · required | string max 200 | Message ID (msg_id) |
limitquery · optional | integer ≥ 1 · ≤ 100 · default 30 |
Example request
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/around" \
-H "Authorization: Bearer dpk_xxx"Search messages by content (full-text)
/api/v1/accounts/{accountId}/messages/searchScope: chat:readParameters
accountIdpath · required | string max 200 | Account ID (accounts.zalo_id). Facebook uses the Facebook ID, Telegram uses the Telegram account ID. |
qquery · required | string max 200 | Keyword |
thread_idquery · optional | string | Only within one conversation |
limitquery · optional | integer ≥ 1 · ≤ 200 · default 50 |
Example request
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/messages/search" \
-H "Authorization: Bearer dpk_xxx"Photos/videos, files or links shared in the conversation
/api/v1/accounts/{accountId}/conversations/{threadId}/mediaScope: chat:readParameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID (the channel's user id or group id) |
kindquery · optional | "media" | "file" | "link" default "media" | |
limitquery · optional | integer ≥ 1 · ≤ 200 · default 50 | Maximum number of records (1–200) |
offsetquery · optional | integer ≥ 0 · default 0 | Skip the first N records |
Example request
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/media" \
-H "Authorization: Bearer dpk_xxx"Forward a message to other conversations (same account)
/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/forwardScope: chat:sendSupports text, photos, videos and files (re-sent from the local file, as in the UI) and native Facebook/Telegram forwarding. Other types return 422.
Parameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID |
msgIdpath · required | string max 200 | Message ID (msg_id) |
Request body (JSON)
targetsrequired | object[] max 20 items | |
└thread_idrequired | string max 200 | |
└thread_typeoptional | "user" | "group" default "user" | user = 1-1 chat, group = group chat |
Example request
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":[]}'Add a reaction (emoji or a Zalo code such as HEART, LIKE)
/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/reactionsScope: chat:sendParameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID |
msgIdpath · required | string max 200 | Message ID (msg_id) |
Request body (JSON)
emojirequired | string max 32 |
Example request
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"}'Remove your reaction
/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/reactionsScope: chat:sendParameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID |
msgIdpath · required | string max 200 | Message ID (msg_id) |
Example request
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/reactions" \
-H "Authorization: Bearer dpk_xxx"Recall (unsend) a message for everyone, then mark it as recalled in the DB
/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/recallScope: chat:manageParameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID |
msgIdpath · required | string max 200 | Message ID (msg_id) |
Example request
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/recall" \
-H "Authorization: Bearer dpk_xxx"Pin a message in the conversation
/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/pinScope: chat:manageParameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID |
msgIdpath · required | string max 200 | Message ID (msg_id) |
Example request
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/pin" \
-H "Authorization: Bearer dpk_xxx"Unpin a message
/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/pinScope: chat:manageParameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID |
msgIdpath · required | string max 200 | Message ID (msg_id) |
Example request
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/messages/{msgId}/pin" \
-H "Authorization: Bearer dpk_xxx"Pinned messages of the conversation
/api/v1/accounts/{accountId}/conversations/{threadId}/pinned-messagesScope: chat:readParameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID (the channel's user id or group id) |
Example request
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/pinned-messages" \
-H "Authorization: Bearer dpk_xxx"Mark as read (DB + reports "seen" to the channel)
/api/v1/accounts/{accountId}/conversations/{threadId}/readScope: chat:manageParameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID (the channel's user id or group id) |
Example request
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/read" \
-H "Authorization: Bearer dpk_xxx"Show the "typing" indicator
/api/v1/accounts/{accountId}/conversations/{threadId}/typingScope: chat:sendParameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID (the channel's user id or group id) |
Request body (JSON)
thread_typeoptional | "user" | "group" | user = 1-1 chat, group = group chat |
Example request
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"}'Draft being composed
/api/v1/accounts/{accountId}/conversations/{threadId}/draftScope: chat:readParameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID (the channel's user id or group id) |
Example request
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/draft" \
-H "Authorization: Bearer dpk_xxx"Save a draft (shown in the app's composer)
/api/v1/accounts/{accountId}/conversations/{threadId}/draftScope: chat:manageParameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID (the channel's user id or group id) |
Request body (JSON)
contentrequired | string max 10000 |
Example request
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"}'Delete the draft
/api/v1/accounts/{accountId}/conversations/{threadId}/draftScope: chat:manageParameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID (the channel's user id or group id) |
Example request
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/draft" \
-H "Authorization: Bearer dpk_xxx"Mark as unread (synced to Zalo)
/api/v1/accounts/{accountId}/conversations/{threadId}/unreadScope: chat:manageSame as the "Mark as unread" menu item (Đánh dấu chưa đọc): for Zalo, sets the unread mark on the server (zalo:addUnreadMark). Remove the mark with DELETE …/unread.
Parameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID (the channel's user id or group id) |
Example request
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/unread" \
-H "Authorization: Bearer dpk_xxx"Clear the unread mark (marks as read + removes the mark on Zalo)
/api/v1/accounts/{accountId}/conversations/{threadId}/unreadScope: chat:manageSame as the "Mark as read" menu item (Đánh dấu đã đọc): marks as read like POST …/read; for Zalo, also removes the unread mark on the server (zalo:removeUnreadMark).
Parameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID (the channel's user id or group id) |
Example request
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/unread" \
-H "Authorization: Bearer dpk_xxx"Pin the conversation (on the channel, if the channel supports it)
/api/v1/accounts/{accountId}/conversations/{threadId}/pinScope: chat:manageSame as the "Pin conversation" menu item (Ghim hội thoại): Zalo/Telegram pin on the server (visible on every device); on channels without support it is pinned in Deplao. where tells you where it was pinned.
Parameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID (the channel's user id or group id) |
Example request
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/pin" \
-H "Authorization: Bearer dpk_xxx"Unpin the conversation
/api/v1/accounts/{accountId}/conversations/{threadId}/pinScope: chat:manageSame as the "Pin conversation" menu item (Ghim hội thoại): Zalo/Telegram pin on the server (visible on every device); on channels without support it is pinned in Deplao. where tells you where it was pinned.
Parameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID (the channel's user id or group id) |
Example request
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/pin" \
-H "Authorization: Bearer dpk_xxx"Mute notifications (stored in Deplao + synced to Zalo/Telegram)
/api/v1/accounts/{accountId}/conversations/{threadId}/muteScope: chat:manageuntil = expiry time in epoch ms; empty or 0 = indefinitely. synced = whether it was synced to the channel (if the channel doesn't support it or there is a network error, it is still muted in Deplao).
Parameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID (the channel's user id or group id) |
Request body (JSON)
untiloptional | integer ≥ 0 · default 0 |
Example request
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}'Unmute notifications
/api/v1/accounts/{accountId}/conversations/{threadId}/muteScope: chat:manageParameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID (the channel's user id or group id) |
Example request
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/mute" \
-H "Authorization: Bearer dpk_xxx"Move to "Others (archive)" ("Khác (lưu trữ)"): mutes notifications; archives on Telegram
/api/v1/accounts/{accountId}/conversations/{threadId}/othersScope: chat:manageParameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID (the channel's user id or group id) |
Example request
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/others" \
-H "Authorization: Bearer dpk_xxx"Move back to the main list (unmutes notifications)
/api/v1/accounts/{accountId}/conversations/{threadId}/othersScope: chat:manageParameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID (the channel's user id or group id) |
Example request
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/others" \
-H "Authorization: Bearer dpk_xxx"Load older messages from the channel's server into Deplao
/api/v1/accounts/{accountId}/conversations/{threadId}/history/syncScope: chat:readSaved to the DB; read them with GET …/messages. Telegram: set before_msg_id to the oldest msg_id you have to get an older page. Facebook: pass the previous call's next_cursor as before_cursor. Zalo: groups only (Zalo doesn't allow loading 1-1 chat history).
Parameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID (the channel's user id or group id) |
Request body (JSON)
limitoptional | integer ≥ 1 · ≤ 200 · default 50 | |
before_msg_idoptional | string max 64 | |
before_cursoroptional | string max 500 | |
topic_idoptional | string max 64 | Telegram forum topic |
Example request
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"}'All drafts of the account (most recently edited first)
/api/v1/accounts/{accountId}/draftsScope: chat:readParameters
accountIdpath · required | string max 200 | Account ID (accounts.zalo_id). Facebook uses the Facebook ID, Telegram uses the Telegram account ID. |
Example request
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/drafts" \
-H "Authorization: Bearer dpk_xxx"Send a contact card (Zalo: by user_id; Telegram bot: by phone number)
/api/v1/accounts/{accountId}/conversations/{threadId}/messages/contact-cardScope: chat:sendParameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID (the channel's user id or group id) |
Request body (JSON)
user_idoptional | string max 200 | Zalo: ID of the contact being shared |
phoneoptional | string max 30 | Zalo: optional; Telegram bot: required |
nameoptional | string max 100 | Telegram bot: display name (required) |
thread_typeoptional | "user" | "group" | user = 1-1 chat, group = group chat |
quote_msg_idoptional | string |
Example request
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"}'Send a bank card (Zalo), a saved card or details entered directly
/api/v1/accounts/{accountId}/conversations/{threadId}/messages/bank-cardScope: chat:sendPass bank_card_id (from GET /accounts/{accountId}/bank-cards) or all of bin_bank, account_number, account_name.
Parameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID (the channel's user id or group id) |
Request body (JSON)
bank_card_idoptional | integer ≥ 1 | |
bin_bankoptional | integer ≥ 100000 · ≤ 999999 | Bank BIN code (6 digits) |
account_numberoptional | string max 40 | |
account_nameoptional | string max 100 | |
thread_typeoptional | "user" | "group" | user = 1-1 chat, group = group chat |
Example request
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"}'Send a voice message (Zalo, Telegram bot)
/api/v1/accounts/{accountId}/conversations/{threadId}/messages/voiceScope: chat:sendAn audio file (m4a/mp3/ogg…) via upload_id, library_uuid or url. Zalo: uploaded, then sent as a voice recording like the microphone button in the app. Other channels: send the audio file with POST …/messages.
Parameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID (the channel's user id or group id) |
Request body (JSON)
upload_idoptional | string | ID from POST /media/uploads |
library_uuidoptional | string | UUID of an item in the media library |
urloptional | string (uri) | Public http/https link; the server downloads it itself |
Example request
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"}'Reminders in the conversation (Zalo)
/api/v1/accounts/{accountId}/conversations/{threadId}/remindersScope: chat:readParameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID (the channel's user id or group id) |
limitquery · optional | integer ≥ 1 · ≤ 50 · default 20 |
Example request
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/reminders" \
-H "Authorization: Bearer dpk_xxx"Create a reminder (Zalo)
/api/v1/accounts/{accountId}/conversations/{threadId}/remindersScope: chat:manageParameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID (the channel's user id or group id) |
Request body (JSON)
titlerequired | string max 200 | |
start_timerequired | integer ≥ 0 | Epoch ms, must be in the future |
repeatoptional | "none" | "daily" | "weekly" | "monthly" default "none" | |
emojioptional | string max 16 · default "⏰" |
Example request
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"}'Update a reminder (Zalo)
/api/v1/accounts/{accountId}/conversations/{threadId}/reminders/{reminderId}Scope: chat:manageParameters
accountIdpath · required | string max 200 | |
threadIdpath · required | string max 200 | |
reminderIdpath · required | string max 200 |
Request body (JSON)
titlerequired | string max 200 | |
start_timerequired | integer ≥ 0 | |
repeatoptional | "none" | "daily" | "weekly" | "monthly" default "none" | |
emojioptional | string max 16 · default "⏰" |
Example request
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"}'Delete a reminder (Zalo)
/api/v1/accounts/{accountId}/conversations/{threadId}/reminders/{reminderId}Scope: chat:manageParameters
accountIdpath · required | string max 200 | |
threadIdpath · required | string max 200 | |
reminderIdpath · required | string max 200 |
Example request
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/reminders/{reminderId}" \
-H "Authorization: Bearer dpk_xxx"The conversation's auto-delete messages setting on Zalo
/api/v1/accounts/{accountId}/conversations/{threadId}/auto-deleteScope: chat:readRead back from Zalo (Zalo doesn't report changes made on the phone). ttl_ms (ms): 0 = Off, 86400000 = 1 day, 604800000 = 7 days, 1209600000 = 14 days. Zalo deletes the messages on Zalo devices; Deplao keeps the messages it has saved.
Parameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID (the channel's user id or group id) |
Example request
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/auto-delete" \
-H "Authorization: Bearer dpk_xxx"Turn auto-delete messages on / off on Zalo
/api/v1/accounts/{accountId}/conversations/{threadId}/auto-deleteScope: chat:manageSame as the "Auto-delete messages" item (Tự xoá tin nhắn) in the conversation details. ttl_ms (ms): 0 = Off, 86400000 = 1 day, 604800000 = 7 days, 1209600000 = 14 days. Zalo deletes the messages on Zalo devices; Deplao keeps the messages it has saved. A group may allow only the owner / deputies to change it.
Parameters
accountIdpath · required | string max 200 | Account ID |
threadIdpath · required | string max 200 | Conversation ID (the channel's user id or group id) |
Request body (JSON)
ttl_msrequired | integer ≥ 0 | 0 = off; 86400000 = 1 day; 604800000 = 7 days; 1209600000 = 14 days |
thread_typeoptional | "user" | "group" default "user" | user = 1-1 chat, group = group chat |
Example request
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"}'