> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.lumenia.net/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.lumenia.net/_mcp/server.

# Move a document to another folder

PATCH https://app.lumenia.net/api/v1/organizations/{orgId}/documents/{documentId}
Content-Type: application/json

Move a document to another folder.

Reference: https://docs.lumenia.net/api-reference/documents/move-a-document-to-another-folder

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <API_KEY>`, where `API_KEY` is your API key.

## Request

### Path parameters

- `orgId` (string, required) — Organization that owns the document.
- `documentId` (string, required) — Document to move.

### Headers

- `X-Account-Id` (string, required) — Account that owns the organization.

### Body (application/json)

This endpoint expects an object.

- `folder` (string, required) — Destination folder. It must already exist.

## Response

### 200

The moved document. Moving it to its current folder returns the current document.

- `document` (V1OrganizationsOrgIdDocumentsDocumentIdPatchResponsesContentApplicationJsonSchemaDocument, required) — The document after the move, in the lean shape.

## Errors

### 400 Bad Request Error

Invalid folder name

- `any`

### 403 Forbidden Error

The API key is missing or invalid, or the X-Account-Id does not belong to the partner.

- `message` (string, optional)

### 404 Not Found Error

Organization, document, or destination folder not found

- `any`

### 409 Conflict Error

Document is embedded in a workspace and cannot be moved

- `any`

### 500 Internal Server Error

Internal Server Error

- `any`

## Types

### V1OrganizationsOrgIdDocumentsDocumentIdPatchResponsesContentApplicationJsonSchemaDocument

The document after the move, in the lean shape.

- `id` (string, optional) — The sole identifier for the document.
- `folder` (string, optional) — The folder the document now lives in.
- `title` (string, optional, nullable) — The document title, usually the original filename.
- `mimeType` (string, optional, nullable) — The MIME type of the source file.
- `wordCount` (integer, optional, nullable) — Word count of the extracted text.
- `tokenCountEstimate` (integer, optional, nullable) — Estimated token count of the extracted text.
- `watched` (boolean, optional) — Whether the document is watched for upstream changes.
- `createdAt` (string, optional, nullable) — ISO 8601 timestamp of the file at its new location.

## Examples

**Request**

```json
{
  "folder": "contracts"
}
```

**Response**

```json
{
  "document": {
    "id": "b927e9d2-ad7c-442b-9280-32b56d105629",
    "folder": "contracts",
    "title": "handbook.pdf",
    "mimeType": "application/pdf",
    "wordCount": 1280,
    "tokenCountEstimate": 1600,
    "watched": false,
    "createdAt": "2026-06-15T05:24:00.000Z"
  }
}
```

**SDK Code**

```python
import requests

url = "https://app.lumenia.net/api/v1/organizations/orgId/documents/documentId"

payload = { "folder": "contracts" }
headers = {
    "X-Account-Id": "X-Account-Id",
    "Authorization": "Bearer <API_KEY>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://app.lumenia.net/api/v1/organizations/orgId/documents/documentId';
const options = {
  method: 'PATCH',
  headers: {
    'X-Account-Id': 'X-Account-Id',
    Authorization: 'Bearer <API_KEY>',
    'Content-Type': 'application/json'
  },
  body: '{"folder":"contracts"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://app.lumenia.net/api/v1/organizations/orgId/documents/documentId"

	payload := strings.NewReader("{\n  \"folder\": \"contracts\"\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("X-Account-Id", "X-Account-Id")
	req.Header.Add("Authorization", "Bearer <API_KEY>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://app.lumenia.net/api/v1/organizations/orgId/documents/documentId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["X-Account-Id"] = 'X-Account-Id'
request["Authorization"] = 'Bearer <API_KEY>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"folder\": \"contracts\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://app.lumenia.net/api/v1/organizations/orgId/documents/documentId")
  .header("X-Account-Id", "X-Account-Id")
  .header("Authorization", "Bearer <API_KEY>")
  .header("Content-Type", "application/json")
  .body("{\n  \"folder\": \"contracts\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://app.lumenia.net/api/v1/organizations/orgId/documents/documentId', [
  'body' => '{
  "folder": "contracts"
}',
  'headers' => [
    'Authorization' => 'Bearer <API_KEY>',
    'Content-Type' => 'application/json',
    'X-Account-Id' => 'X-Account-Id',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://app.lumenia.net/api/v1/organizations/orgId/documents/documentId");
var request = new RestRequest(Method.PATCH);
request.AddHeader("X-Account-Id", "X-Account-Id");
request.AddHeader("Authorization", "Bearer <API_KEY>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"folder\": \"contracts\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-Account-Id": "X-Account-Id",
  "Authorization": "Bearer <API_KEY>",
  "Content-Type": "application/json"
]
let parameters = ["folder": "contracts"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://app.lumenia.net/api/v1/organizations/orgId/documents/documentId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```