# Users API

## 회원가입

<mark style="color:green;">`POST`</mark> `holosulo.com/users/signup`

#### Request Body

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| password<mark style="color:red;">\*</mark> | String | er          |
| username<mark style="color:red;">\*</mark> | String |             |
| email<mark style="color:red;">\*</mark>    | String |             |

{% tabs %}
{% tab title="201: Created " %}

```markup
{
    "response": "ok",
    "message": "ok",
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
err
```

{% endtab %}
{% endtabs %}

## 이메일 중복 체크

<mark style="color:green;">`POST`</mark> `holosulo.com/users/email`

#### Request Body

| Name  | Type   | Description |
| ----- | ------ | ----------- |
| email | String |             |

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

```javascript
{
    "response": "ok"
    "message": ""
}
```

{% endtab %}

{% tab title="409: Conflict " %}

```javascript
{
    "response": "err"
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
err
```

{% endtab %}
{% endtabs %}

## 닉네임 중복 검사

<mark style="color:green;">`POST`</mark> `holosulo.com/users/userName`

#### Request Body

| Name     | Type   | Description |
| -------- | ------ | ----------- |
| username | String |             |

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

```javascript
{
    "response": "ok"
}
```

{% endtab %}

{% tab title="409: Conflict " %}

```javascript
{
    "response": "err"
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
err
```

{% endtab %}
{% endtabs %}

## 로그인

<mark style="color:green;">`POST`</mark> `holosulo.com/users/login`

#### Request Body

| Name     | Type   | Description |
| -------- | ------ | ----------- |
| email    | String |             |
| password | String |             |

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

```javascript
{
    "response": "ok",
    data:{
        accessToken: "token",
        userInfo:{
            username: "jack",
            }
        }
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```javascript
{
    "response": "login err"
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
err
```

{% endtab %}
{% endtabs %}

## 로그아웃

<mark style="color:green;">`POST`</mark> `holosulo.com/users/logout`

#### Headers

| Name          | Type   | Description |
| ------------- | ------ | ----------- |
| Authorization | String |             |

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

```javascript
{
    "response":"ok"
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

```javascript
{
    "response": "err"
}
```

{% endtab %}
{% endtabs %}

## 회원탈퇴

<mark style="color:red;">`DELETE`</mark> `holosulo.com/users/{userId}`

#### Headers

| Name          | Type   | Description |
| ------------- | ------ | ----------- |
| Authorization | String |             |

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

```javascript
{
    "response": "ok"
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

```javascript
{
    "response": "err"
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
err
```

{% endtab %}
{% endtabs %}

## 유저 이름 수정

<mark style="color:purple;">`PATCH`</mark> `holosulo.com/users/username`

#### Headers

| Name          | Type   | Description |
| ------------- | ------ | ----------- |
| Authorization | String | token       |

#### Request Body

| Name     | Type   | Description |
| -------- | ------ | ----------- |
| username | String |             |

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

```javascript
{
    "response": "ok"
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

```javascript
{
    "response": "err"
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
err
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    "response": "err"
}
```

{% endtab %}
{% endtabs %}

## 패스워드 수정

<mark style="color:purple;">`PATCH`</mark> `holosulo.com/users/password`

#### Headers

| Name          | Type   | Description |
| ------------- | ------ | ----------- |
| Authorization | String | token       |

#### Request Body

| Name     | Type   | Description |
| -------- | ------ | ----------- |
| password | String | newPassword |

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

```javascript
{
    "response": "ok"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    "response": "err"
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

```javascript
{
    "response": "err"
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
err
```

{% endtab %}
{% endtabs %}

## 유저 정보 요청

<mark style="color:blue;">`GET`</mark> `holosulo.com/users/{userId}`

#### Headers

| Name          | Type   | Description |
| ------------- | ------ | ----------- |
| Authorization | String | token       |

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

```javascript
{
   "response": "ok"
   data:{
      username: "jack",
      useremail: "abc@abc.com",
      visitCount: 5,
      weekVisitCount: 2,
      totalHour: 13,
      }
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```javascript
{
    "response": "err"
}
```

{% endtab %}
{% endtabs %}


---

# 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://tkddjs5.gitbook.io/holosulo/api/api-reference/users-api.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.
