# Folder

## 특정 유저의 폴더를 생성합니다.

<mark style="color:green;">`POST`</mark> `https://service-stage.pic-origin.com/api/v1/users/{user_id}/folders`

#### Path Parameters

| Name                                       | Type   | Description                       |
| ------------------------------------------ | ------ | --------------------------------- |
| user\_id<mark style="color:red;">\*</mark> | String | <p>유저의 id</p><p>ex)8BfE96V8Xc</p> |

#### Headers

| Name                                            | Type   | Description   |
| ----------------------------------------------- | ------ | ------------- |
| Authorization<mark style="color:red;">\*</mark> | String | User ${Token} |

#### Request Body

| Name                                    | Type   | Description                                               |
| --------------------------------------- | ------ | --------------------------------------------------------- |
| title<mark style="color:red;">\*</mark> | String | <p>폴더의 제목(default=None)</p><p>ex)강남구</p>                  |
| parent\_id                              | String | <p>해당 폴더의 상위 폴더의 id(default=None)</p><p>ex)JC4Ub4EZo7</p> |

{% tabs %}
{% tab title="200: OK 폴더 생성 성공" %}

```json
{
    "status_code": 200,
    "message": "성공",
    "result": {
        "id": "4tb42KfHHB",
        "user_id": "EabHTVpYYm",
        "title": "test_biz",
        "parent_id": null,
        "created_at": "20240110_150924",
        "updated_at": "20240110_150924",
        "delete_at": null
    }
}
```

{% endtab %}

{% tab title="400: Bad Request 폴더 생성 실패" %}

{% endtab %}
{% endtabs %}

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

```bash
curl --location --request POST 'https://service-stage.pic-origin.com/api/v1/users/{user_id}/folders' \
--header 'Authorization: User {YOUR_TOKEN}' \
--form 'title="{YOUR_TITLE}"' \
--form 'parent_id="{YOUR_PARENT_ID}"'
```

{% endtab %}
{% endtabs %}

## 특정 유저의 모든 폴더를 조회합니다.

<mark style="color:blue;">`GET`</mark> `https://service-stage.pic-origin.com/api/v1/users/{user_id}/folders`

#### Path Parameters

| Name                                       | Type   | Description                       |
| ------------------------------------------ | ------ | --------------------------------- |
| user\_id<mark style="color:red;">\*</mark> | String | <p>유저의 id</p><p>ex)8BfE96V8Xc</p> |

#### Query Parameters

| Name            | Type | Description                               |
| --------------- | ---- | ----------------------------------------- |
| has\_delete\_at | Bool | <p>휴지통 여부(default=None)</p><p>ex)True</p> |

#### Headers

| Name                                            | Type   | Description   |
| ----------------------------------------------- | ------ | ------------- |
| Authorization<mark style="color:red;">\*</mark> | String | User ${Token} |

{% tabs %}
{% tab title="200: OK 폴더 조회 성공" %}

```json
{
    "status_code": 200,
    "message": "성공",
    "result": [
        {
            "id": "KumR7WKAUA",
            "user_id": "EabHTVpYYm",
            "title": "logun1",
            "parent_id": null,
            "created_at": "20240103_133924",
            "updated_at": "20240103_133924",
            "delete_at": null,
            "child_folders": []
        },
        {
            "id": "HxiGzpvV6m",
            "user_id": "EabHTVpYYm",
            "title": "test_biz1",
            "parent_id": null,
            "created_at": "20240117_230920",
            "updated_at": "20240214_145446",
            "delete_at": null,
            "child_folders": [
                {
                    "id": "JC4Ub4EZo7",
                    "user_id": "EabHTVpYYm",
                    "title": "logun2",
                    "parent_id": "HxiGzpvV6m",
                    "created_at": "20231019_132322",
                    "updated_at": "20231019_132322",
                    "delete_at": null,
                    "child_folders": [
                        {
                            "id": "HiBLQb9TyC",
                            "user_id": "EabHTVpYYm",
                            "title": "맹보관",
                            "parent_id": "JC4Ub4EZo7",
                            "created_at": "20231024_150645",
                            "updated_at": "20240221_144449",
                            "delete_at": null,
                            "child_folders": []
                        }
                    ]
                },
                {
                    "id": "4tb42KfHHB",
                    "user_id": "EabHTVpYYm",
                    "title": "test_biz",
                    "parent_id": "HxiGzpvV6m",
                    "created_at": "20240110_150924",
                    "updated_at": "20240110_150924",
                    "delete_at": null,
                    "child_folders": []
                }
            ]
        },
        {
            "id": "Aqtfi55uqc",
            "user_id": "EabHTVpYYm",
            "title": "test_biz4",
            "parent_id": null,
            "created_at": "20231024_153016",
            "updated_at": "20240214_151243",
            "delete_at": null,
            "child_folders": []
        }
    ]
}
```

