> For the complete documentation index, see [llms.txt](https://geekyants-5.gitbook.io/flatandflatmates/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://geekyants-5.gitbook.io/flatandflatmates/api-server/routes/user.md).

# User

**File Name** : user.js\
**File Path** : /server/routes/user.js\
This route is used to handle end user related queries. For example: fetching single user using id, creating new user, Adding new address to existing end user details, etc.

<mark style="color:blue;">`GET`</mark> `/api/users`

#### Path Parameters

| Name          | Type   | Description          |
| ------------- | ------ | -------------------- |
| Authorization | string | Authentication Token |

{% tabs %}
{% tab title="200 " %}

```javascript
{
    success: true,
    message: 'Users found',
    data: users (array of users)
}
or 
{
    success: true,
    message: 'no users available',
    data: []
}
```

{% endtab %}
{% endtabs %}

## Register

<mark style="color:blue;">`GET`</mark> `/api/users/register`

#### Request Body

| Name       | Type   | Description                     |
| ---------- | ------ | ------------------------------- |
| email      | string | email id from fb data           |
| password   | string | password (user id) from fb data |
| fname      | string | first name from fb data         |
| lname      | string | last name from fb data          |
| profileUrl | string | Profile Url from fb data        |
| deviceId   | string | Device Id for later use         |

{% tabs %}
{% tab title="200 " %}

```javascript
{
    success: false,
    message: 'user already exist',
    data: {}
}
or 
{
   success: true
   message: 'user created successfully',
   data: userData
}
or 
{
   success: false
    message: 'error while register'
}
```

{% endtab %}
{% endtabs %}
