---
title: "Rename and/or move a file or folder"
method: PATCH
path: "/client/files/{nodeId}"
tags: ["Files"]
---

# Rename and/or move a file or folder

`PATCH /client/files/{nodeId}`

## Request

- Base URL: `https://api.atako.ai`
- URL: `https://api.atako.ai/client/files/{nodeId}`
- Auth: HTTP bearer

`parentId: null` moves the node back to the drive root; an absent `parentId` leaves the parent alone. At least one of `name`/`parentId` is required. Only the author or a company admin (`manageCompanyFiles`) may change a node.

## Path parameters

- `nodeId` string, required

## Request body

- object
  - `name` string
  - `parentId` string, uuid, nullable: Destination folder, or null for the drive root.

## Response `200`

- FileNode
  - `id` string, uuid, required
  - `clientId` string, uuid, required
  - `parentId` string, uuid, nullable
  - `type` 'folder' | 'file', required
  - `name` string, required
  - `storagePath` string, nullable
  - `mimeType` string, nullable
  - `fileSize` integer, nullable
  - `agentTag` string, uuid, nullable
  - `uploadSource` 'client' | 'agent', nullable
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time

## Other responses

- `400`: Nothing to change, destination is a file, or a folder would be moved inside its own subtree.
- `401`: Missing, malformed, or invalid bearer token / API key, or revoked session (SESSION_REVOKED).
- `403`: Not the author, and not a company admin.
- `404`: Not found, or the caller is not authorized to access this resource.

---

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