Each app has a user model that represents users that can enroll in the application. Whenever a user object is created, additional metadata is stored to facilitate enrollment and session management.
A single user may have one or more sessions. A session represents a single device that is (or was) signed in.
To allow a user to have more than one session, the "Multiple devices per user" feature flag must be enabled for the application.
Parameters
To retrieve, create, update or delete mobile users, follow the instructions in these sections of the documentation for your mobile user object type (e.g. user):
Deleting the user object will lock the user and wipe all app data from the user's enrolled devices. This operation is irreversible.
Version compatibility
The sync_status field with last_full_sync is only available for devices with version 4.36.0 or greater of the JourneyApps Container.
Before managed runtime versions (i.e. before version 4.70), only the installed container version was reported to the backend. Since version 4.70 the runtime version was reported, though it was still erroneously called the "container version" on the backend. As of version 4.82, both the runtime and container versions are reported correctly to the JourneyApps backend.
ENROLLED: Currently enrolled.
LOCKED: Locked via backend, API, or from the device. Will direct user to the login screen on next connect.
RESET: Like locked, but will force a data wipe the next time the device connects.
NEVER_ENROLLED: Only for legacy data.
last_connected_at
Updated every time the device connects via an API call, such as sync or data upload.
created_at
First enrollment date for this session.
last_authenticated_at
Date of the last enrollment call. Should be close to created_at if this is the first enrollment (may not match exactly).
signed_out_at
Date of last sign out (when the state changed to LOCKED or RESET). Stays present when the session enrolls again.
Apart from last_connected_at, these values only change when the user enrolls or the session is "locked". Note that in typical cases, the same session is used over multiple enrollments if the same device is used, but a new session is created if the user enrolls using a different device.
Lock user
Locking the user will automatically disable the application on all of their devices, as well as prevent them from logging in again.
Note: A user can be unlocked, in which case they will be able to log in again.
If wipe is true, all application data on the device will be permanently deleted. This can include any data or attachments that have not uploaded to the JourneyApps Backend yet. This action cannot be undone.
API:
POST /api/v4/backend-deployment-id/users/user-id/lock
{"wipe": true/false}
This will permanently delete all application data from the specific device. This can include any data or attachments that have not uploaded to the JourneyApps Backend yet. This action cannot be undone.
This does not affect any other sessions, and the user will still be able to log in.
API:
POST /api/v4/backend-deployment-id/users/user-id/sessions/session-id/wipe