{% endtab %}

{% tab title="400: Bad Request 폴더 조회 실패" %}

{% endtab %}
{% endtabs %}

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

```bash
curl --location --request GET 'https://service-stage.pic-origin.com/api/v1/users/{user_id}/folders' \
--header 'Authorization: User {YOUR_TOKEN}' 
```

{% endtab %}
{% endtabs %}

## 특정 유저의 특정 폴더를 조회합니다.

<mark style="color:blue;">`GET`</mark> `https://service-stage.pic-origin.com/api/v1/users/{user_id}/folders/{folder_id}`

#### Path Parameters

| Name                                         | Type   | Description                          |
| -------------------------------------------- | ------ | ------------------------------------ |
| user\_id<mark style="color:red;">\*</mark>   | String | <p>유저의 id</p><p>ex)8BfE96V8Xc</p>    |
| folder\_id<mark style="color:red;">\*</mark> | String | <p>해당 폴더의 id</p><p>ex)JC4Ub4EZo7</p> |

#### Query Parameters

| Name            | Type   | Description                                                                            |
| --------------- | ------ | -------------------------------------------------------------------------------------- |
| sort\_by        | String | <p>정렬 기준(default=created\_at)\[created\_at, updated\_at,name]</p><p>ex)created\_at</p> |
| sort\_order     | String | <p>정렬 방식(default=asc)\[asc, desc]</p><p>ex)desc</p>                                    |
| get\_image      | Bool   | <p>이미지 포함 여부(default=True)</p><p>ex)True</p>                                           |
| last\_index     | Int    | <p>페이지 시작 인덱스<br>(default=None)</p><p>ex) 10</p>                                       |
| page\_size      | Int    | <p>한 페이지 당 크기(default=60) </p><p>ex)60</p>                                             |
| with\_history   | Bool   | <p>이미지수정 내역 공개 여부(default=False) </p><p>ex)True</p>                                    |
| has\_delete\_at | Bool   | <p>휴지통 여부(default=None)</p><p>ex)True</p>                                              |
| with\_custom    | Bool   | <p>이미지 커스텀 공개 여부 (default=None)</p><p>ex) True</p>                                     |
| with\_memo      | Bool   | <p>이미지 메모 공개 여부 (default=None)</p><p>ex) True</p>                                      |

#### Headers

| Name                                            | Type   | Description   |
| ----------------------------------------------- | ------ | ------------- |
| Authorization<mark style="color:red;">\*</mark> | String | User ${Token} |

{% tabs %}
{% tab title="200: OK 폴더 조회 성공" %}

