# Create Analytics Folder

Make a folder in your Analytics sidebar, at the top of Pages, Reports or Shared with me, or inside another folder.

`POST https://connect.mindcloud.co/v2/analytics/folders`

Permissions: `analytics:page:edit`.

## Parameters

### Headers

- `X-Company-Id` (string): Optional. The id of the organization to act in. Leave it out to act in the API key's own organization. Here a key acts in another organization only as one of its members: with "Use this key across all of your organizations" on, in an organization its creator belongs to with a role. Child organizations and MindCloud staff access do not reach this endpoint. Every response's X-Company-Id header names the organization it acted in. See [Organizations](https://mindcloud.co/docs/api/rest/introduction/organizations).

### Body

- `name` (string, required): The folder name.
  The folder name, 1 to 255 characters.
- `section` (string): pages (the default), reports, or sharedWithMe. A subfolder goes where its parent is.
  Which section the folder goes in: pages (the default), reports, or sharedWithMe. Ignored with parentFolderId, where the folder goes where its parent is.
  Allowed values:
    - `pages`: Holds your own pages (the default).
    - `reports`: Holds your own reports.
    - `sharedWithMe`: Organizes pages other people shared with you.
- `parentFolderId` (string): The id of a folder to put this one inside, from List Analytics Folders.
  A folder to create this one inside, from List Analytics Folders.

## Example request

```bash
curl --request POST \
  --url 'https://connect.mindcloud.co/v2/analytics/folders' \
  --header 'Authorization: Bearer $MINDCLOUD_API_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "Q3 board pages",
  "section": "pages",
  "parentFolderId": "Fd4Kq8Wm2PzR"
}'
```

## Response fields

- `id` (string): Unique id of the folder.
- `position` (number): Its place in the sidebar, from 0: sort by it to read the folders in the order the sidebar shows them.
- `name` (string): The folder name, as the Analytics sidebar shows it.
- `section` (string): Which part of the sidebar the folder is in: pages and reports hold your own pages and reports; sharedWithMe organizes pages other people shared with you.
  Allowed values:
    - `pages`
    - `reports`
    - `sharedWithMe`
- `parentFolderId` (string): The folder this one is inside (from List Analytics Folders), or null at the top of its section.
- `themeId` (string): The theme every page in the folder wears unless the page picks its own: a theme id from List Analytics Themes, "cirra" for the plain Cirra look, or null to follow the organization default.
- `isPaused` (boolean): Whether the folder is paused: its pages stop refreshing their data until it is resumed.
- `pausedOn` (date): When the folder was paused, or null.
- `hasShares` (boolean): Whether the folder is shared with anyone (List Analytics Folder Shares).
- `createdOn` (date): When the folder was created.
- `updatedOn` (date): When the folder was last changed.

## Errors

- 404 Parent folder not found (ANALYTICS_FOLDER_PARENT_NOT_FOUND): `NOT_FOUND` "The destination group or folder was not found."
