Skip to content
Public API v1

API reference

Every endpoint by group, with parameters, request body and a curl command.

Local base URL

http://127.0.0.1:9900/api/v1

Auth

Bearer dpk_…

OpenAPI 3.1

Download openapi.json

Call it remotely through the Internet address under Settings → Internet & Cloud (the “Employees and API” service).

System4Health check, key info, server info.GETendpointsAccounts10Zalo, Facebook and Telegram accounts on the machine: list, status, connection, proxy.GETPOSTPUTPATCHendpointsChat44Conversations and messages on every channel: read, search, send, recall, react, pin, mark as read.GETPATCHDELETEPOSTPUTendpointsMedia13Upload files to send, download attachments, media library.GETPOSTDELETEPATCHendpointsLabels & quick replies30Conversation labels (local), quick replies, stickers.GETPOSTPATCHDELETEPUTendpointsGroups38Group chats: info, members, renaming, invite links.GETPOSTPATCHDELETEPUTendpointsContacts19Friends, friend requests, user lookup.GETPOSTDELETEPUTendpointsProduct catalog8GETPOSTDELETEPATCHendpointsCRM13Customers, CRM tags, notes, messaging campaigns.GETPATCHPOSTDELETEendpointsCampaigns15GETPOSTPATCHDELETEendpointsWorkflow16Automation workflows: read, edit, enable/disable, run, trigger.api events.GETPOSTPUTPATCHDELETEendpointsIntegrations9POS, shipping and payment connections: call adapter actions.GETPOSTPATCHDELETEendpointsERP49Tasks, projects, calendar, notes, attendance, leave, notifications.GETPOSTPATCHDELETEendpointsAI9AI assistants: chat, reply suggestions, usage statistics.GETPOSTendpointsReports1Overview, message volume, peak hours, campaign and workflow reports.GETendpointsEmployees13Manage employees, module permissions, account assignment.GETPOSTPATCHDELETEPUTendpointsEvents3Receive realtime events: Socket.IO, SSE, polling.GETendpointsWebhook8Register outbound webhooks signed with HMAC.GETPOSTPATCHDELETEendpointsPlugin5Routes registered by plugins, and plugin info.GETPOSTPUTPATCHDELETEendpoints

Error codes

CodeHTTPDescription
UNAUTHORIZED401Key missing, invalid, revoked or expired
FORBIDDEN_SCOPE403The key lacks the scope this endpoint requires
FORBIDDEN_ACCOUNT403The key has not been granted this account
FORBIDDEN_IP403The calling IP is not in the key's allowlist
FORBIDDEN_ERP403The key's ERP role does not have permission
NOT_FOUND404Endpoint or data not found
METHOD_NOT_ALLOWED405Sai HTTP method
VALIDATION_ERROR400Invalid parameters (see details)
INVALID_JSON400Body is not valid JSON
PAYLOAD_TOO_LARGE413Body exceeds the size limit
CONFLICT409State conflict
ACCOUNT_OFFLINE409Account not connected
CHANNEL_UNSUPPORTED422The account's channel does not support this operation
RATE_LIMITED429Exceeded the rate limit you set for the key
AUTH_BLOCKED429IP temporarily blocked for sending too many invalid keys
UPSTREAM_ERROR502Zalo/Facebook/Telegram or an internal handler returned an error
NOT_IMPLEMENTED501The corresponding IPC channel is missing
API_DISABLED503The API is turned off in Settings (Cài đặt)
TIMEOUT504Processing took longer than allowed
PLUGIN_ERROR502The plugin's route/node returned an error
PLUGIN_DISABLED404Plugin not installed or disabled
INTERNAL_ERROR500Unexpected error

Scopes

ScopeDescription
accounts:readAccounts · View accounts and their status
accounts:manageAccounts · Connect, disconnect, change proxy
chat:readChat · Read conversations, messages, labels, quick replies
chat:sendChat · Send messages, files, stickers, reactions, typing
chat:manageChat · Mark as read, recall, pin, assign labels, manage groups
contacts:readContacts · View friends, friend requests, look up users
contacts:writeContacts · Send/accept/decline friend requests, unfriend
crm:readCRM · View customers, tags, notes, campaigns
crm:writeCRM · Edit customers, tags, notes, campaigns
campaigns:runCRM · Start/stop campaigns
workflow:readWorkflow · View workflows and run history
workflow:writeWorkflow · Create, edit, enable/disable, delete workflows
workflow:runWorkflow · Run workflows, fire trigger.api events
integrations:readIntegrations · View integrations (credentials never exposed)
integrations:executeIntegrations · Call integration actions (POS, shipping...)
integrations:manageIntegrations · Add integrations, edit credentials, enable/disable, delete integrations
erp:readERP · View tasks, projects, calendar, notes, staff
erp:writeERP · Create/edit tasks, projects, calendar, notes
ai:useAI · Chat with AI assistants, reply suggestions
ai:manageAI · Manage AI assistants, view usage statistics
media:readMedia · Download attachments, media library
media:writeMedia · Upload files, manage the media library
analytics:readReports · View reports
events:subscribeEvents · Receive realtime events (Socket.IO, SSE, polling)
webhooks:manageEvents · Manage this key's webhook subscriptions
employees:manageAdministration · Manage employees, permissions, account assignment
settings:readAdministration · Read settings (allowlisted)
settings:writeAdministration · Write settings (allowlisted)
plugins:manageAdministration · Manage apps (plugins)
adminAdministration · Full access (every scope above)