Skip to content

Contacts

Friends, friend requests, user lookup. · 19 endpoints

Friends list (Zalo). refresh=true reloads it from Zalo

GET/api/v1/accounts/{accountId}/friendsScope: contacts:read

Parameters

accountId
path · required
string
max 200
Account ID (accounts.zalo_id). Facebook uses the Facebook ID, Telegram uses the Telegram account ID.
limit
query · optional
integer
≥ 1 · ≤ 200 · default 50
Maximum number of records (1–200)
offset
query · optional
integer
≥ 0 · default 0
Skip the first N records
search
query · optional
string
max 200
refresh
query · optional
boolean
default false

Example request

bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/friends" \
  -H "Authorization: Bearer dpk_xxx"

Friend requests received / sent

GET/api/v1/accounts/{accountId}/friend-requestsScope: contacts:read

Parameters

accountId
path · required
string
max 200
Account ID (accounts.zalo_id). Facebook uses the Facebook ID, Telegram uses the Telegram account ID.
direction
query · optional
"received" | "sent"
default "received"

Example request

bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/friend-requests" \
  -H "Authorization: Bearer dpk_xxx"

Send a friend request (Zalo)

POST/api/v1/accounts/{accountId}/friend-requestsScope: contacts:write

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)

user_id
required
string
max 200
message
optional
string
max 150 · default ""

Example request

bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/friend-requests" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"user_id":"string","message":""}'

Accept a friend request

POST/api/v1/accounts/{accountId}/friend-requests/{userId}/acceptScope: contacts:write

Parameters

accountId
path · required
string
max 200
userId
path · required
string
max 200
User ID on the channel

Example request

bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/friend-requests/{userId}/accept" \
  -H "Authorization: Bearer dpk_xxx"

Decline a friend request

POST/api/v1/accounts/{accountId}/friend-requests/{userId}/rejectScope: contacts:write

Parameters

accountId
path · required
string
max 200
userId
path · required
string
max 200
User ID on the channel

Example request

bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/friend-requests/{userId}/reject" \
  -H "Authorization: Bearer dpk_xxx"

Cancel a sent friend request

POST/api/v1/accounts/{accountId}/friend-requests/{userId}/cancelScope: contacts:write

Parameters

accountId
path · required
string
max 200
userId
path · required
string
max 200
User ID on the channel

Example request

bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/friend-requests/{userId}/cancel" \
  -H "Authorization: Bearer dpk_xxx"

Unfriend (Zalo)

DELETE/api/v1/accounts/{accountId}/friends/{userId}Scope: contacts:write

Parameters

accountId
path · required
string
max 200
userId
path · required
string
max 200
User ID on the channel

Example request

bash
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/friends/{userId}" \
  -H "Authorization: Bearer dpk_xxx"

Look up a user by phone number (DB first, then Zalo)

GET/api/v1/accounts/{accountId}/users/lookupScope: contacts:read

Parameters

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

Example request

bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/users/lookup" \
  -H "Authorization: Bearer dpk_xxx"

User profile from Zalo

GET/api/v1/accounts/{accountId}/users/{userId}Scope: contacts:read

Parameters

accountId
path · required
string
max 200
userId
path · required
string
max 200
User ID on the channel

Example request

bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/users/{userId}" \
  -H "Authorization: Bearer dpk_xxx"

Groups in common with a person (Zalo)

GET/api/v1/accounts/{accountId}/users/{userId}/mutual-groupsScope: contacts:read

Parameters

accountId
path · required
string
max 200
userId
path · required
string
max 200
User ID on the channel

Example request

bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/users/{userId}/mutual-groups" \
  -H "Authorization: Bearer dpk_xxx"

Block a user (Zalo, Facebook, Telegram)

POST/api/v1/accounts/{accountId}/users/{userId}/blockScope: contacts:write

Parameters

accountId
path · required
string
max 200
userId
path · required
string
max 200
User ID on the channel

Example request

bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/users/{userId}/block" \
  -H "Authorization: Bearer dpk_xxx"

Unblock a user

DELETE/api/v1/accounts/{accountId}/users/{userId}/blockScope: contacts:write

Parameters

accountId
path · required
string
max 200
userId
path · required
string
max 200
User ID on the channel

Example request

bash
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/users/{userId}/block" \
  -H "Authorization: Bearer dpk_xxx"

Set an alias (Zalo: synced to Zalo; other channels: stored in Deplao)

PUT/api/v1/accounts/{accountId}/users/{userId}/aliasScope: contacts:write

Parameters

accountId
path · required
string
max 200
userId
path · required
string
max 200
User ID on the channel

Request body (JSON)

alias
required
string
max 100
Empty string = remove the alias

Example request

bash
curl -X PUT "http://127.0.0.1:9900/api/v1/accounts/{accountId}/users/{userId}/alias" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"alias":"string"}'

Aliases set on Zalo

GET/api/v1/accounts/{accountId}/friend-aliasesScope: contacts:read

Parameters

accountId
path · required
string
max 200
Account ID (accounts.zalo_id). Facebook uses the Facebook ID, Telegram uses the Telegram account ID.
page
query · optional
integer
≥ 1 · ≤ 1000 · default 1
count
query · optional
integer
≥ 1 · ≤ 500 · default 200

Example request

bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/friend-aliases" \
  -H "Authorization: Bearer dpk_xxx"

Friend suggestions and new friend requests from Zalo

GET/api/v1/accounts/{accountId}/friend-recommendationsScope: contacts:read

kind: request = someone sent you a friend request, suggestion = suggested by Zalo.

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}/friend-recommendations" \
  -H "Authorization: Bearer dpk_xxx"

Friendship status with a person (Zalo)

GET/api/v1/accounts/{accountId}/users/{userId}/friend-statusScope: contacts:read

Parameters

accountId
path · required
string
max 200
userId
path · required
string
max 200
User ID on the channel

Example request

bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/users/{userId}/friend-status" \
  -H "Authorization: Bearer dpk_xxx"

Search saved contacts & groups (accent-insensitive: "duong" finds "Dương"), ranked by match quality

GET/api/v1/accounts/{accountId}/contacts/searchScope: contacts:read

Parameters

accountId
path · required
string
max 200
Account ID (accounts.zalo_id). Facebook uses the Facebook ID, Telegram uses the Telegram account ID.
q
query · optional
string
max 200 · default ""
type
query · optional
"all" | "user" | "group"
default "all"
limit
query · optional
integer
≥ 1 · ≤ 200 · default 50
offset
query · optional
integer
≥ 0 · default 0

Example request

bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/contacts/search" \
  -H "Authorization: Bearer dpk_xxx"

Resolve a Telegram @username to a user / group

GET/api/v1/accounts/{accountId}/usernames/{username}Scope: contacts:read

Parameters

accountId
path · required
string
max 200
username
path · required
string
max 64
With or without @

Example request

bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/usernames/{username}" \
  -H "Authorization: Bearer dpk_xxx"

Online status of a person (Zalo)

GET/api/v1/accounts/{accountId}/users/{userId}/presenceScope: contacts:read

status: online | offline (with last_seen_at, ms) | hidden (the person hides their online status) | unknown. Results are cached for 60 seconds per person; refresh=true asks Zalo again right away.

Parameters

accountId
path · required
string
max 200
userId
path · required
string
max 200
Zalo user ID
refresh
query · optional
booleanBypass the 60-second cache

Example request

bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/users/{userId}/presence" \
  -H "Authorization: Bearer dpk_xxx"