Skip to main content

Collection Control Domain

The Collection Control domain provides a three-tier control system (client-level, device-level, user-level) for managing what data the AMM agent collects across deployed devices and users.

Controls follow a strict precedence model: Client > Device > User. Client-level controls always take precedence over device-level and user-level controls.

For embedding and endpoint design decisions, see the Design Guidelines.

Tier Overview

TierFieldLocationValuesDefault
Clientcollection_modeClient DTOdiscovery, saas_usage, disabled, deletedsaas_usage
Devicecollection_stateDevice DTOenabled, disabled, deletedenabled
UserstatusUserRef / User DTOactive, archived, deletedactive

Collection Mode Behavior

ModeAgent Behavior
discoveryCollects device info and installed software only -- no app usage or browsing telemetry
saas_usageFull data collection (default)
disabledAll collection stopped; agent sends lightweight heartbeats (device_id + user_id only) to poll for config changes
deletedAgent self-uninstalls. Irreversible.

Precedence Model

The effective collection mode for a device is computed by applying the three tiers in order:

  1. If client.collection_mode is disabled or deleted → effective mode = client mode (overrides everything)
  2. If device.collection_state is disabled or deleted → effective mode = device state
  3. If user.status is archived or deleted → agent stops collecting for that user session, sends lightweight heartbeats
  4. Otherwise → effective mode = client.collection_mode

This is exposed as effective_mode on the full Device DTO.

A single device with multiple OS users can have different user statuses -- only affected user sessions stop collecting.

Irreversibility

EntityIrreversible StateBehavior
ClientdeletedCannot transition to any other mode. Agent self-uninstalls.
DevicedeletedCannot transition to any other state. Agent self-uninstalls.
UserdeletedCannot transition to any other status. Row retained, no new data. Re-detected users create a new record.

User archived is reversible -- can be reactivated to active at any time.

Endpoints

Control endpoints are distributed across the affected domains:

Client-level

EndpointMethodDescription
Update ClientPATCHChange the client's collection_mode

Device-level

EndpointMethodDescription
Update Device ControlsPATCHUpdate a single device's collection_state and log_shipping_enabled
Bulk Enable DevicesPOSTEnable collection on multiple devices
Bulk Disable DevicesPOSTDisable collection on multiple devices
Bulk Delete DevicesPOSTMark multiple devices as deleted

User-level

EndpointMethodDescription
Update UserPATCHChange a single user's status (alongside department updates)
Bulk Archive UsersPOSTArchive collection for multiple users
Bulk Activate UsersPOSTReactivate collection for multiple users
Bulk Delete UsersPOSTSoft-delete multiple users

Audit

EndpointMethodDescription
Audit LogGETPaginated audit trail of all collection control changes

Config Delivery

Agents receive their effective configuration via the heartbeat response. No new polling endpoint is required. The heartbeat response includes:

{
"ok": true,
"received_at_utc": "...",
"config": {
"collection_mode": "saas_usage",
"device_state": "enabled",
"log_shipping_enabled": false,
"user_status": "active"
}
}

When disabled/deleted (at any tier), the agent sends lightweight heartbeats containing only device_id, user_id, and generated_at_utc to continue polling for config changes.