> For the complete documentation index, see [llms.txt](https://docs.autentique.com.br/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.autentique.com.br/api/queries/listing-folders.md).

# Listing Folders

Use the `folders` query to retrieve the available folders. Results are paginated and may include each folder’s subfolders.

```graphql
query ListFolders(
  $limit: Int!
  $page: Int!
  $displayChildren: Boolean!
  $search: String
  $orderBy: OrderBy
) {
  folders(
    limit: $limit
    page: $page
    display_children: $displayChildren
    search: $search
    orderBy: $orderBy
  ) {
    data {
      id
      name
      path
      context
      children_counter
      is_editor
      created_at
      updated_at
      subfolders {
        id
        name
        path
      }
    }
    total
    current_page
    last_page
    has_more_pages
  }
}  
```

Variables:

```json
{
  "limit": 20,
  "page": 1,
  "displayChildren": true,
  "search": null,
  "orderBy": {
    "field": "created_at",
    "direction": "DESC"
  }
}
```

The `display_children` parameter determines whether subfolders are included with each folder. Setting it to `false` may be useful when you only need the top-level folder list.

| Parameters         | Type             | Description                                                     |
| ------------------ | ---------------- | --------------------------------------------------------------- |
| `display_children` | `Boolean!`       | Determines whether subfolders are included. Defaults to `true`. |
| `limit`            | `Int!`           | Number of folders returned per page.                            |
| `page`             | `Int!`           | Page to retrieve                                                |
| `type`             | `FolderTypeEnum` | Filters folders by type                                         |
| `search`           | `String`         | Searches for a folder by name                                   |
| `orderBy`          | `OrderBy`        | Specifies the field and the direction to sort by                |

### Searching for a folder

Use the `folder` query when you already have the folder ID and want to retrieve its details.&#x20;

```graphql
query GetFolder($id: UUID!) {
  folder(id: $id) {
    id
    name
    path
    context
    children_counter
    is_editor
    has_password
    parentFolder {
      id
      name
    }
    subfolders {
      id
      name
      path
    }
    shares {
      id
      role
      is_by_link
      user {
        id
        name
        email
      }
      group {
        id
        name
      }
    }
    created_at
    updated_at
  }
}
```

Variables:

```json
  "documentId": "UUID_OF_THE_DOCUMENT"
```

{% hint style="info" %}
You can check what each of these parameters means directly in the full GraphQL API documentation, in the Docs menu of [Altair](https://altair.autentique.com.br/). If you're not sure how to do that, check out our tutorial on [**Using Altair**](/api/integration-basics/altair.md).
{% endhint %}

{% hint style="info" %}
If Altair doesn't help you integrate with the API, check out some examples of how to make these requests in other ways: <https://graphql.org/graphql-js/graphql-clients/>
{% endhint %}