```json
{
    "status_code": 200,
    "message": "성공",
    "result": {
        "count": 2,
        "total_count": 32,
        "last_index": 32,
        "page_size": 100,
        "total_filesize_mb": 0.12,
        "current_path": "/",
        "current_path_id": "/",
        "items": [
            {
                "is_folder": false,
                "data": {
                    "id": "de8c49f1-b153-49eb-8ecd-38b8957b4070",
                    "user_id": "EabHTVpYYm",
                    "folder_id": null,
                    "filename": "20231221_170923_5bcd01602b62b5256e1da8b248d631de_V00.JPEG",
                    "path_url": "https://pillo-app-dev.s3.amazonaws.com/EabHTVpYYm/images/edit/20231221_170923_5bcd01602b62b5256e1da8b248d631de_V00.JPEG?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAZEHAPJW7UBG2TATL%2F20240327%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Date=20240327T044247Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=dc68cc5ac8af6c8ba404cecdf46b5155e1258b19c07f7f42d080daccfaa65a49",
                    "org_path_url": "https://pillo-app-dev.s3.amazonaws.com/EabHTVpYYm/images/edit/20231221_170923_5bcd01602b62b5256e1da8b248d631de_V00.JPEG?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAZEHAPJW7UBG2TATL%2F20240327%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Date=20240327T044247Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=dc68cc5ac8af6c8ba404cecdf46b5155e1258b19c07f7f42d080daccfaa65a49",
                    "lat": 127.1052133,
                    "lng": 37.3595316,
                    "address_road": "경기 성남시 분당구 불정로 6",
                    "address_land": "경기 성남시 분당구 정자동 178 - 1",
                    "address_land_number": "0-0",
                    "building_name": "NAVER그린팩토리",
                    "address_sort": null,
                    "address_det": "d",
                    "created_at": "20231221_170923",
                    "updated_at": "20231221_170923",
                    "delete_at": null,
                    "filedata_total": 1,
                    "is_signed": true,
                    "is_shared": false,
                    "has_det": null,
                    "image_resource_type": "JPEG",
                    "resolution": null,
                    "image_filesize_mb": 0.04,
                    "memos": [],
                    "customs": [],
                    "filedatas": []
                }
            },
            {
                "is_folder": false,
                "data": {
                    "id": "9af1afa3-e710-4858-b18b-de81559a9571",
                    "user_id": "EabHTVpYYm",
                    "folder_id": null,
                    "filename": "20231221_173159_5bcd01602b62b5256e1da8b248d631de_V00.JPEG",
                    "path_url": "https://pillo-app-dev.s3.amazonaws.com/EabHTVpYYm/images/edit/20231221_173159_4b37f9c3b4066dc76e55de0a3750911a_V25.JPEG?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAZEHAPJW7UBG2TATL%2F20240327%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Date=20240327T044247Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=79dccf6a2db0852c5627949efc9c0491aba29cd2fc325653805ca2c0fb657d7f",
                    "org_path_url": "https://pillo-app-dev.s3.amazonaws.com/EabHTVpYYm/images/edit/20231221_173159_5bcd01602b62b5256e1da8b248d631de_V00.JPEG?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAZEHAPJW7UBG2TATL%2F20240327%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Date=20240327T044247Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=a73bca54d86a255f059f77893d81bc768636ac295b08c07c2bcacb148a876a4d",
                    "lat": 37.3595316,
                    "lng": 127.1052133,
                    "address_road": "경기 성남시 분당구 불정로 6",
                    "address_land": "경기 성남시 분당구 정자동 178 - 1",
                    "address_land_number": "0-0",
                    "building_name": "NAVER그린팩토리",
                    "address_sort": null,
                    "address_det": "d",
                    "created_at": "20231221_173159",
                    "updated_at": "20240311_151113",
                    "delete_at": null,
                    "filedata_total": 26,
                    "is_signed": true,
                    "is_shared": false,
                    "has_det": null,
                    "image_resource_type": "JPEG",
                    "resolution": "576x1024",
                    "image_filesize_mb": 0.08,
                    "memos": [],
                    "customs": [],
                    "filedatas": []
                }
            }
        ]
    }
}
```

{% endtab %}

{% tab title="400: Bad Request 폴더 조회 실패" %}

{% endtab %}
{% endtabs %}

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

```bash
curl --location --request GET 'https://service-stage.pic-origin.com/api/v1/users/{user_id}/folders/{folder_id}' \
--header 'Authorization: User {YOUR_TOKEN}' 
```

