Skip to main content
PATCH
Rename, move, or protect a file

Authorizations

Authorization
string
header
required

Workspace-scoped API key, sent as a bearer token. The recommended header. The workspace is implicit in the key and never appears in a URL.

Path Parameters

id
string
required

The file id, as an earlier response reported it. Always doc_…; a composite id is refused.

Example:

"doc_9f2k1x8b3m7q0v"

Body

application/json

Rename the file in place. The id and the folder do not change.

name
string
required

New file name, including its extension. Renames the file in place. Send instead of parentId, never with it.

Example:

"returns.md"

Response

The file after the change. Its id is the one you sent to.

object
enum<string>
required

Type discriminator. Always file.

Available options:
file
id
string
required

Stable id. Survives a rename or a move.

Example:

"doc_9f2k1x8b3m7q0v"

path
string
required

Live file location. Changes when the file moves.

Example:

"/support/policies/refunds.md"

name
string
required

Leaf name, including its extension, without any part of the path.

Example:

"refunds.md"

parentId
string | null
required

The containing folder, or null when the file sits at the root. Send it back to move a file.

Example:

"dir_4k1n8p2v5m7q0x"

parentPath
string
required

Path of the containing folder. / at the root.

Example:

"/support/policies"

protected
boolean
required

When true, a change to this file goes to review instead of being accepted automatically.

lastChangeId
string
required

The last content change to this file. A rename or a move does not advance it. Pass it back as baseChangeId on a write.

Example:

"chg_7t4p2w9c1n6s8k"

createdAt
string<date-time>
required

When the file was created.

Example:

"2026-07-01T09:12:00.000Z"

updatedAt
string<date-time>
required

When the file last changed, including a rename or a move.

Example:

"2026-08-01T14:03:00.000Z"