Skip to content

Labels & quick replies

Conversation labels (local), quick replies, stickers. · 30 endpoints

(Local) labels available to the account

GET/api/v1/accounts/{accountId}/labelsScope: chat: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}/labels" \
  -H "Authorization: Bearer dpk_xxx"

Create a label

POST/api/v1/labelsScope: chat:manage

Request body (JSON)

name
required
string
max 100
color
optional
string
max 20 · default "#3B82F6"
text_color
optional
string
max 20 · default "#FFFFFF"
emoji
optional
string
max 16 · default "🏷️"
account_ids
optional
string[]
max 200 items
Only shown for these accounts; empty = all accounts
shortcut
optional
string
max 20

Example request

bash
curl -X POST "http://127.0.0.1:9900/api/v1/labels" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"name":"string","color":"#3B82F6","text_color":"#FFFFFF"}'

Update a label

PATCH/api/v1/labels/{labelId}Scope: chat:manage

Parameters

labelId
path · required
integer
≥ 1

Request body (JSON)

name
optional
string
max 100
color
optional
string
max 20 · default "#3B82F6"
text_color
optional
string
max 20 · default "#FFFFFF"
emoji
optional
string
max 16 · default "🏷️"
account_ids
optional
string[]
max 200 items
Only shown for these accounts; empty = all accounts
shortcut
optional
string
max 20

Example request

bash
curl -X PATCH "http://127.0.0.1:9900/api/v1/labels/{labelId}" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"name":"string","color":"#3B82F6","text_color":"#FFFFFF"}'

Delete a label (removes it from every conversation)

DELETE/api/v1/labels/{labelId}Scope: chat:manage

Parameters

labelId
path · required
integer
≥ 1

Example request

bash
curl -X DELETE "http://127.0.0.1:9900/api/v1/labels/{labelId}" \
  -H "Authorization: Bearer dpk_xxx"

Labels assigned to the conversation

GET/api/v1/accounts/{accountId}/conversations/{threadId}/labelsScope: chat:read

Parameters

accountId
path · required
string
max 200
Account ID
threadId
path · required
string
max 200
Conversation ID (the channel's user id or group id)

Example request

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

Set the conversation's exact set of labels (assigns missing ones, removes extra ones)

PUT/api/v1/accounts/{accountId}/conversations/{threadId}/labelsScope: chat:manage

Each assignment/removal goes through the same handler the UI uses, so "When a label is assigned or removed" (Khi gán hoặc gỡ nhãn) workflows still run.

Parameters

accountId
path · required
string
max 200
Account ID
threadId
path · required
string
max 200
Conversation ID (the channel's user id or group id)

Request body (JSON)

label_ids
required
integer[]
max 100 items

Example request

bash
curl -X PUT "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/labels" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"label_ids":[]}'

Assign a label to the conversation

POST/api/v1/accounts/{accountId}/conversations/{threadId}/labels/{labelId}Scope: chat:manage

Parameters

accountId
path · required
string
max 200
threadId
path · required
string
max 200
labelId
path · required
integer
≥ 1

Example request

bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/labels/{labelId}" \
  -H "Authorization: Bearer dpk_xxx"

Remove a label from the conversation

DELETE/api/v1/accounts/{accountId}/conversations/{threadId}/labels/{labelId}Scope: chat:manage

Parameters

accountId
path · required
string
max 200
threadId
path · required
string
max 200
labelId
path · required
integer
≥ 1

Example request

bash
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/conversations/{threadId}/labels/{labelId}" \
  -H "Authorization: Bearer dpk_xxx"

The account's labels on the Zalo server (Zalo only, must be online)

GET/api/v1/accounts/{accountId}/zalo-labelsScope: chat: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}/zalo-labels" \
  -H "Authorization: Bearer dpk_xxx"

The account's quick replies (/keyword)

GET/api/v1/accounts/{accountId}/quick-messagesScope: chat: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}/quick-messages" \
  -H "Authorization: Bearer dpk_xxx"

Create or update a quick reply (by keyword)

POST/api/v1/accounts/{accountId}/quick-messagesScope: chat: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)

keyword
required
string
max 50
title
required
string
max 5000
media
optional
anyMedia in the app's own format, kept as is (optional)

Example request

bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/quick-messages" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"keyword":"string","title":"string","media":null}'

Delete a quick reply

DELETE/api/v1/accounts/{accountId}/quick-messages/{id}Scope: chat:manage

Parameters

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

Example request

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

Recently used stickers

GET/api/v1/stickers/recentScope: chat:read

Parameters

limit
query · optional
integer
≥ 1 · ≤ 100 · default 30

Example request

bash
curl "http://127.0.0.1:9900/api/v1/stickers/recent" \
  -H "Authorization: Bearer dpk_xxx"

Saved sticker packs

GET/api/v1/sticker-packsScope: chat:read

Example request

bash
curl "http://127.0.0.1:9900/api/v1/sticker-packs" \
  -H "Authorization: Bearer dpk_xxx"

Stickers in a pack

GET/api/v1/sticker-packs/{catId}/stickersScope: chat:read

Parameters

catId
path · required
integer

Example request

bash
curl "http://127.0.0.1:9900/api/v1/sticker-packs/{catId}/stickers" \
  -H "Authorization: Bearer dpk_xxx"

