Skip to content

CRM

Customers, CRM tags, notes, messaging campaigns. · 13 endpoints

Customers (friends, strangers, groups) with the same filters as the CRM page

GET/api/v1/accounts/{accountId}/crm/contactsScope: crm: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
type
query · optional
"all" | "friend" | "non_friend" | "group"
default "all"
sort_by
query · optional
"name" | "last_message"
default "last_message"
sort_dir
query · optional
"asc" | "desc"
default "desc"

Example request

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

Customer statistics (total, friends, notes)

GET/api/v1/accounts/{accountId}/crm/contacts/statsScope: crm: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}/crm/contacts/stats" \
  -H "Authorization: Bearer dpk_xxx"

Customer profile: details, labels, notes, 5 most recent messages

GET/api/v1/accounts/{accountId}/crm/contacts/{contactId}Scope: crm:read

Parameters

accountId
path · required
string
max 200
contactId
path · required
string
max 200

Example request

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

Update phone number / display name / nickname (stored in Deplao)

PATCH/api/v1/accounts/{accountId}/crm/contacts/{contactId}Scope: crm:write

Parameters

accountId
path · required
string
max 200
contactId
path · required
string
max 200

Request body (JSON)

phone
optional
string
max 30
display_name
optional
string
max 200
alias
optional
string
max 100

Example request

bash
curl -X PATCH "http://127.0.0.1:9900/api/v1/accounts/{accountId}/crm/contacts/{contactId}" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"phone":"string","display_name":"string","alias":"string"}'

The customer's notes

GET/api/v1/accounts/{accountId}/crm/contacts/{contactId}/notesScope: crm:read

Parameters

accountId
path · required
string
max 200
contactId
path · required
string
max 200

Example request

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

Add a note

POST/api/v1/accounts/{accountId}/crm/contacts/{contactId}/notesScope: crm:write

Parameters

accountId
path · required
string
max 200
contactId
path · required
string
max 200

Request body (JSON)

content
required
string
max 10000
topic_id
optional
string

Example request

bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/crm/contacts/{contactId}/notes" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"content":"string","topic_id":"string"}'

Update a note

PATCH/api/v1/accounts/{accountId}/crm/notes/{noteId}Scope: crm:write

Parameters

accountId
path · required
string
max 200
noteId
path · required
integer
≥ 1

Request body (JSON)

contact_id
required
string
max 200
content
required
string
max 10000

Example request

bash
curl -X PATCH "http://127.0.0.1:9900/api/v1/accounts/{accountId}/crm/notes/{noteId}" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"contact_id":"string","content":"string"}'

Delete a note

DELETE/api/v1/accounts/{accountId}/crm/notes/{noteId}Scope: crm:write

Parameters

accountId
path · required
string
max 200
noteId
path · required
integer
≥ 1

Example request

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

CRM activity within a time range

GET/api/v1/accounts/{accountId}/crm/activityScope: crm:read

Parameters

accountId
path · required
string
max 200
Account ID (accounts.zalo_id). Facebook uses the Facebook ID, Telegram uses the Telegram account ID.
since
query · required
integer
≥ 0
Epoch ms
until
query · optional
integer
≥ 0

Example request

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

Saved bank cards for sending to customers

GET/api/v1/accounts/{accountId}/bank-cardsScope: crm: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}/bank-cards" \
  -H "Authorization: Bearer dpk_xxx"

Save a bank card (to send it to customers quickly)

POST/api/v1/accounts/{accountId}/bank-cardsScope: crm: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)

bank_name
required
string
max 100
bin_bank
required
integer
≥ 100000 · ≤ 999999
Bank BIN code (6 digits, e.g. 970436 = Vietcombank)
account_number
required
string
max 40
account_name
required
string
max 100
is_default
optional
boolean
default false

Example request

bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/bank-cards" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"bank_name":"Vietcombank","bin_bank":970436,"account_number":"0011001234567","account_name":"NGUYEN VAN A","is_default":true}'

Update a bank card

PATCH/api/v1/accounts/{accountId}/bank-cards/{cardId}Scope: crm:write

Parameters

accountId
path · required
string
max 200
cardId
path · required
integer
≥ 1

Request body (JSON)

bank_name
optional
string
max 100
bin_bank
optional
integer
≥ 100000 · ≤ 999999
account_number
optional
string
max 40
account_name
optional
string
max 100
is_default
optional
boolean

Example request

bash
curl -X PATCH "http://127.0.0.1:9900/api/v1/accounts/{accountId}/bank-cards/{cardId}" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"bank_name":"string","bin_bank":100000,"account_number":"string"}'

Delete a saved bank card

DELETE/api/v1/accounts/{accountId}/bank-cards/{cardId}Scope: crm:write

Parameters

accountId
path · required
string
max 200
cardId
path · required
integer
≥ 1

Example request

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