User accounts and profiles
Read daily user activity totals
/a/Users_getActivityLogDaily
Aggregate recent user activity by database-local date.
When to use this endpoint
Use for the User Activity overview, then use Users_getActivityLog for the selected day’s minute buckets.
Authentication and permissions
Authenticate with signed API-key fields or a logged-in CRM session. Session requests use the dispatcher’s CSRF protection when configured.
Configured TeamAccess row scope is applied in the queries. Ordinary collection requests do not need artificial record IDs. Explicit IDs still pass dispatcher record authorization; unavailable IDs can be rejected there rather than silently omitted.
Explicit Users Activity View is required.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | Integer string | No | Nonnegative integer user ID; zero or omitted means all visible users. |
inactive | Integer flag | No | Integer 0 selects active users when no specific user_id is selected; 1 includes inactive users. |
activity_type | Integer string | No | Integer 0 (all), 1 (read), or 2 (write). |
session_id | String | No | Scalar session identifier, at most 4096 bytes; blank does not filter. |
Example request
$result = FM_api('Users_getActivityLogDaily', [
'user_id'=>'1042',
]);
Example response
{
"logs": [
{
"d": "2026-11-03",
"n": "12"
}
],
"sessions": [
"example-session"
]
}
Errors and unusual responses
| Response | Condition |
|---|---|
{"error":"not logged in"} | No authenticated tenant context is available. Invalid signed credentials can be rejected by the dispatcher before the handler runs. |
{"error":"invalid parameter: example"} | A supplied native control is malformed; the response names that control. Lists must be flat, and numeric IDs must be positive integers unless the parameter explicitly permits zero. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Starts strictly after the earlier of server January 1 and now minus 60×86400 seconds. It is not limited to 60 days: most of the year it includes the year-to-date range, and early January includes days from the prior year.
- Groups DATE(FROM_UNIXTIME(timestamp)) using database session timezone, without an explicit account-timezone conversion. There is no upper timestamp bound, explicit ordering or zero-day filling.
- Distinct sessions apply date/user/type/active filters before session_id is added. Selecting a session narrows logs but leaves the sessions choices broad.
- Active-only mode selects active tenant user IDs, intersects user scope, and safely returns no logs if that selection is empty. The historical date span and database timezone rules above remain unchanged.
Side effects
- Reads data without changing business records, edit markers, activity history or notifications. Shared setting reads can populate their normal settings cache.
See it in Fieldmotion
CRM1
Open Users Activity in CRM1 and change user/type/inactive/session filters. Filter Users_getActivityLogDaily.
CRM2
CRM2 Users Activity sends user_id, activity_type and inactive to the same route; the inspected request does not send session_id.
Related endpoints
Users_getActivityLog— Drill into a selected day’s minute counts.Users_list— Read the basic selectable user list and its explicit scope predicate.