Skip to main content

Internal user object with comprehensive administrative and system details

_id
string
required

Unique identifier for the user (MongoDB ObjectId)

Example:

"65c1f68ea735b522d370ea23"

organizationId
string
required

Organization identifier that owns this user

Example:

"65c1f4eeca7c4816d94587b2"

name
string
required

Full name of the user

Example:

"John Doe"

email
string<email>
required

User's email address (unique within organization)

Example:

"john.doe@mile.app"

status
enum<string>
required

User account status

Available options:
active,
inactive,
pending,
suspended
Example:

"active"

phone
string

User's phone number

Example:

"+62812345678"

roleId
string

ID of assigned role

Example:

"65c1f68ea735b522d370ea24"

role
object

User role information

hubAccess
string[]

List of hub IDs user has access to

Example:
[
"65c1f68ea735b522d370ea25",
"65c1f68ea735b522d370ea26"
]
hubs
object[]

Detailed hub access information

lastLoginTime
string<date-time>

Last successful login timestamp

Example:

"2024-02-06T09:30:00.000000Z"

profilePicture
string

URL to user's profile picture

Example:

"https://storage.mile.app/profiles/user123.jpg"

language
enum<string>

User's preferred language

Available options:
en,
id,
ms
Example:

"en"

timezone
string

User's timezone preference

Example:

"Asia/Jakarta"

isEmailVerified
boolean

Whether user's email is verified

Example:

true

isPhoneVerified
boolean

Whether user's phone is verified

Example:

false

twoFactorEnabled
boolean

Whether 2FA is enabled for this user

Example:

false

deviceTokens
object[]

Push notification device tokens

settings
object

User application settings

createdBy
string

Email of admin who created this user account

Example:

"admin@mile.app"

updatedBy
string

Email of admin who last updated this user

Example:

"admin@mile.app"

createdTime
string<date-time>

ISO 8601 timestamp when user was created

Example:

"2024-01-15T10:00:00.000000Z"

updatedTime
string<date-time>

ISO 8601 timestamp when user was last updated

Example:

"2024-02-06T14:20:15.000000Z"

invitedTime
string<date-time>

When user invitation was sent

Example:

"2024-01-15T10:00:00.000000Z"

activatedTime
string<date-time>

When user account was activated

Example:

"2024-01-15T14:30:00.000000Z"

internalNotes
string

Internal administrative notes (not visible to public API)

Example:

"User requires additional training on new features"

securityLog
object[]

Internal security event log

systemMetadata
object

Internal system metadata

failedCode
enum<string>

User Module business failedCode that indicate specific failure conditions or business rule violations during user module operations. These codes help identify the failed operation of user-related and provide standardized failure identification across the system.

Possible values:

  • user-033: User not found - User record does not exist
  • user-034: User unauthorized access - User not authorized for operation
  • user-035: Access forbidden - Operation requires specific role/permission
  • user-036: Email already invited - Invitation already sent to email
  • user-037: Email already used - Email registered to another account
  • user-038: User has no hub assigned - User not assigned to any hub
  • user-039: Operation requires owner role - Only organization owner can perform
  • user-040: User data not found in list - User missing from specified list
  • user-041: Invalid password reset token - Token expired or invalid
  • user-042: User account not found - Account doesn't exist in system
  • user-043: Invalid activation code - Activation code incorrect/expired
  • user-044: User already activated - Account already activated
  • user-045: Cannot invite active user - User already active in system
  • user-046: User update operation failed - Failed to update user data
  • user-047: User module server failure - Internal server failure in user module
  • user-048: User update/delete status member of himself - User cannot modify self
  • user-049: User delete first organization owner - First org owner protected
Available options:
user-033,
user-034,
user-035,
user-036,
user-037,
user-038,
user-039,
user-040,
user-041,
user-042,
user-043,
user-044,
user-045,
user-046,
user-047,
user-048,
user-049