Sticker IDs by keyword (cached)

GET/api/v1/stickers/searchScope: chat:read

Parameters

keyword
query · required
string
max 50

Example request

bash
curl "http://127.0.0.1:9900/api/v1/stickers/search" \
  -H "Authorization: Bearer dpk_xxx"

Conversations that have a given label

GET/api/v1/accounts/{accountId}/labels/{labelId}/conversationsScope: chat:read

Parameters

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

Example request

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

Assign several labels to several conversations in one go

POST/api/v1/accounts/{accountId}/labels/bulk-assignScope: chat:manage

One transaction, like bulk assignment in the app. Unlike assigning labels one at a time, it does not fire "When a label is assigned" (Khi gán nhãn) workflows.

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)

label_ids
required
integer[]
max 50 items
thread_ids
required
string[]
max 1000 items

Example request

bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/labels/bulk-assign" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"label_ids":[],"thread_ids":[]}'

Reorder labels (by an array of ids)

PUT/api/v1/labels/orderScope: chat:manage

Request body (JSON)

label_ids
required
integer[]
max 300 items

Example request

bash
curl -X PUT "http://127.0.0.1:9900/api/v1/labels/order" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"label_ids":[]}'

Show / hide a label

PUT/api/v1/labels/{labelId}/activeScope: chat:manage

Parameters

labelId
path · required
integer
≥ 1

Request body (JSON)

active
required
boolean

Example request

bash
curl -X PUT "http://127.0.0.1:9900/api/v1/labels/{labelId}/active" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"active":false}'

Copy this account's set of labels to another account

POST/api/v1/labels/cloneScope: chat:manage

Request body (JSON)

from_account_id
required
string
max 200
to_account_id
required
string
max 200

Example request

bash
curl -X POST "http://127.0.0.1:9900/api/v1/labels/clone" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"from_account_id":"string","to_account_id":"string"}'

Assign a Zalo label to a conversation (one label per conversation)

POST/api/v1/accounts/{accountId}/zalo-labels/{labelId}/conversations/{threadId}Scope: chat:manage

Synced to Zalo (visible on the phone). Assigning a new label removes the conversation's previous Zalo label, as in the app; "When a label is assigned or removed" (Khi gán hoặc gỡ nhãn) workflows still run.

Parameters

accountId
path · required
string
max 200
labelId
path · required
integer
≥ 0
threadId
path · required
string
max 200

Example request

bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/zalo-labels/{labelId}/conversations/{threadId}" \
  -H "Authorization: Bearer dpk_xxx"

Remove the Zalo label from a conversation

DELETE/api/v1/accounts/{accountId}/zalo-labels/{labelId}/conversations/{threadId}Scope: chat:manage

Synced to Zalo (visible on the phone). Assigning a new label removes the conversation's previous Zalo label, as in the app; "When a label is assigned or removed" (Khi gán hoặc gỡ nhãn) workflows still run.

Parameters

accountId
path · required
string
max 200
labelId
path · required
integer
≥ 0
threadId
path · required
string
max 200

Example request

bash
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/zalo-labels/{labelId}/conversations/{threadId}" \
  -H "Authorization: Bearer dpk_xxx"

Reorder quick replies

PUT/api/v1/accounts/{accountId}/quick-messages/orderScope: chat: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)

ids
required
integer[]
max 300 items

Example request

bash
curl -X PUT "http://127.0.0.1:9900/api/v1/accounts/{accountId}/quick-messages/order" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"ids":[]}'

Enable / disable a quick reply

PUT/api/v1/accounts/{accountId}/quick-messages/{id}/activeScope: chat:manage

Parameters

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

Request body (JSON)

active
required
boolean

Example request

bash
curl -X PUT "http://127.0.0.1:9900/api/v1/accounts/{accountId}/quick-messages/{id}/active" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"active":false}'

Copy quick replies to another account

POST/api/v1/accounts/{accountId}/quick-messages/cloneScope: chat: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)

to_account_id
required
string
max 200

Example request

bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/quick-messages/clone" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"to_account_id":"string"}'

Quick replies stored on Zalo (also usable on the phone)

GET/api/v1/accounts/{accountId}/zalo-quick-messagesScope: chat: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}/zalo-quick-messages" \
  -H "Authorization: Bearer dpk_xxx"

Create a quick reply on Zalo

POST/api/v1/accounts/{accountId}/zalo-quick-messagesScope: chat: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)

keyword
required
string
max 50
title
required
string
max 5000

Example request

bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/zalo-quick-messages" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"keyword":"string","title":"string"}'

Update a quick reply on Zalo

PATCH/api/v1/accounts/{accountId}/zalo-quick-messages/{itemId}Scope: chat:manage

Parameters

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

Request body (JSON)

keyword
required
string
max 50
title
required
string
max 5000

Example request

bash
curl -X PATCH "http://127.0.0.1:9900/api/v1/accounts/{accountId}/zalo-quick-messages/{itemId}" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"keyword":"string","title":"string"}'

Delete a quick reply on Zalo

DELETE/api/v1/accounts/{accountId}/zalo-quick-messages/{itemId}Scope: chat:manage

Parameters

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

Example request

bash
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/zalo-quick-messages/{itemId}" \
  -H "Authorization: Bearer dpk_xxx"