---
title: "Get folders"
method: GET
path: "/folder"
tags: ["Folder"]
---

# Get folders

`GET /folder`

## Request

- Base URL: `https://api.speakai.co/v1`
- URL: `https://api.speakai.co/v1/folder`
- Auth: API key in header `x-speakai-key` and API key in header `x-access-token`

## Get Folders

This endpoint retrieves a list of folders based on pagination and sorting criteria.

### Request Parameters

- **page** (integer, required): The page number to retrieve. This parameter is used for pagination.

- **pageSize** (integer, required): The number of folders to return per page. This parameter controls the size of the result set.

- **sortBy** (string, required): The field by which to sort the folders. In this case, it is sorted by `createdAt`.


### Response Format

The response will contain the following structure:

- **status** (string): The status of the request.

- **data** (object): Contains the details of the folders retrieved.

 - **totalCount** (integer): The total number of folders available.

 - **pages** (integer or null): The total number of pages available based on the pagination.

 - **folders** (array): An array of folder objects, each containing:

 - **_id** (string): The unique identifier for the folder.

 - **defaultAssignTo** (string): The default user assigned to the folder.

 - **showOrder** (integer): The order in which the folder should be displayed.

 - **name** (string): The name of the folder.

 - **folderId** (string): The identifier for the folder.

 - **createdAt** (string): The creation date of the folder.

 - **updatedAt** (string): The last updated date of the folder.

 - **user** (object): An object representing the user associated with the folder.

 - **_id** (string): The unique identifier for the user.

 - **firstName** (string): The first name of the user.

 - **lastName** (string): The last name of the user.

 - **userId** (string): The identifier for the user associated with the folder.


### Notes

- Ensure that the `page` and `pageSize` parameters are set correctly to retrieve the desired set of folders.

- The response may return an empty array if no folders are available for the specified page and size.

## Query parameters

- `page` integer
- `pageSize` integer
- `sortBy` string
- `from` string
- `to` string

## Response `200`

OK

- object
  - `status` string
  - `data` object
    - `totalCount` integer
    - `pages` string, nullable
    - `folders` object[]
      - `_id` string
      - `defaultAssignTo` string
      - `showOrder` integer
      - `name` string
      - `folderId` string
      - `createdAt` string, date-time
      - `updatedAt` string, date-time
      - `user` object
        - `_id` string
        - `firstName` string
        - `lastName` string
      - `userId` string

---

[API](https://skmtc.dev/speakai/apis/speak-ai-api.md) · [All operations](https://skmtc.dev/speakai/apis/speak-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/speakai/apis/speak-ai-api/revisions/52d777e6d46e?raw)
