Skip to content

Accounts

Zalo, Facebook and Telegram accounts on the machine: list, status, connection, proxy. · 10 endpoints

List the accounts (Zalo, Facebook, Telegram) the key is allowed to use

GET/api/v1/accountsScope: accounts:read

Parameters

channel
query · optional
"zalo" | "facebook" | "telegram_user" | "telegram_bot"Filter by channel
online
query · optional
booleanOnly 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:read

Parameters

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

Parameters

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

Uses the login session saved on the machine (cookies from the client are not accepted). Zalo: login:connect; Facebook: fb:connect; Telegram: telegramUser:startListener.

Parameters

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

Parameters

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

Parameters

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

Parameters

accountId
path · required
string
max 200
Account ID (accounts.zalo_id). Facebook uses the Facebook ID, Telegram uses the Telegram account ID.

Request body (JSON)

proxy_id
required
integer | nullProxy 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:manage

Example 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:read

Read 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

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

One 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

accountId
path · required
string
max 200
Account ID (accounts.zalo_id). Facebook uses the Facebook ID, Telegram uses the Telegram account ID.

Request body (JSON)

key
required
string
max 64
value
required
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}'