Files

Rename, move, or restore a file

Discriminated payload: { name } to rename, { parentFolderId } to move (pass null for root, must be in the same surface), { restore: true } to un-archive a soft-deleted file. Rename keeps blobKey stable so deep-links never break. Restore + name in the same body is rejected.

patch/api/workspaces/{slug}/files/{fileId}

Request

  • Base URL
    https://trydock.ai
  • Auth
    HTTP bearer

Path parameters

slugstring required
fileIdstring required

Request body

namestring
parentFolderIdstring nullable
restoretrue

Response

Updated file

idstring required
namestring required
parentFolderIdstring nullable required
sizeinteger required

Bytes.

mimeTypestring required
thumbUrlstring nullable required

Server-generated 256-px webp URL. Null for non-raster files.

starredboolean
starredAtstring date-time nullable
descriptionstring nullable
tagsstring[]
exifobject nullable
createdAtstring date-time required
updatedAtstring date-time required

Example response

{
  "id": "cmpfile_…",
  "name": "hero.png",
  "mimeType": "image/png"
}

Changes

No recorded changes to this operation across all 2 revisions of this API.