Skip to main content
Folders organize the sources of a project. A folder is a /-separated path such as Contracts/2026; every source is either in one folder or at the top level of the project. The endpoints on this page list, create, rename, remove and delete folders, and move sources between them. Folders also appear on other endpoints:
Folders are available on the REST API today. In the SDKs they land in the next releases: Python graphor 0.28.0, TypeScript graphor 0.25.0 and the MCP package graphor-mcp 0.25.0. The folder methods, parameters and response fields shown for the SDKs need those versions or later; the hosted remote MCP server offers the folder tools once it runs graphor-mcp 0.25.0.

Endpoints

List folders

GET https://sources.graphorlm.com/foldersEvery folder of the project, sorted

Create a folder

POST https://sources.graphorlm.com/create-folderA folder that stays listed while it is empty

Rename or move a folder

POST https://sources.graphorlm.com/rename-folderRename a folder, or move it under another folder

Remove a folder

POST https://sources.graphorlm.com/remove-folderRemove a folder and move its content into the folder above it

Delete an empty folder

POST https://sources.graphorlm.com/delete-folderDelete a folder that holds no source

Move sources

POST https://sources.graphorlm.com/move-sourcesMove up to 1,000 sources to a folder or to the top level

Authentication

All endpoints on this page require authentication using an API token. Include your API token as a Bearer token in the Authorization header. Every call acts on the project of the token.
Learn how to create and manage API tokens in the API Tokens guide.

How folders work

  • A folder exists while it holds a source, while an upload into it is on its way, or after it was created with Create a folder (an empty folder stays listed until you delete it). Creating a folder also creates the folders above it.
  • No folder has to exist first. An upload, a link ingest or a move into a path that does not exist creates it.
  • File names stay unique per project, whatever the folder. A second README.md uploaded into another folder is stored as README (1).md (see Ingest file).
  • Every response returns the normalized path. Sending " /Contracts/2026/ " stores and returns Contracts/2026.
  • Paths are compared exactly: Contracts and contracts are two folders.
  • Changes made through the API show in the Graphor dashboard, and open dashboard tabs refresh.

Folder paths

A folder path is a list of names separated by /. Before it is checked, spaces and slashes at both ends of the path are removed, and spaces at both ends of each name too: " Contracts / 2026 " is Contracts/2026. The path is then refused with request.invalid when:
  • it has more than 8 levels, or a name longer than 100 characters, or the whole path is longer than 512 bytes (UTF-8);
  • a name is empty (Contracts//2026), . or ..;
  • it contains a backslash (\), a control or invisible formatting character (a tab, a newline, a zero-width character), or a line or paragraph separator.
Other Unicode spaces, such as a no-break space, are kept as part of the name. A comma is an ordinary character: Smith, Jones/2026 is one folder named Smith, Jones with a subfolder 2026.

The top level

The top level is the project itself, not a folder. A value made only of spaces (U+0020) and slashes ("", "/", " ", "//") means the top level everywhere. An omitted value, or null, means “not given”. Other whitespace is not stripped: a tab is refused as an invalid character, and a no-break space is a folder name. In responses, the top level is always the empty string "".

List folders

Returns every folder of the project: folders created empty, folders that hold sources and folders that uploads are on their way to, each with the folders above it, sorted.

Endpoint overview

HTTP Method

GET

Success response (200 OK)

Code examples

Errors


Create a folder

Creates a folder, and the folders above it, that stays listed while it is empty. Safe to repeat: created is false when the folder already existed.

Endpoint overview

Request body (JSON)

Success response (200 OK)

Code example

Errors


Rename or move a folder

Renames a folder, or moves it under another folder, with everything in it: its sources and its subfolders. Contracts/2026 renamed to Archive/2026 moves the folder and its content under Archive (created if needed).
Not safe to repeat blindly. After a 503, a timeout or a lost response, the change may have been saved, and a repeated call would answer 404 folder.not_found. List the folders before repeating. See Repeating a call.

Endpoint overview

Request body (JSON)

Success response (200 OK)

Code example

Errors


Remove a folder

Removes a folder and moves its sources and subfolders into the folder above it (the top level for a top-level folder). Removing Contracts/2026 moves its sources into Contracts. To delete a folder only when it is empty, use Delete an empty folder.
Not safe to repeat blindly. List the folders before repeating. See Repeating a call.

Endpoint overview

Request body (JSON)

Success response (200 OK)

Code example

Errors


Delete an empty folder

Deletes a folder that holds no source, together with the empty folders below it. Move or delete its sources first (Move sources, Delete source).
Not safe to repeat blindly. List the folders before repeating. See Repeating a call.

Endpoint overview

Request body (JSON)

Success response (200 OK)

Code example

Errors


Move sources

Moves up to 1,000 sources to a folder, or to the top level with "" or "/". A folder that does not exist is created. Ids that match no source of the project come back in not_found. Safe to repeat.

Endpoint overview

Request body (JSON)

Success response (200 OK)

Code examples

Errors


Error codes

A refusal has a JSON body with a human-readable detail and a stable code. Use code in your program; the detail text can change.
A 5xx answer may also carry a reference to quote to support. A JSON body that fails validation (a missing field, a wrong type, too many ids, an invalid folder path in a folder endpoint or a link ingest) answers 422 with code: "request.invalid" and a detail list describing each problem. A folders refusal on ask, extract or retrieve (an invalid or top-level entry, or folders with file_names) answers 422 request.invalid with a string detail. An invalid folder on List sources (422), Ingest file or an upload session (400) has a detail that starts with Invalid folder:.

Retry headers

  • Every folder 409 carries x-should-retry: false: repeating the same request gives the same answer.
  • A 503 carries Retry-After: 30. On List folders, Create a folder and Move sources it also carries x-should-retry: true; on rename, remove and delete it carries x-should-retry: false, because the change may have been saved.

Repeating a call

Rename, remove and delete can answer 503, time out, or lose their response after the change was saved. Before repeating one of them, list the folders and check whether the change is already there. Only a 404 whose code is folder.not_found can mean that an earlier call worked. A 404 without a code ({"detail": "Not Found"}) means the API you are calling does not offer the folder endpoints.

Checking that a folder was applied

The API echoes every folder filter and scope it applies, so a caller can tell that the folder was used: A response without its echo comes from an API that did not apply the folder (for example a deployment without folder support): do not act on it as if it were scoped. A long ask or extract can also fail after it started streaming; that failure arrives as a 200 body with detail, code, status_code, retryable and retry_after instead of an answer, so check for status_code before reading folders. The SDKs do these checks for you and raise FolderScopeNotAppliedError (see SDK folders).

Limits

Uploads into a new folder are never refused because of the folder count.

Next steps

SDK folders

The same operations in the Python and TypeScript SDKs

List sources

List the sources of a folder

Ingest sources

Store new sources in a folder

Chat API

Ask questions about the sources of a folder