---
title: Users Model
slug: users-model
docTags: 
createdAt: 2023-12-15T18:47:49.262Z
---

### Model Documentation

This document provides an overview of the users model used in a the database.

This schema defines the structure for user documents in the database, specifying various fields, and their types.

I'll convert the users model documentation into a table format similar to what I did for the workspaces model.

# Users Model Documentation

## Main Schema Fields

| Field Name                       | Type                 | Description                                                | Default | Index |
| -------------------------------- | -------------------- | ---------------------------------------------------------- | ------- | ----- |
| name                             | String               | The name of the user                                       | -       | No    |
| email                            | String               | The email address of the user (unique, lowercase)          | -       | Yes   |
| password                         | String               | The hashed password of the user                            | -       | No    |
| image                            | String               | A URL or path to the user's profile image                  | -       | No    |
| type                             | String               | The role or type of user                                   | -       | No    |
| active\_status                   | Boolean              | Indicates whether the user is currently active             | -       | No    |
| creation\_type                   | String               | Specifies how the user was created (e.g., "MANUAL\_INPUT") | -       | No    |
| api\_updated\_at                 | Date                 | Timestamp of the last API update made for this user        | -       | No    |
| last\_login                      | Date                 | The date and time of the user's last login                 | -       | No    |
| login\_timezone                  | String               | The timezone of the user's last login                      | -       | No    |
| last\_activity\_time             | Date                 | The timestamp of the user's last recorded activity         | -       | No    |
| last\_activity\_timezone         | String               | The timezone of the user's last activity                   | -       | No    |
| is\_domo\_updated                | Boolean              | A flag indicating if the user's data is updated in Domo    | -       | No    |
| disabled\_sso\_auto\_updated     | Boolean              | Flag to disable automatic updates via SSO                  | -       | No    |
| disabled\_dataset\_auto\_updated | Boolean              | Flag to disable automatic updates from datasets            | -       | No    |
| custom\_fields                   | \[customFieldSchema] | An array of custom fields associated with the user         | -       | No    |
| created\_by                      | ObjectId             | Reference to the user who created this user entry          | -       | No    |
| updated\_by                      | ObjectId             | Reference to the user who last updated this entry          | -       | No    |
| deactivated\_at                  | Date                 | The timestamp when the user was deactivated                | -       | No    |
| created\_at                      | Date                 | The timestamp of when the user was created                 | auto    | No    |
| updated\_at                      | Date                 | The timestamp of the most recent update to the user's data | auto    | No    |

## Sub-Schema

### Custom Field Schema

| Field Name        | Type     | Description                                                                | Default | Index |
| ----------------- | -------- | -------------------------------------------------------------------------- | ------- | ----- |
| custom\_field\_id | ObjectId | Reference to a custom field defined in the user\_custom\_fields collection | -       | No    |
| value             | String   | The value for the custom field                                             | -       | No    |

Note: Some default values are marked with "-" as they were not specified in the original documentation.

