--- title: "User" slug: "user-schema" updated: 2025-09-01T12:18:23Z published: 2025-09-01T12:18:23Z canonical: "developer.rocket.chat/user-schema" --- > ## Documentation Index > Fetch the complete documentation index at: https://developer.rocket.chat/llms.txt > Use this file to discover all available pages before exploring further. # User The **IUser** interface represents the **User** object, which defines the properties and their types that can be associated with a user. User information is stored in the `users` collection on MongoDB. ## Properties The `User` object has the following fields and data types: | Parameter | Data type | Description | | --- | --- | --- | | `_id` | String | The unique identifier for the user. | | `createdAt` | Date | The date and time when the user was created. | | `roles` | Array of strings | An array of role IDs associated with the user. For example, `user`, `admin`, `livechat-agent` | | `type` | String | The type of user. For example, `user`, `app`, or `bot` | | `active` | Boolean | Indicates whether the user is active or not. | | `username` | String | The username of the user. | | `nickname` | String | The user’s nickname. | | `name` | String | The user’s name. | | `services` | Object | Additional services associated with the user. | | `emails` | Array of objects | An array of email objects associated with the user. | | `status` | String | The user’s status. | | `statusConnection` | String | The status connection of the user. | | `lastLogin` | Date | The date and time of the user's last login. | | `bio` | String | The user’s biography or description. | | `avatarOrigin` | String | The origin of the user's avatar. | | `avatarETag` | String | The ETag of the user's avatar. | | `avatarUrl` | String | The URL of the user's avatar. | | `utcOffset` | Number | The UTC offset of the user's timezone. | | `language` | String | The user’s language preference. | | `statusDefault` | String | The default status of the user. | | `statusText` | String | The custom status text of the user. | | `oauth` | Object | OAuth information associated with the user. | | `_updatedAt` | Date | The date and time when the user object was last updated. | | `e2e` | Object | End-to-end encryption information associated with the user. | | `requirePasswordChange` | Boolean | Indicates whether the user needs to change their password. | | `customFields` | Object | Additional custom fields associated with the user. | | `settings` | Object | User-specific settings. | | `defaultRoom` | String | The ID of the user's default room. | | `ldap` | Boolean | Indicates whether the user is an LDAP user. | | `extension` | String | The extension associated with the user. | | `inviteToken` | String | The token for inviting the user. | | `canViewAllInfo` | Boolean | Indicates whether the user can view all information. | | `phone` | String | The phone number associated with the user. | | `reason` | String | The reason associated with the user, if they are reported. | | `federated` | Boolean | Indicates whether the user is a federated user. | | `federation` | Object | Federation information associated with the user. | | `banners` | Object | Banner information associated with the user. | | `importIds` | Array of strings | An array of import IDs associated with the user. | Refer to the main interface associated with the user object: **Main Interface** The main interface of a `User` object. ```typescript interface IUser { _id: string; createdAt: Date; roles: IRole['_id'][]; type: string; active: boolean; username?: string; nickname?: string; name?: string; services?: IUserServices; emails?: IUserEmail[]; status?: UserStatus; statusConnection?: string; lastLogin?: Date; bio?: string; avatarOrigin?: string; avatarETag?: string; avatarUrl?: string; utcOffset?: number; language?: string; statusDefault?: UserStatus; statusText?: string; oauth?: { authorizedClients: string[]; }; _updatedAt: Date; e2e?: { private_key: string; public_key: string; }; requirePasswordChange?: boolean; customFields?: { [key: string]: any; }; settings?: IUserSettings; defaultRoom?: string; ldap?: boolean; extension?: string; inviteToken?: string; canViewAllInfo?: boolean; phone?: string; reason?: string; federated?: boolean; federation?: { avatarUrl?: string; searchedServerNames?: string[]; }; banners?: { [key: string]: { id: string; priority: number; title: string; text: string; textArguments?: string[]; modifiers: ('large' | 'danger')[]; link: string; read?: boolean; }; }; importIds?: string[]; } ``` For more information and details on the Interface and sub-interfaces, see the code here [Rocket.Chat/IUser.ts at develop · RocketChat/Rocket.Chat](https://github.com/RocketChat/Rocket.Chat/blob/develop/packages/core-typings/src/IUser.ts) ## User object example **Example object** ```json {    "_id": "gzvcvpov9G4TxbGFS",    "createdAt": {        "$date": "2023-03-02T17:59:43.415Z"    },    "services": {        "password": {            "bcrypt": "$2b$10$u..."        },        "email2fa": {            "enabled": true,            "changedAt": {                "$date": "2023-03-02T17:59:43.415Z"            }        },        "resume": {            "loginTokens": []        }    },    "username": "demouser",    "emails": [        {            "address": "demo@email.com",            "verified": true        }    ],    "type": "user",    "status": "offline",    "active": true,    "_updatedAt": {        "$date": "2023-03-02T18:47:15.205Z"    },    "__rooms": [        "GENERAL"    ],    "roles": [        "user"    ],    "name": "demouser",    "requirePasswordChange": false,    "settings": {},    "lastLogin": {        "$date": "2023-03-02T18:14:28.122Z"    },    "statusConnection": "offline",    "e2e": {        "private_key": "{\"$binary\":\"m4E7yE/...==\"}",        "public_key": "{\"alg\":\"RSA-OAEP-256\",\"e\":\"AQAB\",\"ext\":true,\"key_ops\":[\"encrypt\"],\"kty\":\"RSA\",\"n\":\"0pbPAF67...w\"}"    },    "utcOffset": 1 } ```