Dokumentation
ReferenzDocuments

Rename or move a document.

PATCH
/documents/{documentId}

Change the name of a document, move it into another directory, or both. Nothing else about a document is written through this API: its content comes from the import, its state from processing. Properties other than name and directory in the body are ignored.

A move keeps the document's id and its index entry; only its place in the tree changes. The name must stay unique among the documents of the target directory, a taken name is a conflict. A document is renamed or moved only once its processing has finished, in state ready; before that the answer is 422.

Requires edit permission on the document's current directory and, for a move, on the target directory as well.

Authorization

apiKey
headerX-API-Key<token>

API key issued in the Galilea settings.

Path Parameters

documentId*string

The id of the document, as returned by GET /documents.

Formatuuid

Request Body

application/json
  1. body

Request body of PATCH /documents/{documentId}. At least one of the two properties must be present; a property that is absent stays as it is.

Properties1 <= properties
name?string

The new name. Must not contain / and must be unique among the documents of the target directory.

Lengthlength <= 255
directory?string

The directory to move the document into. The calling user needs edit permission there.

Formatuuid

Response Body

The changed document.

application/json
  1. response

One document as this API answers it, in the list and alone: what it is called, where it sits, where its processing stands and who created it. Nothing more. There is no content property and no file reference, and there will be neither in this API.

id*string
Formatuuid
name*string

The document name as shown in the Galilea application; for an upload, the file name without its extension.

directory*string

The directory the document is in.

Formatuuid
state*DocumentState

Processing state of a document.

  • processing: the document runs through parsing and indexing.
  • ready: the document was processed and can be used.
  • rejected: the document was not processed because the file or the available credits do not permit it; repeating the processing changes nothing until the cause is removed.
  • error: processing was attempted and failed; repeating it can succeed. For rejected and error, errorMessage carries the text Galilea recorded, if it recorded one.
Value in"processing""ready""rejected""error"
errorMessage?|

For rejected and error: the English text Galilea recorded for the case, written for support rather than for display. Not translated, not a stable code, and null when nothing was recorded; the API puts no substitute text in its place. Null in every other state.

createdAt*string
Formatdate-time
createdBy*

The user the document was created on behalf of; for an API upload, the user the key belongs to.

lastModifiedAt*string
Formatdate-time
curl -X PATCH "https://example.com/documents/0ea697ea-a714-4c30-a80c-00e4e45d1f60" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": "0ea697ea-a714-4c30-a80c-00e4e45d1f60",  "name": "esx-4cl-ag_08_connecting",  "directory": "5491d698-d876-4e72-bceb-f6259c10ce9c",  "state": "ready",  "errorMessage": null,  "createdAt": "2026-10-02T10:02:48Z",  "createdBy": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "Integration STW"  },  "lastModifiedAt": "2026-10-02T10:05:11Z"}