Skip to content

Employees

Manage employees, module permissions, account assignment. · 13 endpoints

List employees

GET/api/v1/employeesScope: employees:manage

Example request

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

Create an employee

POST/api/v1/employeesScope: employees:manage

Request body (JSON)

username
required
string
max 50
password
required
string
max 200
display_name
required
string
max 100
role
optional
string
max 30 · default "employee"

Example request

bash
curl -X POST "http://127.0.0.1:9900/api/v1/employees" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"username":"string","password":"string","display_name":"string"}'

Employees currently connected

GET/api/v1/employees/onlineScope: employees:manage

Example request

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

Get an employee with their permissions and assigned accounts

GET/api/v1/employees/{employeeId}Scope: employees:manage

Parameters

employeeId
path · required
string
max 200

Example request

bash
curl "http://127.0.0.1:9900/api/v1/employees/{employeeId}" \
  -H "Authorization: Bearer dpk_xxx"

Update an employee (name, password, enabled/disabled)

PATCH/api/v1/employees/{employeeId}Scope: employees:manage

Parameters

employeeId
path · required
string
max 200

Request body (JSON)

display_name
optional
string
max 100
password
optional
string
max 200
is_active
optional
boolean
role
optional
string
max 30

Example request

bash
curl -X PATCH "http://127.0.0.1:9900/api/v1/employees/{employeeId}" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"display_name":"string","password":"string","is_active":false}'

Delete an employee

DELETE/api/v1/employees/{employeeId}Scope: employees:manage

Parameters

employeeId
path · required
string
max 200

Example request

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

The employee's module permissions

GET/api/v1/employees/{employeeId}/permissionsScope: employees:manage

Parameters

employeeId
path · required
string
max 200

Example request

bash
curl "http://127.0.0.1:9900/api/v1/employees/{employeeId}/permissions" \
  -H "Authorization: Bearer dpk_xxx"

Set module permissions

PUT/api/v1/employees/{employeeId}/permissionsScope: employees:manage

Parameters

employeeId
path · required
string
max 200

Request body (JSON)

permissions
required
objectModule → true/false. Modules: chat, friends, crm, workflow, integration, analytics, ai_assistant, settings, erp

Example request

bash
curl -X PUT "http://127.0.0.1:9900/api/v1/employees/{employeeId}/permissions" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"permissions":{}}'

Assigned accounts

GET/api/v1/employees/{employeeId}/accountsScope: employees:manage

Parameters

employeeId
path · required
string
max 200

Example request

bash
curl "http://127.0.0.1:9900/api/v1/employees/{employeeId}/accounts" \
  -H "Authorization: Bearer dpk_xxx"

Assign accounts to the employee (replaces the current assignment)

PUT/api/v1/employees/{employeeId}/accountsScope: employees:manage

Parameters

employeeId
path · required
string
max 200

Request body (JSON)

account_ids
required
string[]
max 500 items

Example request

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

Recent login sessions

GET/api/v1/employees/{employeeId}/sessionsScope: employees:manage

Parameters

employeeId
path · required
string
max 200
limit
query · optional
integer
≥ 1 · ≤ 500 · default 50

Example request

bash
curl "http://127.0.0.1:9900/api/v1/employees/{employeeId}/sessions" \
  -H "Authorization: Bearer dpk_xxx"

Work statistics (messages handled, time online...)

GET/api/v1/employees/{employeeId}/statsScope: employees:manage

Parameters

employeeId
path · required
string
max 200
from
query · optional
integer
≥ 0
to
query · optional
integer
≥ 0

Example request

bash
curl "http://127.0.0.1:9900/api/v1/employees/{employeeId}/stats" \
  -H "Authorization: Bearer dpk_xxx"

Disconnect an online employee

POST/api/v1/employees/{employeeId}/kickScope: employees:manage

Closes the open sessions (REST + realtime) and revokes the current token: the employee has to log in again. Disabling or deleting an employee, or changing their password, also revokes their sessions immediately.

Parameters

employeeId
path · required
string
max 200

Example request

bash
curl -X POST "http://127.0.0.1:9900/api/v1/employees/{employeeId}/kick" \
  -H "Authorization: Bearer dpk_xxx"