curl --request POST \
--url https://api.vaquill.ai/workspace/v1/matters/{matterId}/drafts/from-document \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"documentId": "doc_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6"
}
'import requests
url = "https://api.vaquill.ai/workspace/v1/matters/{matterId}/drafts/from-document"
payload = { "documentId": "doc_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({documentId: 'doc_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6'})
};
fetch('https://api.vaquill.ai/workspace/v1/matters/{matterId}/drafts/from-document', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vaquill.ai/workspace/v1/matters/{matterId}/drafts/from-document"
payload := strings.NewReader("{\n \"documentId\": \"doc_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "drf_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6",
"matterId": "mat_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6",
"title": "Master Services Agreement",
"category": "commercial",
"practiceArea": "commercial",
"status": "draft",
"source": "generated",
"version": 3,
"generationStatus": "succeeded",
"governingLawState": "ca",
"createdAt": "2026-08-19T14:32:10Z",
"updatedAt": "2026-08-19T14:32:10Z",
"sections": [
{
"heading": "8. Limitation of Liability",
"level": 1,
"text": "Neither party shall be liable for indirect or consequential damages."
}
]
}{
"type": "https://vaquill.ai/docs/workspace-api/errors/insufficient-scope",
"title": "Insufficient scope",
"status": 403,
"detail": "This credential carries matters:read. This operation needs matters:write.",
"instance": "/workspace/v1/matters/mat_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6",
"requestId": "req_5f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6"
}{
"type": "https://vaquill.ai/docs/workspace-api/errors/insufficient-scope",
"title": "Insufficient scope",
"status": 403,
"detail": "This credential carries matters:read. This operation needs matters:write.",
"instance": "/workspace/v1/matters/mat_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6",
"requestId": "req_5f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6"
}{
"type": "https://vaquill.ai/docs/workspace-api/errors/insufficient-scope",
"title": "Insufficient scope",
"status": 403,
"detail": "This credential carries matters:read. This operation needs matters:write.",
"instance": "/workspace/v1/matters/mat_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6",
"requestId": "req_5f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6"
}{
"type": "https://vaquill.ai/docs/workspace-api/errors/insufficient-scope",
"title": "Insufficient scope",
"status": 403,
"detail": "This credential carries matters:read. This operation needs matters:write.",
"instance": "/workspace/v1/matters/mat_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6",
"errors": [
{
"location": "<string>",
"message": "<string>",
"type": "<string>"
}
],
"requestId": "req_5f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6"
}{
"type": "https://vaquill.ai/docs/workspace-api/errors/insufficient-scope",
"title": "Insufficient scope",
"status": 403,
"detail": "This credential carries matters:read. This operation needs matters:write.",
"instance": "/workspace/v1/matters/mat_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6",
"requestId": "req_5f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6"
}{
"type": "https://vaquill.ai/docs/workspace-api/errors/insufficient-scope",
"title": "Insufficient scope",
"status": 403,
"detail": "This credential carries matters:read. This operation needs matters:write.",
"instance": "/workspace/v1/matters/mat_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6",
"requestId": "req_5f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6"
}{
"type": "https://vaquill.ai/docs/workspace-api/errors/insufficient-scope",
"title": "Insufficient scope",
"status": 403,
"detail": "This credential carries matters:read. This operation needs matters:write.",
"instance": "/workspace/v1/matters/mat_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6",
"requestId": "req_5f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6"
}Create a draft from an uploaded document
Turn a document in this matter into an editable draft.
Upload the file first through uploads.initiate, then name the documentId
the completed upload produced. The ORIGINAL file is converted, not the text
the ingest pipeline extracted for retrieval: that text is chunk-shaped and
has already lost the headings a contract is navigated by.
201 with the draft rather than 202 with an operation, because no model
runs. This is a format conversion.
A .docx keeps its headings, lists and tables. .txt and .md are
converted paragraph by paragraph. Anything else is refused rather than
degraded.
curl --request POST \
--url https://api.vaquill.ai/workspace/v1/matters/{matterId}/drafts/from-document \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"documentId": "doc_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6"
}
'import requests
url = "https://api.vaquill.ai/workspace/v1/matters/{matterId}/drafts/from-document"
payload = { "documentId": "doc_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({documentId: 'doc_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6'})
};
fetch('https://api.vaquill.ai/workspace/v1/matters/{matterId}/drafts/from-document', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vaquill.ai/workspace/v1/matters/{matterId}/drafts/from-document"
payload := strings.NewReader("{\n \"documentId\": \"doc_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "drf_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6",
"matterId": "mat_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6",
"title": "Master Services Agreement",
"category": "commercial",
"practiceArea": "commercial",
"status": "draft",
"source": "generated",
"version": 3,
"generationStatus": "succeeded",
"governingLawState": "ca",
"createdAt": "2026-08-19T14:32:10Z",
"updatedAt": "2026-08-19T14:32:10Z",
"sections": [
{
"heading": "8. Limitation of Liability",
"level": 1,
"text": "Neither party shall be liable for indirect or consequential damages."
}
]
}{
"type": "https://vaquill.ai/docs/workspace-api/errors/insufficient-scope",
"title": "Insufficient scope",
"status": 403,
"detail": "This credential carries matters:read. This operation needs matters:write.",
"instance": "/workspace/v1/matters/mat_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6",
"requestId": "req_5f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6"
}{
"type": "https://vaquill.ai/docs/workspace-api/errors/insufficient-scope",
"title": "Insufficient scope",
"status": 403,
"detail": "This credential carries matters:read. This operation needs matters:write.",
"instance": "/workspace/v1/matters/mat_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6",
"requestId": "req_5f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6"
}{
"type": "https://vaquill.ai/docs/workspace-api/errors/insufficient-scope",
"title": "Insufficient scope",
"status": 403,
"detail": "This credential carries matters:read. This operation needs matters:write.",
"instance": "/workspace/v1/matters/mat_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6",
"requestId": "req_5f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6"
}{
"type": "https://vaquill.ai/docs/workspace-api/errors/insufficient-scope",
"title": "Insufficient scope",
"status": 403,
"detail": "This credential carries matters:read. This operation needs matters:write.",
"instance": "/workspace/v1/matters/mat_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6",
"errors": [
{
"location": "<string>",
"message": "<string>",
"type": "<string>"
}
],
"requestId": "req_5f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6"
}{
"type": "https://vaquill.ai/docs/workspace-api/errors/insufficient-scope",
"title": "Insufficient scope",
"status": 403,
"detail": "This credential carries matters:read. This operation needs matters:write.",
"instance": "/workspace/v1/matters/mat_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6",
"requestId": "req_5f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6"
}{
"type": "https://vaquill.ai/docs/workspace-api/errors/insufficient-scope",
"title": "Insufficient scope",
"status": 403,
"detail": "This credential carries matters:read. This operation needs matters:write.",
"instance": "/workspace/v1/matters/mat_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6",
"requestId": "req_5f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6"
}{
"type": "https://vaquill.ai/docs/workspace-api/errors/insufficient-scope",
"title": "Insufficient scope",
"status": 403,
"detail": "This credential carries matters:read. This operation needs matters:write.",
"instance": "/workspace/v1/matters/mat_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6",
"requestId": "req_5f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6"
}Authorizations
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
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.
Body
Turn a document you already uploaded into an editable draft.
Takes a documentId rather than a file, for the reason every other file on
this surface does: bytes reach this API through uploads.initiate and the
presigned part PUTs, so there is one media allowlist, one size ceiling and
one answer to encryption at rest.
The ORIGINAL file is what gets converted, not the text the ingest pipeline extracted for retrieval. That text is chunk-shaped and has already lost the headings a contract is navigated by.
No AI runs. This is a format conversion, so it answers 201 with the draft
rather than 202 with an operation.
doc_ identifier of a document in this matter to convert into a draft.
"doc_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6"
Title for the draft. Defaults to the document's filename.
1 - 200"Master Services Agreement"
What kind of document this is, as a category slug from draftCategories.list. Defaults to custom, which is always accepted.
1 - 64"commercial"
Response
Successful Response
One draft with its body, section by section.
Public identifier, drf_ followed by 32 hex characters.
"drf_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6"
The draft's title.
"Master Services Agreement"
What kind of document this is, as a category slug.
"commercial"
Practice area the draft sits in.
"commercial"
Where the DOCUMENT is in its own lifecycle: draft, review, final or archived. Set by you. This is not the same as generationStatus.
"draft"
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.
"generated"
Current version number, counting from 1. Pass it as expectedVersion on a replace to avoid a lost update.
3
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.
queued, running, succeeded, failed, cancelled "succeeded"
When the draft was created (RFC 3339).
"2026-08-19T14:32:10Z"
When the draft was last modified (RFC 3339).
"2026-08-19T14:32:10Z"
The draft body, section by section. Send edits back as contentMarkdown; request bytes from the export route.
Show child attributes
Show child attributes
mat_ identifier of the matter this draft belongs to, when it belongs to one.
"mat_9f2c8b1e4a7d43c9b6e0f1a2c3d4e5f6"
The governing law pinned on the draft, for example ca or federal.
"ca"
Was this page helpful?

