Accounts
Zalo, Facebook and Telegram accounts on the machine: list, status, connection, proxy. · 10 endpoints
- GET/accounts
- GET/accounts/{accountId}
- GET/accounts/{accountId}/status
- POST/accounts/{accountId}/connect
- POST/accounts/{accountId}/disconnect
- GET/accounts/{accountId}/proxy
- PUT/accounts/{accountId}/proxy
- GET/proxies
- GET/accounts/{accountId}/zalo/settings
- PATCH/accounts/{accountId}/zalo/settings
List the accounts (Zalo, Facebook, Telegram) the key is allowed to use
GET
/api/v1/accountsScope: accounts:readParameters
channelquery · optional | "zalo" | "facebook" | "telegram_user" | "telegram_bot" | Filter by channel |
onlinequery · optional | boolean | Only accounts that are online |
Example request
bash
curl "http://127.0.0.1:9900/api/v1/accounts" \
-H "Authorization: Bearer dpk_xxx"Get an account
GET
/api/v1/accounts/{accountId}Scope: accounts:readParameters
accountIdpath · required | string max 200 | Account ID (accounts.zalo_id). Facebook uses the Facebook ID, Telegram uses the Telegram account ID. |
Example request
bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}" \
-H "Authorization: Bearer dpk_xxx"Detailed connection/listener status and the proxy in use
GET
/api/v1/accounts/{accountId}/statusScope: accounts:readParameters
accountIdpath · required | string max 200 | Account ID (accounts.zalo_id). Facebook uses the Facebook ID, Telegram uses the Telegram account ID. |
Example request
bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/status" \
-H "Authorization: Bearer dpk_xxx"Reconnect the account using its saved session
POST
/api/v1/accounts/{accountId}/connectScope: accounts:manageUses the login session saved on the machine (cookies from the client are not accepted). Zalo: login:connect; Facebook: fb:connect; Telegram: telegramUser:startListener.
Parameters
accountIdpath · required | string max 200 | Account ID (accounts.zalo_id). Facebook uses the Facebook ID, Telegram uses the Telegram account ID. |
Example request
bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/connect" \
-H "Authorization: Bearer dpk_xxx"Disconnect the account (data is kept)
POST
/api/v1/accounts/{accountId}/disconnectScope: accounts:manageParameters
accountIdpath · required | string max 200 | Account ID (accounts.zalo_id). Facebook uses the Facebook ID, Telegram uses the Telegram account ID. |
Example request
bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/disconnect" \
-H "Authorization: Bearer dpk_xxx"Proxy assigned to the account (password not returned)
GET
/api/v1/accounts/{accountId}/proxyScope: accounts:manageParameters
accountIdpath · required | string max 200 | Account ID (accounts.zalo_id). Facebook uses the Facebook ID, Telegram uses the Telegram account ID. |
Example request
bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/proxy" \
-H "Authorization: Bearer dpk_xxx"Assign a proxy (an id from the proxy list) or remove it (null)
PUT
/api/v1/accounts/{accountId}/proxyScope: accounts:manageParameters
accountIdpath · required | string max 200 | Account ID (accounts.zalo_id). Facebook uses the Facebook ID, Telegram uses the Telegram account ID. |
Request body (JSON)
proxy_idrequired | integer | null | Proxy ID from GET /proxies; null = remove the proxy |
Example request
bash
curl -X PUT "http://127.0.0.1:9900/api/v1/accounts/{accountId}/proxy" \
-H "Authorization: Bearer dpk_xxx" \
-H "Content-Type: application/json" \
-d '{"proxy_id":0}'Configured proxies (passwords not returned)
GET
/api/v1/proxiesScope: accounts:manageExample request
bash
curl "http://127.0.0.1:9900/api/v1/proxies" \
-H "Authorization: Bearer dpk_xxx"Privacy settings of the Zalo account
GET
/api/v1/accounts/{accountId}/zalo/settingsScope: accounts:readRead directly from Zalo, like Settings → Accounts → Zalo privacy (Cài đặt → Tài khoản → Quyền riêng tư Zalo). Each item: key (used when changing it), current value (null = not returned by Zalo), valid options. two_factor_enabled is read-only.
Parameters
accountIdpath · required | string max 200 | Account ID (accounts.zalo_id). Facebook uses the Facebook ID, Telegram uses the Telegram account ID. |
Example request
bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/zalo/settings" \
-H "Authorization: Bearer dpk_xxx"Change one Zalo privacy setting
PATCH
/api/v1/accounts/{accountId}/zalo/settingsScope: accounts:manageOne item at a time, like the Zalo app. key comes from the GET list; value must be one of that item's options. Note: receive_message = 2 or accept_stranger_call = 2 (friends only) stops customers who aren't friends from messaging / calling.
Parameters
accountIdpath · required | string max 200 | Account ID (accounts.zalo_id). Facebook uses the Facebook ID, Telegram uses the Telegram account ID. |
Request body (JSON)
keyrequired | string max 64 | |
valuerequired | integer |
Example request
bash
curl -X PATCH "http://127.0.0.1:9900/api/v1/accounts/{accountId}/zalo/settings" \
-H "Authorization: Bearer dpk_xxx" \
-H "Content-Type: application/json" \
-d '{"key":"string","value":0}'