Skip to Content
Beta: Hubz API v1 is being rolled out to production. Endpoints and limits may change; every change is listed in the Changelog.

Hubz API v1 (beta) · Hubz v0.7.0 · 2026-11-06

API reference: Hubz API v1

Download the API description (OpenAPI 3.1, yaml)

https://api.hubz.vn · Every request needs Authorization: Bearer hbz_live_xxx.

Endpoints

GET /v1/me

Which company the key belongs to and who it acts as

Parameters

NameInType
X-Hubz-Userheaderstring (email)Email of the staff member to act as.

Returns 200

Success: object

FieldType
integrationobject{ id, name, scopes }
companyobject{ id, name }
userobject{ id, name, email, role }
accountIdsstring[]

Errors: see Rate limits and errors.

GET /v1/accounts

The Zalo accounts the key can use

Parameters

NameInType
X-Hubz-Userheaderstring (email)Email of the staff member to act as.

Returns 200

Success: Account[]

Errors: see Rate limits and errors.

GET /v1/contacts

Find contacts by phone number (any format) or by name

Parameters

NameInType
X-Hubz-Userheaderstring (email)Email of the staff member to act as.
phonequerystring0912 345 678, +84912345678 and 84912345678 are the same number.
qquerystring (min 2)
limitqueryinteger (default 20; max 100)

Returns 200

Success: Contact[]

Errors: see Rate limits and errors.

GET /v1/contacts/{id}

One contact

Parameters

NameInType
id requiredpathstring (uuid)
X-Hubz-Userheaderstring (email)Email of the staff member to act as.

Returns 200

Success: Contact

Errors: see Rate limits and errors.

GET /v1/conversations/{id}

One conversation

Parameters

NameInType
id requiredpathstring (uuid)
X-Hubz-Userheaderstring (email)Email of the staff member to act as.

Returns 200

Success: Conversation

Errors: see Rate limits and errors.

GET /v1/conversations/{id}/messages

Messages of a conversation, newest first; for the next page, before = id of the oldest message received

Parameters

NameInType
id requiredpathstring (uuid)
X-Hubz-Userheaderstring (email)Email of the staff member to act as.
beforequerystring (uuid)

Returns 200

Success: Message[]

Errors: see Rate limits and errors.

POST /v1/conversations/{id}/messages

Send a message (send scope). With a file and text, the file is sent first, then the text.

Parameters

NameInType
id requiredpathstring (uuid)
X-Hubz-Userheaderstring (email)Email of the staff member to act as.

Request body

FieldType
textstring (max 4000)
fileobject{ name, mime, base64 }

Returns 200

The messages queued for sending: Message[]

Errors: see Rate limits and errors.

GET /v1/files

Download the file of a message (302 redirect to a link signed for 5 minutes)

Parameters

NameInType
key requiredquerystring

Returns 302

Redirect to the file

Errors: see Rate limits and errors.

GET /v1/events

Pull events (events scope)

Parameters

NameInType
afterqueryinteger (default 0)The next value of the previous call; 0 the first time.
limitqueryinteger (default 100; max 500)
typesquerystringLọc loại

Returns 200

Success: object

FieldType
eventsEvent[]
nextstring

Errors: see Rate limits and errors.

PUT /v1/webhook

Register your webhook (events scope). Returns the signing secret when created, when the address changes or with rotateSecret.

Request body

FieldType
url requiredstring (uri)
eventsstring (message.created, message.updated, conversation.updated)[]
rotateSecretboolean

Returns 200

Success: object

FieldType
urlstring
eventsstring[]
secretstring | null

Errors: see Rate limits and errors.

DELETE /v1/webhook

Remove the webhook

Returns 200

Success

Errors: see Rate limits and errors.

POST /v1/webhook/test

Send a ping event to the webhook and return the result at once

Returns 200

Success: object

FieldType
okboolean
statusinteger
errorstring | null

Errors: see Rate limits and errors.

POST /v1/embed-token

Get an embed address (one conversation, or the whole Hubz app) as a staff member (X-Hubz-User). Without the send scope it is read only.

Parameters

NameInType
X-Hubz-Userheaderstring (email)Email of the staff member to act as.

Request body

FieldType
conversationId requiredstring (uuid)
FieldType
app requiredboolean (True)

Returns 200

Success: object

FieldType
urlstring
tokenstring
expiresAtstring (date-time)

Errors: see Rate limits and errors.

PUT /v1/embed-origins

Allow pages to embed the chat (origins such as https://your-domain)

Request body

FieldType
origins requiredstring[]

Returns 200

The list once updated

Errors: see Rate limits and errors.

Schemas

Error

FieldType
errorstring

Account

FieldType
idstring (uuid)
namestring
phonestring | null
statusstring (connected, disconnected, pending_qr, banned, deleted)
canReplyboolean

Contact

FieldType
idstring (uuid)
typestring (person)
namestring
zaloNamestring | null
phonestring | null
accountIdstring | null (uuid)
isFriendboolean
tagsstring[]
linksLink[]
conversationsobject[]

Conversation

FieldType
idstring (uuid)
accountobject{ id, name, phone }
threadTypestring (user, group)
contactobject{ id, name }
assigneeobject | null{ id, name }
statusstring (open, closed)
lastMessageAtstring | null (date-time)
lastMessagePreviewstring | null
unreadCountinteger
canReplyboolean

File

FieldType
namestring
mimestring
sizeinteger
keystringUse with GET /v1/files to download the file.

Message

FieldType
idstring (uuid)
conversationIdstring (uuid)
directionstring (in, out)
kindstring (text, link, image, file, sticker, contact, call, other)
textstring | null
fileFile | null
statusstring (queued, sent, failed)
errorstring | null
sourcestring (customer, web, phone, api)
sentByobject | null{ id, name }
senderNamestring | nullName of the group member who sent the message.
replyToIdstring | null
recalledboolean
createdAtstring (date-time)

Event

FieldType
idstringTăng dần
typestring (message.created, message.updated, conversation.updated)
versioninteger
createdAtstring (date-time)
dataobjectmessage.*: `{ accountId, message, conversation: { id, accountId, threadType, status, assigneeId }, contact: { id, name, phone }, firstInbound }`. `firstInbound = true` khi đây là tin đầu tiên khách gửi trong hội thoại (dùng để tạo cơ hội, phiếu mới). conversation.updated: `{ accountId, conversation: { id, accountId, threadType, status, assignee, lastMessageAt, unreadCount }, contact: { id, name } }`.

Content of data by event type

  • message.*: { accountId, message, conversation: { id, accountId, threadType, status, assigneeId }, contact: { id, name, phone }, firstInbound }.
  • firstInbound = true for the first message the customer sends in the conversation (use it to open a new lead or ticket).
  • conversation.updated: { accountId, conversation: { id, accountId, threadType, status, assignee, lastMessageAt, unreadCount }, contact: { id, name } }.

Hubz is not affiliated with Zalo or VNG; Hubz does not use Zalo’s official API. Hubz is not affiliated with Odoo S.A.; Odoo is a trademark of Odoo S.A.