Dokumentation
ReferenzDirectories

Move a directory.

POST
/directories/{directoryId}/relocation

Move this directory, with its subdirectories and documents, under another parent. Document ids stay the same. The directory and its subdirectories receive new ids when the subtree holds documents, because Galilea re-creates the tree at its new place; the answer carries the new id in directory. An integration that stored directory ids reads them again after a move.

This is the same operation the Galilea application performs when a folder is dragged elsewhere. It sits next to the rename as a resource of its own rather than inside it, because the move of a large folder is not atomic: documents are re-homed one by one, and the answer reports whether all of them made it. partialFailure lists the items left behind; repeating the call moves the rest.

Not movable: the tenant root, the personal directory of a user, and a directory into one of its own descendants.

Requires edit permission on the directory's current parent and on the destination.

Authorization

apiKey
headerX-API-Key<token>

API key issued in the Galilea settings.

Path Parameters

directoryId*string

The id of the directory to move, as returned by GET /directories.

Formatuuid

Request Body

application/json
  1. body

Request body of POST /directories/{directoryId}/relocation.

destination*string

The directory that becomes the new parent.

Formatuuid

Response Body

The relocation was carried out; result says how completely.

application/json
  1. response

Answer of POST /directories/{directoryId}/relocation. The move of a large folder re-homes its documents one by one, so the answer says how completely it went rather than only that it was accepted.

directory*string

The id of the moved directory at its new place; a new id when the subtree held documents.

Formatuuid
destination*string
Formatuuid
status*string
  • success: everything moved.
  • partialFailure: the directory moved, some items inside did not; failedItems names them. Repeating the call with the same body moves the rest.
  • failure: nothing moved.
Value in"success""partialFailure""failure"
failedItems?array<>

Present for partialFailure: the documents and subdirectories that stayed behind.

curl -X POST "https://example.com/directories/5491d698-d876-4e72-bceb-f6259c10ce9c/relocation" \  -H "Content-Type: application/json" \  -d '{    "destination": "e3695881-69e3-4482-898e-7bc34f6364db"  }'
{  "directory": "5277859d-f92c-478c-acab-7680a97fea68",  "destination": "5332a938-399a-405c-8866-445d97d52324",  "status": "success",  "failedItems": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "name": "string",      "path": [        "string"      ]    }  ]}