Skip to main content
PUT
Replace a draft's body

Authorizations

Authorization
string
header
required

Workspace credential issued from the automation console at /automation. Send it as Authorization: Bearer vq_ws_.... This is NOT a Data API key: a vq_key_ credential is refused here and names the other product in the error.

Path Parameters

matterId
string
required

mat_ identifier of the matter to work inside. Everything in this API hangs off a matter, and the matter in the path is what the authorization boundary is checked against. Take it from GET /v1/matters.

draftId
string
required

drf_ identifier of the draft. Take it from the matter's draft list.

Body

application/json

Replace a draft's body, and optionally its title and lifecycle status.

A PUT rather than a PATCH because contentMarkdown is the whole body: a partial body is not a thing this format can express, and pretending otherwise would invite a caller to send one paragraph and lose the rest. Title and status are left alone when omitted, which is what makes a body-only edit possible without restating metadata the caller did not read.

expectedVersion is how a headless read-modify-write avoids a lost update. Omitting it means "overwrite whatever is there", which is a legitimate thing to want and a bad default to impose.

contentMarkdown
string
required

The COMPLETE new body as markdown. This replaces the whole document: a partial body is not something this format can express, so sending one paragraph loses the rest. Whitespace alone is refused.

Required string length: 1 - 500000
Example:

"# Mutual Non-Disclosure Agreement\n\n## 1. Confidential Information\n\nEach party may disclose information that is confidential and proprietary to the other party.\n"

title
string | null

New title. Omit to leave the title alone.

Required string length: 1 - 200
Example:

"Master Services Agreement"

status
enum<string> | null

New document lifecycle status: draft, review, final or archived. Omit to leave it alone.

Available options:
draft,
review,
final,
archived
Example:

"draft"

changeSummary
string | null

Why this change was made. Recorded on the version snapshot the replace creates, so it shows up in the version list later.

Maximum string length: 500
Example:

"Tightened the indemnity carve-outs after counsel review."

expectedVersion
integer | null

The version you read before editing. Supply it so a concurrent write is refused rather than silently overwritten. Omitting it means 'overwrite whatever is there'.

Required range: x >= 1
Example:

1

Response

Successful Response

One draft with its body, section by section.

id
string
required

Public identifier, drf_ followed by 32 hex characters.

Example:

"drf_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6"

title
string
required

The draft's title.

Example:

"Master Services Agreement"

category
string
required

What kind of document this is, as a category slug.

Example:

"commercial"

practiceArea
string
required

Practice area the draft sits in.

Example:

"commercial"

status
string
required

Where the DOCUMENT is in its own lifecycle: draft, review, final or archived. Set by you. This is not the same as generationStatus.

Example:

"draft"

source
string
required

How the draft came to exist: generated by the pipeline, uploaded from a file, imported from editor content, or analysis where an analysis produced it.

Example:

"generated"

version
integer
required

Current version number, counting from 1. Pass it as expectedVersion on a replace to avoid a lost update.

Example:

3

generationStatus
enum<string>
required

Where the JOB that produced this draft got to, in the five public statuses. Set only by the pipeline. A draft the pipeline never touched reads succeeded.

Available options:
queued,
running,
succeeded,
failed,
cancelled
Example:

"succeeded"

createdAt
string<date-time>
required

When the draft was created (RFC 3339).

Example:

"2026-08-19T14:32:10Z"

updatedAt
string<date-time>
required

When the draft was last modified (RFC 3339).

Example:

"2026-08-19T14:32:10Z"

sections
DraftSection · object[]
required

The draft body, section by section. Send edits back as contentMarkdown; request bytes from the export route.

matterId
string | null

mat_ identifier of the matter this draft belongs to, when it belongs to one.

Example:

"mat_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6"

governingLawState
string | null

The governing law pinned on the draft, for example ca or federal.

Example:

"ca"

Last modified on August 23, 2026