> For the complete documentation index, see [llms.txt](https://developers.couchdrop.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.couchdrop.io/filesystem-operations/managing-files.md).

# Listing files/folders

### List files and folders

Listing files and folder can be done using the LS method. This method returns a list of all objects in a folder.&#x20;

## /file/ls

<mark style="color:green;">`POST`</mark> `https://fileio.couchdrop.io/file/ls`

List files and directories in a given path

#### Headers

| Name  | Type   | Description      |
| ----- | ------ | ---------------- |
| token | string | API Access Token |

#### Request Body

| Name | Type   | Description |
| ---- | ------ | ----------- |
| path | string | Target Path |

{% tabs %}
{% tab title="200 A list of objects describing files and folders" %}

```
{
    "ls":[
        {
            "filename": "document1.txt",
            "size:": 10234,
            "modtime": 1578531065,
            "is_dir": false
        },
        {
            "filename": "folder1",
            "size:": 0,
            "modtime": 0,
            "is_dir": true
        }
    ]
}
```

{% endtab %}

{% tab title="403 " %}

```
{"error": "you do not have the right permissions"}
```

{% endtab %}

{% tab title="500 " %}

```
{"error": "we encountered an error"}
```

{% endtab %}
{% endtabs %}

#### Get file/folder details

You can use the LSTAT method to get details on an individual file or folder

## /file/lstat

<mark style="color:green;">`POST`</mark> `https://fileio.couchdrop.io/file/lstat`

Retrieve properties for a file or folder.&#x20;

#### Headers

| Name  | Type   | Description      |
| ----- | ------ | ---------------- |
| token | string | API Access Token |

#### Request Body

| Name | Type   | Description                    |
| ---- | ------ | ------------------------------ |
| path | string | Target path of file or folder. |

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

```
{
    "lstat": {
        "filename": "document1.txt",
        "size:": 10234,
        "modtime": 1578531065,
        "is_dir": false
    }
}
```

{% endtab %}
{% endtabs %}

&#x20;