{% endtab %}
{% endtabs %}

## 특정 유저의 특정 폴더를 수정합니다.

<mark style="color:orange;">`PUT`</mark> `https://service-stage.pic-origin.com/api/v1/users/{user_id}/folders/{folder_id}`

#### Path Parameters

| Name                                         | Type   | Description                          |
| -------------------------------------------- | ------ | ------------------------------------ |
| user\_id<mark style="color:red;">\*</mark>   | String | <p>유저의 id</p><p>ex)8BfE96V8Xc</p>    |
| folder\_id<mark style="color:red;">\*</mark> | String | <p>해당 폴더의 id</p><p>ex)JC4Ub4EZo7</p> |

#### Query Parameters

| Name   | Type   | Description                                                                        |
| ------ | ------ | ---------------------------------------------------------------------------------- |
| delete | String | <p>폴더 삭제 여부 (대소문자 구분 없이 'true' or 'false') (default=None)</p><p>ex)True</p><p></p> |

#### Headers

| Name                                            | Type   | Description   |
| ----------------------------------------------- | ------ | ------------- |
| Authorization<mark style="color:red;">\*</mark> | String | User ${Token} |

#### Request Body

| Name       | Type   | Description                                           |
| ---------- | ------ | ----------------------------------------------------- |
| parent\_id | String | <p>상위 폴더의 id(default="UNSET")</p><p>ex)JC4Ub4EZo7</p> |
| title      | String | <p>폴더의 제목(default=None)</p><p>ex)강남구</p>              |

{% tabs %}
{% tab title="200: OK 폴더 수정 성공" %}

```json
{
    "status_code": 200,
    "message": "성공",
    "result": {
        "id": "HiBLQb9TyC",
        "user_id": "EabHTVpYYm",
        "title": "강남구",
        "parent_id": null,
        "created_at": "20231024_150645",
        "updated_at": "20231024_150645",
        "delete_at": "20240209_151705"
    }
}
```

{% endtab %}

{% tab title="400: Bad Request 폴더 수정 실패" %}

{% endtab %}
{% endtabs %}

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

```bash
curl --location --request PUT 'https://service-stage.pic-origin.com/api/v1/users/{user_id}/folders/{folder_id}' \
--header 'Authorization: User {YOUR_TOKEN}' \
--form 'parent_id={PARENT_ID}'
```

{% endtab %}
{% endtabs %}

## 특정 유저의 특정 폴더를 삭제합니다.

<mark style="color:red;">`DELETE`</mark> `https://service-stage.pic-origin.com/api/v1/users/{user_id}/folders/{folder_id}`

#### Path Parameters

| Name                                         | Type   | Description                          |
| -------------------------------------------- | ------ | ------------------------------------ |
| user\_id<mark style="color:red;">\*</mark>   | String | <p>유저의 id</p><p>ex)8BfE96V8Xc</p>    |
| folder\_id<mark style="color:red;">\*</mark> | String | <p>해당 폴더의 id</p><p>ex)JC4Ub4EZo7</p> |

#### Headers

| Name                                            | Type   | Description   |
| ----------------------------------------------- | ------ | ------------- |
| Authorization<mark style="color:red;">\*</mark> | String | User ${Token} |

{% tabs %}
{% tab title="200: OK 폴더 삭제 성공" %}

```json
{
  "status_code": 200,
  "message": "성공",
  "result": {
    "deleted_folders": [
      "FJiqmSDY5j",
      "GbBkh7cB6u"
    ],
    "deleted_images": []
  }
}
```

{% endtab %}

{% tab title="400: Bad Request 폴더 삭제 실패" %}

{% endtab %}
{% endtabs %}

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

```bash
curl --location --request DELETE 'https://service-stage.pic-origin.com/api/v1/users/{user_id}/folders/{folder_id}'' \
--header 'Authorization: User {YOUR_TOKEN}'
```

{% 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://docs.pic-origin.com/reference/api-reference/v1/user/folder.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.
