---
title: "Folders Endpoint"
description: "Details about the Folders endpoint for Disguise Cloud"
url: https://developer.disguise.one/cloud/drive/folders/
---

# Folders

-   [Endpoints](#endpoints)
-   [Response Structure](#response-structure)
-   [Response Example](#response-example)
    -   [Success](#success)
    -   [Errors](#errors)
-   [Query Parameters](#query-parameters)
-   [Query Example](#query-example)

The `/folders` endpoint of the Disguise Cloud Drive API returns information about all folders within a drive, regardless of their position in the directory. A folder represents a directory within a drive that can contain files and other folders.

This endpoint is useful for generating the full directory structure of a drive, as it includes all folders and their parent folders.

## Endpoints

`GET https://drive-api.disguise.cloud/v1/drives/{{drive_id}}/folders`

Retrieve a list of all folders for the specified drive.

## Response Structure

The responses from the `/folders` endpoint include the following fields:

| Field | Type | Description |
| --- | --- | --- |
| **id** | string | The unique identifier of the folder. |
| **parent\_id** | string | The unique identifier of the parent folder. |
| **name** | string | The name of the folder. |

## Response Example

```bash
curl -X GET https://drive-api.disguise.cloud/v1/drives/{{drive_id}}/folders \
-H "Authorization: Token YOUR_API_TOKEN"
```

### Success

A successful response will return a `200 OK` status code and the following JSON:

Please note this example excludes the pagination wrapper around the response. Please refer to the [pagination documentation](/cloud/pagination) for more information.

```json
[
  {
    "id": "f4df841d-eab3-4636-8448-81cde7543d1e",
    "parent_id": "1cb5e233-908b-4799-80d7-943b86d3916c",
    "name": "My Files"
  },
  {
    "id": "c71df693-d1ff-461d-9da6-b9f1ee9c6748",
    "parent_id": "f4df841d-eab3-4636-8448-81cde7543d1e",
    "name": "My Sub Folder"
  }
]
```

## Errors

If the drive is not found, the API will return a `404 Not Found` status code and the following JSON:

```json
{
  "error": {
    "message": "Drive not found",
    "details": "Drive not found"
  }
}
```

When searching for folders, and no results are found, the response will return a `404 Not Found` status code and the following JSON:

```json
{
  "error": {
    "message": "No folders found",
    "details": "No folders found"
  }
}
```

## Query Parameters

The following query parameters can be used with the `/folders` endpoint for **GET** requests:

| Parameter | Type | Description |
| --- | --- | --- |
| **name** | string | Filter by folder name. Will preform a case and whitespace insensitive substring search. |

## Query Example

Below is an example of making a **GET** request to the `/folders` endpoint to search for all folders with the name “My Folder”:

```bash
curl -X GET https://api.disguise.cloud/v1/drives/{{drive_id}}/folders?name=my%20folder \
-H "Authorization: Token YOUR_API_TOKEN"
```
