Skip to main content
PUT
Replace a file's content

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
baseChangeId
string
required

The file's last content change when this edit started. Send the lastChangeId returned when you read the file.

Example:

"chg_7t4p2w9c1n6s8k"

content
string
required

The full new file content. It replaces the live content.

Maximum string length: 51200
Example:

"# Refunds\n\nRefunds are processed within 14 days."

Response

Accepted. The edit is in the live files.

object
enum<string>
required

Type discriminator. Always edit.

Available options:
edit
file
object
required

The file at its new state. lastChangeId has advanced.

content
string
required

The content now in the live files. Not always the content that was sent: an edit based on an older change is combined with the changes accepted since. Adopt this before editing the file again.

Example:

"# Refunds\n\nRefunds are processed within 14 days."