Skip to main content

User Activity

User Activity

Read and search the activity shown in Admin → Users → User Activity. This resource reads ul_userlogs; it cannot create, edit, delete, or clear activity entries.

Endpoints and access

MethodEndpointResult
GET/useractivityA filtered, paginated list, newest entry first.
GET/useractivity/{id}One entry. The same filters and tenant restrictions apply.

Use a global API Key or global Read Only API Key from Admin → Settings. Supply it using X-API-Key, Authorization: Bearer, or the key query parameter. Configured API IP restrictions apply. Tenant keys and extension Dial API Keys are not accepted. Other methods return HTTP 405.

Without a tenant filter, results include all tenants, global entries, and entries whose tenant has been deleted. tenant accepts one exact code or name; a matching code takes precedence over a matching name. Wildcards are not supported. Use tenant_id to filter by the stored ID, including 0 for global entries or the ID of a deleted tenant. If both selectors are supplied they must identify the same tenant.

Search filters

ParameterMeaning
start, endOptional inclusive timestamps in PBX server time, formatted YYYY-MM-DD HH:MM:SS. No date restriction is applied when omitted.
user / ul_userExact stored username.
user_action / ul_actionExact activity action, for example LOGIN, LOGIN FAILED, or UPDATE. Use these parameters rather than the routing parameter action.
table / ul_tableExact stored table or API resource label.
table_id / ul_table_idExact nonnegative table record ID.
host / ul_hostExact stored caller IP address.
countrycode / ul_countrycodeExact stored country code, such as IT.
objecttype / ul_objecttypeExact stored object type.
qLiteral substring search across visible activity columns and tenant name/code. Characters %, _, and ! are literal, not wildcards. Case matching follows the database collation.
idOptional exact activity entry ID when using the list URL; returns the same single-entry envelope as the ID URL.

Filters are combined with AND. Text filters accept at most 255 UTF-8 bytes without control characters. Conflicting values for an alias and its native column name are rejected. Invalid dates or pagination values return HTTP 400. An individual entry that does not match the supplied filters returns HTTP 404.

Pagination

ParameterMeaning
limitPage size, default 100, from 1 to 1000.
offsetPage offset, default 0, maximum 10000000.
orderdesc (default) or asc, ordered by activity ID ul_id.
before_idExclusive upper ID bound. Continue a descending listing with the returned next_before_id.
after_idExclusive lower ID bound. Continue an ascending listing with the returned next_after_id.

The list response contains data, limit, offset, order, has_more, next_offset, next_before_id, and next_after_id. No full-table total count is performed. While has_more is true, use either the next offset or the cursor for the selected order. Keep the same filters and use offset=0 with cursor continuation. Treat IDs as opaque decimal strings to preserve precision. ID cursor pagination avoids offset shifts when newer activity is inserted.

Returned data

Entries contain the native fields ul_id, ul_te_id, ul_datetime, ul_action, ul_user, ul_host, ul_table, ul_table_id, ul_table_value, ul_objecttype, ul_objectvalue, ul_oldvalues, ul_newvalues, ul_changedvalues, ul_numhost, ul_countrycode, ul_country, ul_useragent, and ul_requesturi. Additional fields tenant_code and tenant_name are null when there is no matching tenant.

Values are stored data, without the web interface's flag icons or action HTML. A full global key can read historical audit payloads, which may contain credentials. With a global read-only key, ul_oldvalues, ul_newvalues, ul_changedvalues, ul_objectvalue, and ul_requesturi contain [hidden]. They are also excluded from q so their contents cannot be discovered through search results. The envelope's details_redacted flag indicates this behavior.

Examples

Search updates by a particular operator and tenant:

curl --get 'https://pbx.example.com/pbx/openapi.php/useractivity' \
  -H 'X-API-Key: YOUR_GLOBAL_API_KEY' \
  --data-urlencode 'tenant=DEVEL' \
  --data-urlencode 'user=operator' \
  --data-urlencode 'user_action=UPDATE' \
  --data-urlencode 'start=2026-11-01 00:00:00' \
  --data-urlencode 'end=2026-11-30 23:59:59' \
  --data-urlencode 'limit=100'

Find login attempts from an IP address:

curl --get 'https://pbx.example.com/pbx/openapi.php/useractivity' \
  -H 'X-API-Key: YOUR_GLOBAL_API_KEY' \
  --data-urlencode 'host=198.51.100.10' \
  --data-urlencode 'q=LOGIN'

Read one entry:

curl 'https://pbx.example.com/pbx/openapi.php/useractivity/12345' \
  -H 'X-API-Key: YOUR_GLOBAL_API_KEY'

Continue descending pagination using the previous page's cursor:

curl --get 'https://pbx.example.com/pbx/openapi.php/useractivity' \
  -H 'X-API-Key: YOUR_GLOBAL_API_KEY' \
  --data-urlencode 'before_id=12345' \
  --data-urlencode 'limit=100' \
  --data-urlencode 'offset=0'

Equivalent query-string routing is available:

https://pbx.example.com/pbx/openapi.php?object=useractivity&action=list&user_action=LOGIN
https://pbx.example.com/pbx/openapi.php?object=useractivity&action=get&id=12345

Authenticate query-string examples with the same header. Path aliases /useractivities and /user_activity are accepted; the documented canonical route is /useractivity.