curl --request PATCH \
--url https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"queryPresentations": {
"data": {
"2": {
"type": "query",
"name": "Revenue by month",
"subTitle": "Trailing 12 months",
"topicName": "order_items",
"query": {
"fields": [
"order_items.created_at[month]",
"order_items.sale_price_sum"
]
}
}
}
}
}
'import requests
url = "https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}"
payload = { "queryPresentations": { "data": { "2": {
"type": "query",
"name": "Revenue by month",
"subTitle": "Trailing 12 months",
"topicName": "order_items",
"query": { "fields": ["order_items.created_at[month]", "order_items.sale_price_sum"] }
} } } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
queryPresentations: {
data: {
'2': {
type: 'query',
name: 'Revenue by month',
subTitle: 'Trailing 12 months',
topicName: 'order_items',
query: {fields: ['order_items.created_at[month]', 'order_items.sale_price_sum']}
}
}
}
})
};
fetch('https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'queryPresentations' => [
'data' => [
'2' => [
'type' => 'query',
'name' => 'Revenue by month',
'subTitle' => 'Trailing 12 months',
'topicName' => 'order_items',
'query' => [
'fields' => [
'order_items.created_at[month]',
'order_items.sale_price_sum'
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}"
payload := strings.NewReader("{\n \"queryPresentations\": {\n \"data\": {\n \"2\": {\n \"type\": \"query\",\n \"name\": \"Revenue by month\",\n \"subTitle\": \"Trailing 12 months\",\n \"topicName\": \"order_items\",\n \"query\": {\n \"fields\": [\n \"order_items.created_at[month]\",\n \"order_items.sale_price_sum\"\n ]\n }\n }\n }\n }\n}")
req, _ := http.NewRequest("PATCH", 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))
}HttpResponse<String> response = Unirest.patch("https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"queryPresentations\": {\n \"data\": {\n \"2\": {\n \"type\": \"query\",\n \"name\": \"Revenue by month\",\n \"subTitle\": \"Trailing 12 months\",\n \"topicName\": \"order_items\",\n \"query\": {\n \"fields\": [\n \"order_items.created_at[month]\",\n \"order_items.sale_price_sum\"\n ]\n }\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"queryPresentations\": {\n \"data\": {\n \"2\": {\n \"type\": \"query\",\n \"name\": \"Revenue by month\",\n \"subTitle\": \"Trailing 12 months\",\n \"topicName\": \"order_items\",\n \"query\": {\n \"fields\": [\n \"order_items.created_at[month]\",\n \"order_items.sale_price_sum\"\n ]\n }\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"identifier": "def456",
"draftIdentifier": "abc123",
"name": "Blob Sales",
"description": "Overview of daily Blobs R Us Sales"
}{
"error": "<response_code>",
"message": "<error_reason>"
}{
"error": "<response_code>",
"message": "<error_reason>"
}{
"error": "<response_code>",
"message": "<error_reason>"
}{
"error": "<response_code>",
"message": "<error_reason>"
}{
"error": "<response_code>",
"message": "<error_reason>"
}{
"error": "<response_code>",
"message": "<error_reason>"
}{
"error": "<response_code>",
"message": "<error_reason>"
}Patch draft
Apply a patch to an existing draft. Pure apply — no draft creation, no publish. The request body, content sections, field caps, and tile-addressing rules are identical to Create draft and patch document; this route does not accept branchId.
curl --request PATCH \
--url https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"queryPresentations": {
"data": {
"2": {
"type": "query",
"name": "Revenue by month",
"subTitle": "Trailing 12 months",
"topicName": "order_items",
"query": {
"fields": [
"order_items.created_at[month]",
"order_items.sale_price_sum"
]
}
}
}
}
}
'import requests
url = "https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}"
payload = { "queryPresentations": { "data": { "2": {
"type": "query",
"name": "Revenue by month",
"subTitle": "Trailing 12 months",
"topicName": "order_items",
"query": { "fields": ["order_items.created_at[month]", "order_items.sale_price_sum"] }
} } } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
queryPresentations: {
data: {
'2': {
type: 'query',
name: 'Revenue by month',
subTitle: 'Trailing 12 months',
topicName: 'order_items',
query: {fields: ['order_items.created_at[month]', 'order_items.sale_price_sum']}
}
}
}
})
};
fetch('https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'queryPresentations' => [
'data' => [
'2' => [
'type' => 'query',
'name' => 'Revenue by month',
'subTitle' => 'Trailing 12 months',
'topicName' => 'order_items',
'query' => [
'fields' => [
'order_items.created_at[month]',
'order_items.sale_price_sum'
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}"
payload := strings.NewReader("{\n \"queryPresentations\": {\n \"data\": {\n \"2\": {\n \"type\": \"query\",\n \"name\": \"Revenue by month\",\n \"subTitle\": \"Trailing 12 months\",\n \"topicName\": \"order_items\",\n \"query\": {\n \"fields\": [\n \"order_items.created_at[month]\",\n \"order_items.sale_price_sum\"\n ]\n }\n }\n }\n }\n}")
req, _ := http.NewRequest("PATCH", 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))
}HttpResponse<String> response = Unirest.patch("https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"queryPresentations\": {\n \"data\": {\n \"2\": {\n \"type\": \"query\",\n \"name\": \"Revenue by month\",\n \"subTitle\": \"Trailing 12 months\",\n \"topicName\": \"order_items\",\n \"query\": {\n \"fields\": [\n \"order_items.created_at[month]\",\n \"order_items.sale_price_sum\"\n ]\n }\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"queryPresentations\": {\n \"data\": {\n \"2\": {\n \"type\": \"query\",\n \"name\": \"Revenue by month\",\n \"subTitle\": \"Trailing 12 months\",\n \"topicName\": \"order_items\",\n \"query\": {\n \"fields\": [\n \"order_items.created_at[month]\",\n \"order_items.sale_price_sum\"\n ]\n }\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"identifier": "def456",
"draftIdentifier": "abc123",
"name": "Blob Sales",
"description": "Overview of daily Blobs R Us Sales"
}{
"error": "<response_code>",
"message": "<error_reason>"
}{
"error": "<response_code>",
"message": "<error_reason>"
}{
"error": "<response_code>",
"message": "<error_reason>"
}{
"error": "<response_code>",
"message": "<error_reason>"
}{
"error": "<response_code>",
"message": "<error_reason>"
}{
"error": "<response_code>",
"message": "<error_reason>"
}{
"error": "<response_code>",
"message": "<error_reason>"
}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.
The draft workbook identifier the patch is applied to.
Body
The content/metadata diff applied to a draft. All fields optional — only the sections present are changed.
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.
Show child attributes
Show child attributes
Dashboard filters/controls keyed by control ID.
Show child attributes
Show child attributes
Document settings. Shallow-merged with the existing settings.
Show child attributes
Show child attributes
Container layout. When present, fully replaces the existing layout.
Response
Patch applied to draft 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"
Was this page helpful?

