> 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/mutations/criando-pastas.md).

# Creating folders

### Creating a folder

The *mutation* to create a folder in the authenticated user’s account (owner of the API token) is:

```graphql
mutation CreateFolderMutation($parentId: UUID, $folder: FolderInput!) {
  createFolder(parent_id: $parentId, folder: $folder) {
    id
    name
    type
    created_at
    parentFolder {
      id
      name
    }
  }
}
```

Define the variable values:

```json
{
  "parentId": "abc123",
  "folder": {
    "name": "Signed document"
  }
}
```

The field `parentId` is optional. If omitted, the folder will be created at the root level. To create a subfolder, provide the UUID of its parent folder.

{% hint style="info" %}
If you want to create a document inside a folder, use the **`folder_id`** attribute when [creating the document.](/api/mutations/criando-um-documento.md)\
If your goal is to add an existing document to another folder that has already been created, see how to [**move a document to a folder**](/api/mutations/movendo-documento-para-pasta.md).
{% endhint %}

{% hint style="warning" %}
Each parent folder can contain up to five subfolders. Attempts to create additional subfolders will result in \
a validation error.
{% endhint %}

### Renaming a folder

Use `updateFolder` to rename an existing folder.

```graphql
mutation UpdateFolder($id: UUID!, $folder: FolderInput!) {
  updateFolder(id: $id, folder: $folder) {
    id
    name
    path
    updated_at
  }
}
```

Variables.

```json
{
  "id": "FOLDER_UUID",
  "folder": {
    "name": "Finished contracts"
  }
}
```

{% 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 %}

{% file src="/files/-M03o9cE5QB3vLoPUlzJ" %}
Para importar e usar no Postman
{% endfile %}
