---
title: "Create a folder"
method: POST
path: "/matters/{matterId}/documents/folders"
tags: ["Folders"]
---

# Create a folder

`POST /matters/{matterId}/documents/folders`

## Request

- Base URL: `https://api.smokeball.com`
- URL: `https://api.smokeball.com/matters/{matterId}/documents/folders`
- Auth: API key in header `x-api-key` and API key in header `Authorization`

Creates a new folder under the specified matter.
            
When `parentFolderId` is null or omitted the folder is created under the matter root.

## Path parameters

- `matterId` string, required

## Request body

- FolderDto
  - `name` string, required: Name of the folder. Required; must not be empty or whitespace. Maximum 256 characters.
  - `parentFolderId` string, nullable: Unique identifier of the parent folder. Must be a valid GUID when supplied. Null or omitted means the matter root: on create the folder is created under the root, on PUT the folder is moved to the root. The parent folder is not validated for existence.
  - `userId` string, nullable: Unique identifier of the user modifying the folder. Must be a valid GUID when supplied. If null it will fallback to the authenticated user.

## Response `202`

When request is accepted. Returns a hypermedia 'Link' object of the folder to be created.

- Link
  - `id` string, nullable
  - `href` string, nullable
  - `relation` string, nullable
  - `method` string, nullable

## Other responses

- `400`: When folder name is not provided or is whitespace, exceeds 256 characters, or a supplied id (`matterId`, `parentFolderId`, `userId`) is not a valid GUID.

---

[API](https://skmtc.dev/smokeball/apis/smokeball-api.md) - [All operations](https://skmtc.dev/smokeball/apis/smokeball-api/llms.txt) - [OpenAPI document](https://skmtc.dev/smokeball/apis/smokeball-api/revisions/6e350cf667d4?raw)
