Create draft and patch document
Create a new draft on the published document and apply the patch. There is no auto-publish — the response includes the new draftIdentifier for follow-up calls. Pass an optional branchId to attach the draft to a branch; omit it for a draft on the main (unpublished) workspace.
Draft and publish workflow
Editing an existing document is a three-step flow:PATCH /api/v2/documents/{documentId}/draft(this endpoint) — creates a new draft on the published document and applies your patch. Returns the newdraftIdentifier.- (optional)
PATCH /api/v2/documents/{documentId}/draft/{draftId}— apply further patches to that draft. POST /api/v2/documents/{documentId}/draft/publish— publish the main draft live.
409 — patch the existing draft (step 2) or publish/discard it first. This replaces v1’s clearExistingDraft flag, which does not exist in v2.
A GET response is a valid PATCH body — read the current state, edit it, and submit it back verbatim.
Addressing tiles (no miniUuid)
Tiles are addressed by their record key in queryPresentations.data (e.g. "2"). The server owns internal tile identity, so you never send or manage miniUuid:
- New key → a new tile is created.
- Existing key, identical content (a verbatim round-trip of a
GET) → treated as a no-op and dropped from the patch. - Existing key, changed content → the tile is updated (the server regenerates its internal identifier).
linked-type tabs always re-resolve — they are excluded from no-op detection.- Query presentations are immutable server-side: replace a tile by key, don’t mutate it in place.
model_extension_id- The query-model binding. This is read-only and managed by Omni.
data is shallow-merged by key — omitted keys are untouched; data.{key}: null deletes that tile. order, when present, replaces the tab order. controls and settings are likewise shallow-merged; containers, when present, fully replaces the layout.
AI summaries via linked tiles
There is nonarrative field. To attach an AI-style summary that reuses another tile’s query, add a linked-type query presentation whose sourceQueryPresentationKey points at the source tile’s record key (a string such as "2" — not a positional index into order):
Binding an upload as a Source tab
To bind an existing upload (created via POST /v1/uploads) as a document Source tab:GET /api/v2/documents/{documentId}to read the document’sworkbookModelIdPOST /api/v1/uploadswithmodelIdset to the draft’s workbook model (the connection decides warehouse staging vs S3-only)PATCH /api/v2/documents/{documentId}/draft(this endpoint) with acsvorspreadsheettab whosefileUploadIdis the upload ID returned in step 2POST /api/v2/documents/{documentId}/draft/publishto publish
fileUploadId on an existing tab key repoints the tab at a different upload, regenerating the tab with the new upload’s data. The same endpoints for creating documents and patching existing drafts accept fileUploadId on csv / spreadsheet tabs.Authorizations
Can be either an Organization API Key or Personal Access Token (PAT).
Include in the Authorization header as: Bearer YOUR_TOKEN
Path Parameters
The published document's URL slug (e.g. abc123) or its canonical workbook UUID.
Body
The draft-route patch body plus an optional branchId selecting the branch the new draft is attached to.
Branch the draft is created on. Omit for a draft on the main (unpublished) workspace.
Immutable model identifier. Must match the document's current base model or the API will return a 400 error.
Immutable model identifier. Must match the document's current workbook model or the API will return a 400 error.
Document name.
1 - 254Document description.
Caller-supplied description of what this patch changes, written to the history audit trail. When omitted, Omni auto-generates one from the updated sections.
1 - 255Query presentations (tabs/tiles) keyed by record key.
Dashboard filters/controls keyed by control ID.
Document settings. Shallow-merged with the existing settings.
Container layout. When present, fully replaces the existing layout.
Currently read-only. Will be used in future releases.
Response
Draft created and patch applied successfully.
Published document identifier the draft targets.
"def456"
Identifier of the draft the patch was applied to.
"abc123"
Document name.
"Blob Sales"
Document description.
"Overview of daily Blobs R Us Sales"

