CRM
Customers, CRM tags, notes, messaging campaigns. · 13 endpoints
- GET/accounts/{accountId}/crm/contacts
- GET/accounts/{accountId}/crm/contacts/stats
- GET/accounts/{accountId}/crm/contacts/{contactId}
- PATCH/accounts/{accountId}/crm/contacts/{contactId}
- GET/accounts/{accountId}/crm/contacts/{contactId}/notes
- POST/accounts/{accountId}/crm/contacts/{contactId}/notes
- PATCH/accounts/{accountId}/crm/notes/{noteId}
- DELETE/accounts/{accountId}/crm/notes/{noteId}
- GET/accounts/{accountId}/crm/activity
- GET/accounts/{accountId}/bank-cards
- POST/accounts/{accountId}/bank-cards
- PATCH/accounts/{accountId}/bank-cards/{cardId}
- DELETE/accounts/{accountId}/bank-cards/{cardId}
Customers (friends, strangers, groups) with the same filters as the CRM page
GET
/api/v1/accounts/{accountId}/crm/contactsScope: crm: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 | |
typequery · optional | "all" | "friend" | "non_friend" | "group" default "all" | |
sort_byquery · optional | "name" | "last_message" default "last_message" | |
sort_dirquery · 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: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}/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:readParameters
accountIdpath · required | string max 200 | |
contactIdpath · 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:writeParameters
accountIdpath · required | string max 200 | |
contactIdpath · required | string max 200 |
Request body (JSON)
phoneoptional | string max 30 | |
display_nameoptional | string max 200 | |
aliasoptional | 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:readParameters
accountIdpath · required | string max 200 | |
contactIdpath · 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:writeParameters
accountIdpath · required | string max 200 | |
contactIdpath · required | string max 200 |
Request body (JSON)
contentrequired | string max 10000 | |
topic_idoptional | 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:writeParameters
accountIdpath · required | string max 200 | |
noteIdpath · required | integer ≥ 1 |
Request body (JSON)
contact_idrequired | string max 200 | |
contentrequired | 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:writeParameters
accountIdpath · required | string max 200 | |
noteIdpath · 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:readParameters
accountIdpath · required | string max 200 | Account ID (accounts.zalo_id). Facebook uses the Facebook ID, Telegram uses the Telegram account ID. |
sincequery · required | integer ≥ 0 | Epoch ms |
untilquery · 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: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}/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:writeParameters
accountIdpath · required | string max 200 | Account ID (accounts.zalo_id). Facebook uses the Facebook ID, Telegram uses the Telegram account ID. |
Request body (JSON)
bank_namerequired | string max 100 | |
bin_bankrequired | integer ≥ 100000 · ≤ 999999 | Bank BIN code (6 digits, e.g. 970436 = Vietcombank) |
account_numberrequired | string max 40 | |
account_namerequired | string max 100 | |
is_defaultoptional | 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:writeParameters
accountIdpath · required | string max 200 | |
cardIdpath · required | integer ≥ 1 |
Request body (JSON)
bank_nameoptional | string max 100 | |
bin_bankoptional | integer ≥ 100000 · ≤ 999999 | |
account_numberoptional | string max 40 | |
account_nameoptional | string max 100 | |
is_defaultoptional | 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:writeParameters
accountIdpath · required | string max 200 | |
cardIdpath · 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"