> For the complete documentation index, see [llms.txt](https://filmstorage.gitbook.io/filmstorage/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://filmstorage.gitbook.io/filmstorage/users.md).

# Users

## 회원가입

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

#### Request Body

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| email<mark style="color:red;">\*</mark>    | string |             |
| password<mark style="color:red;">\*</mark> | string |             |
| nickname<mark style="color:red;">\*</mark> | string |             |
| mobile<mark style="color:red;">\*</mark>   | string |             |

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

```javascript
{
    // Response
    message: "Successfully Signed Up"
}
```

{% endtab %}

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

```javascript
{
    // Response
    message: "nickname or email already exists"
}
```

{% endtab %}

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

```javascript
{
    // Response
    message: "Internal Server Error"
}
```

{% endtab %}
{% endtabs %}

## 로그인

<mark style="color:green;">`POST`</mark> `/users/signin`

#### Headers

| Name                                              | Type    | Description  |
| ------------------------------------------------- | ------- | ------------ |
| withCredentials<mark style="color:red;">\*</mark> | boolean | must be true |

#### Request Body

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

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

```javascript
{
    // Response
    message: "Successfully Logged In"
}
```

{% endtab %}

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

```javascript
{
    // Response
    message: "No matching user information"
}
```

{% endtab %}

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

```javascript
{
    // Response
    message: "Internal Server Error"
}
```

{% endtab %}
{% endtabs %}

## 로그아웃

<mark style="color:green;">`POST`</mark> `/users/signout`

{% tabs %}
{% tab title="205: Reset Content " %}

```javascript
{
    // Response
    message: "Successfully Logged Out"    
}
```

{% endtab %}

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

```javascript
{
    // Response
    message: "Internal Server Error"
}
```

{% endtab %}
{% endtabs %}

## 아이디 찾기 요청

<mark style="color:green;">`POST`</mark> `/users/find_email`

#### Request Body

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| nickname<mark style="color:red;">\*</mark> | string |             |
| mobile<mark style="color:red;">\*</mark>   | string |             |

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

```javascript
{
    // Response
    message: "ok",
    data: {
        email: User's Email
    }
}
```

{% endtab %}

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

```javascript
{
    // Response
    message: "Internal Server Error"
}
```

{% endtab %}

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

```javascript
{
    // Response
    message: "No matching user information"
}
```

{% endtab %}
{% endtabs %}

## 카카오 소셜 로그인 요청

<mark style="color:green;">`POST`</mark> `/users/oauth`

#### Query Parameters

| Name                                   | Type   | Description       |
| -------------------------------------- | ------ | ----------------- |
| code<mark style="color:red;">\*</mark> | string | AuthorizationCode |

#### Headers

| Name                                              | Type    | Description  |
| ------------------------------------------------- | ------- | ------------ |
| withCredentials<mark style="color:red;">\*</mark> | boolean | must be true |

{% tabs %}
{% tab title="200: OK Response with Cookie" %}

```javascript
{
    // Response
    message: "Logged in with your Kakao account"
}
```

{% endtab %}

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

```javascript
{
    // Response
    message: "Internal Server Error"
}
```

{% endtab %}
{% endtabs %}

## 유저 정보 수정

<mark style="color:purple;">`PATCH`</mark> `/users/update`

#### Request Body

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| nickname<mark style="color:red;">\*</mark> | string |             |
| mobile<mark style="color:red;">\*</mark>   | string |             |

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

```javascript
{
    // Response
    message: "ok",
    data: {
        userInfo: modifiedUserData,
    },
}
```

{% endtab %}

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

```javascript
{
    // Response
    data: null,
    message: "not Authorized"
}
```

{% endtab %}

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

```javascript
{
    // Response
    data: null,
    message: "nickname already exists",
}
```

{% endtab %}

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

```javascript
{
    // Response
    message: "Internal Server Error"
}
```

{% endtab %}
{% endtabs %}

## 프로필 정보 수정

<mark style="color:purple;">`PATCH`</mark> `/users/update/profile/:user_id`

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

```javascript
{
    // Response
    message: "Profile has been updated",
    data: UpdatedUserInfo
}
```

{% endtab %}

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

```javascript
{
    // Response
    message: "Internal Server Error"
}
```

{% endtab %}
{% endtabs %}

## 회원 탈퇴

<mark style="color:red;">`DELETE`</mark> `/users/withdrawal`

{% tabs %}
{% tab title="204: No Content " %}

```javascript
{
    // Response
    message: "Successfully withdrew"
}
```

{% endtab %}

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

```javascript
{
    // Response
    message: "Internal Server Error"
}
```

{% endtab %}
{% endtabs %}

## 유저 정보 조회

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

#### Headers

| Name                                              | Type   | Description  |
| ------------------------------------------------- | ------ | ------------ |
| withCredentials<mark style="color:red;">\*</mark> | string | must be true |

#### Cookies

| Name                                          | Type   | Description |
| --------------------------------------------- | ------ | ----------- |
| accessToken<mark style="color:red;">\*</mark> | string |             |

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

```javascript
{
    // Response
    message: "ok",
    data: {
        userInfo: userInfo
    }
}
```

{% endtab %}

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

```javascript
{
    // Response
    data: null,
    message: 'not Authorized'
}
```

{% endtab %}

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

```javascript
{
    // Response
    data: null,
    message: 'No matching user information'
}
```

{% endtab %}

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

```javascript
{
    // Response
    message: "Internal Server Error"
}
```

{% endtab %}
{% endtabs %}

## 등록된 이메일로 비밀번호 인증 메일 전송

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

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

```javascript
{
    // Response
    message: "ok"
}
```

{% endtab %}

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

```javascript
{
    // Response
    message: "Internal Server Error"
}
```

{% endtab %}

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

```javascript
{
    // Response
    message: "No matching user information"
}
```

{% endtab %}
{% endtabs %}

## 이메일 찾기

<mark style="color:blue;">`GET`</mark> `/users/find_email?nickname&mobile`

#### Query Parameters

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| nickname<mark style="color:red;">\*</mark> | string |             |
| mobile<mark style="color:red;">\*</mark>   | string |             |

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

```javascript
{
    // Response
    message: "ok",
    data: findMatchedEmail
}
```

{% endtab %}

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

```javascript
{
    // Response
    message: "No matching user information"
}
```

{% endtab %}

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

```javascript
{
    // Response
    message: "Internal Server Error"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://filmstorage.gitbook.io/filmstorage/users.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.
