# Move files from one directory (folder) to another
Source: https://docs.file.ai/api-reference/folders/move-files-from-one-directory-folder-to-another

> Move files out of the source directory (path parameter) into `targetDirectoryId`, in one call.

post /prod/v1/directories/{directoryId}/documents/move

Move files out of the source directory (path parameter) into `targetDirectoryId`, in one call.

Each file ends up attached to the target and no longer attached to the source. Other directories the file belongs to are untouched.

**Path Parameters:**
- `directoryId` (required): The source directory the files are currently in

**Request Body:**
- `fileIds` (string[], required): Ids of files to move. At least 1, at most 100. Repeated ids are collapsed.
- `targetDirectoryId` (string, required): The directory to move the files into. Must differ from the source.

**Response:**
Every id you send is returned in exactly one of three arrays:
- `moved`: left the source and is now in the target
- `conflicted`: was already in the target; detached from the source, so it now belongs to the target only. The pre-existing target row is kept as it is — any workflow step marker on the source row is not carried over.
- `notAttached`: not attached to the source when the request ran; nothing was done

**Notes:**
- The endpoint is safe to retry. A second identical call reports every id as `notAttached`.
- Both directories must be visible to the API key. An unknown source is a 404 `Directory not found.`; an unknown target is a 404 `Target directory not found.`
- If either directory has a workflow, or is the immediate subfolder of one, the request is rejected with a 422. Advancing a workflow on move is not supported yet.
- A file that is a workflow result in the source directory is rejected with a 422 naming the file ids; nothing in the request is moved.
- Ids are echoed back in canonical lowercase form regardless of the case you send.
