# Built-in User model

The User model represents users of the application or API. You must create your own custom model (named something other than “User,” for example “Customer” or “Client”) that extends the built-in User model rather than use the built-in User model directly. The built-in User model provides a great deal of commonly-used functionality that you can use via your custom model.

Here is list of generated API endpoints for built-in user model as below:

| Method     | URL                                                                            | Description                                                                                             |
| ---------- | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------- |
| **PATCH**  | **/Users**                                                                     | Patch an existing model instance or insert a new one into the data source.                              |
| **GET**    | **/Users**                                                                     | Find all instances of the model matched by filter from the data source.                                 |
| **PUT**    | **/Users**                                                                     | Replace an existing model instance or insert a new one into the data source.                            |
| **POST**   | **/Users**                                                                     | Create a new instance of the model and persist it into the data source                                  |
| **PATCH**  | **/Users/{id}**                                                                | Patch attributes for a model instance and persist it into the data source.                              |
| **GET**    | **/Users/{id}**                                                                | Find a model instance by {{id}} from the data source.                                                   |
| **HEAD**   | **/Users/{id}**                                                                | Check whether a model instance exists in the data source.                                               |
| **PUT**    | **/Users/{id}**                                                                | Replace attributes for a model instance and persist it into the data source.                            |
| **DELETE** | **/Users/{id}**                                                                | Delete a model instance by {{id}} from the data source.                                                 |
| **GET**    | <p><strong>/Users/{id}/</strong></p><p><strong>accessTokens</strong></p>       | Queries accessTokens of User.                                                                           |
| **POST**   | <p><strong>/Users/{id}/</strong></p><p><strong>accessTokens</strong></p>       | Creates a new instance in accessTokens of this model.                                                   |
| **DELETE** | <p><strong>/Users/{id}/</strong></p><p><strong>accessTokens</strong></p>       | Deletes all accessTokens of this model.                                                                 |
| **GET**    | <p><strong>/Users/{id}/</strong></p><p><strong>accessTokens/{fk}</strong></p>  | Find a related item by id for accessTokens.                                                             |
| **PUT**    | <p><strong>/Users/{id}/</strong></p><p><strong>accessTokens/{fk}</strong></p>  | Update a related item by id for accessTokens.                                                           |
| **DELETE** | <p><strong>/Users/{id}/</strong></p><p><strong>accessTokens/{fk}</strong></p>  | Delete a related item by id for accessTokens.                                                           |
| **GET**    | <p><strong>/Users/{id}/</strong></p><p><strong>accessTokens/count</strong></p> | Counts accessTokens of User.                                                                            |
| **GET**    | **/Users/{id}/exists**                                                         | Check whether a model instance exists in the data source.                                               |
| **POST**   | **/Users/{id}/replace**                                                        | Replace attributes for a model instance and persist it into the data source.                            |
| **POST**   | **/Users/{id}/verify**                                                         | Trigger user's identity verification with configured verifyOptions                                      |
| **POST**   | **/Users/change-password**                                                     | Change a user's password.                                                                               |
| **GET**    | **/Users/change-stream**                                                       | Create a change stream.                                                                                 |
| **POST**   | **/Users/change-stream**                                                       | Create a change stream.                                                                                 |
| **GET**    | **/Users/confirm**                                                             | Confirm a user registration with identity verification token.                                           |
| **GET**    | **/Users/count**                                                               | Count instances of the model matched by where from the data source.                                     |
| **GET**    | **/Users/findOne**                                                             | Find first instance of the model matched by filter from the data source.                                |
| **POST**   | **/Users/login**                                                               | Login a user with username/email and password.                                                          |
| **POST**   | **/Users/logout**                                                              | Logout a user with access token.                                                                        |
| **POST**   | **/Users/replaceOrCreate**                                                     | Replace an existing model instance or insert a new one into the data source.                            |
| **POST**   | **/Users/reset**                                                               | Reset password for a user with email.                                                                   |
| **POST**   | **/Users/reset-password**                                                      | Reset user's password via a password-reset token.                                                       |
| **POST**   | **/Users/update**                                                              | Update instances of the model matched by {{where}} from the data source.                                |
| **POST**   | **/Users/upsertWithWhere**                                                     | Update an existing model instance or insert a new one into the data source based on the where criteria. |

{% hint style="info" %}
Hormo Studio does not support multiple models based on the User model in a single application. That is, you cannot have more than one model derived from the built-in User model in a single app.
{% endhint %}

{% content-ref url="/pages/-Lz7-hWJNM1H5hEnV6BZ" %}
[Database](/database.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hormo.studio/models/built-in-user-model.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
