curl --request PATCH \
--url https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/app \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"htmlEdits": [
{
"replace": "<string>",
"search": "<string>",
"replaceAll": true
}
],
"settings": {
"allowClipboard": false,
"allowDefaultMapProviders": false,
"allowDownloads": false,
"allowExternalNavigation": false,
"allowFullscreen": false,
"allowInternalNavigation": false,
"externalNavOpensInNewTab": true,
"navAllowedDomains": [],
"navAllowedDomainsEnabled": false,
"safeDomains": [],
"safeDomainsEnabled": false
}
}
'import requests
url = "https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/app"
payload = {
"htmlEdits": [
{
"replace": "<string>",
"search": "<string>",
"replaceAll": True
}
],
"settings": {
"allowClipboard": False,
"allowDefaultMapProviders": False,
"allowDownloads": False,
"allowExternalNavigation": False,
"allowFullscreen": False,
"allowInternalNavigation": False,
"externalNavOpensInNewTab": True,
"navAllowedDomains": [],
"navAllowedDomainsEnabled": False,
"safeDomains": [],
"safeDomainsEnabled": False
}
}
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({
htmlEdits: [{replace: '<string>', search: '<string>', replaceAll: true}],
settings: {
allowClipboard: false,
allowDefaultMapProviders: false,
allowDownloads: false,
allowExternalNavigation: false,
allowFullscreen: false,
allowInternalNavigation: false,
externalNavOpensInNewTab: true,
navAllowedDomains: [],
navAllowedDomainsEnabled: false,
safeDomains: [],
safeDomainsEnabled: false
}
})
};
fetch('https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/app', 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/app",
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([
'htmlEdits' => [
[
'replace' => '<string>',
'search' => '<string>',
'replaceAll' => true
]
],
'settings' => [
'allowClipboard' => false,
'allowDefaultMapProviders' => false,
'allowDownloads' => false,
'allowExternalNavigation' => false,
'allowFullscreen' => false,
'allowInternalNavigation' => false,
'externalNavOpensInNewTab' => true,
'navAllowedDomains' => [
],
'navAllowedDomainsEnabled' => false,
'safeDomains' => [
],
'safeDomainsEnabled' => false
]
]),
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/app"
payload := strings.NewReader("{\n \"htmlEdits\": [\n {\n \"replace\": \"<string>\",\n \"search\": \"<string>\",\n \"replaceAll\": true\n }\n ],\n \"settings\": {\n \"allowClipboard\": false,\n \"allowDefaultMapProviders\": false,\n \"allowDownloads\": false,\n \"allowExternalNavigation\": false,\n \"allowFullscreen\": false,\n \"allowInternalNavigation\": false,\n \"externalNavOpensInNewTab\": true,\n \"navAllowedDomains\": [],\n \"navAllowedDomainsEnabled\": false,\n \"safeDomains\": [],\n \"safeDomainsEnabled\": false\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/app")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"htmlEdits\": [\n {\n \"replace\": \"<string>\",\n \"search\": \"<string>\",\n \"replaceAll\": true\n }\n ],\n \"settings\": {\n \"allowClipboard\": false,\n \"allowDefaultMapProviders\": false,\n \"allowDownloads\": false,\n \"allowExternalNavigation\": false,\n \"allowFullscreen\": false,\n \"allowInternalNavigation\": false,\n \"externalNavOpensInNewTab\": true,\n \"navAllowedDomains\": [],\n \"navAllowedDomainsEnabled\": false,\n \"safeDomains\": [],\n \"safeDomainsEnabled\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/app")
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 \"htmlEdits\": [\n {\n \"replace\": \"<string>\",\n \"search\": \"<string>\",\n \"replaceAll\": true\n }\n ],\n \"settings\": {\n \"allowClipboard\": false,\n \"allowDefaultMapProviders\": false,\n \"allowDownloads\": false,\n \"allowExternalNavigation\": false,\n \"allowFullscreen\": false,\n \"allowInternalNavigation\": false,\n \"externalNavOpensInNewTab\": true,\n \"navAllowedDomains\": [],\n \"navAllowedDomainsEnabled\": false,\n \"safeDomains\": [],\n \"safeDomainsEnabled\": false\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",
"app": {
"settings": {
"allowClipboard": false,
"allowDefaultMapProviders": false,
"allowDownloads": false,
"allowExternalNavigation": false,
"allowFullscreen": false,
"allowInternalNavigation": false,
"externalNavOpensInNewTab": true,
"navAllowedDomains": [],
"navAllowedDomainsEnabled": false,
"safeDomains": [],
"safeDomainsEnabled": false
}
},
"warnings": [
"<string>"
]
}{
"detail": "<string>",
"status": 400
}{
"detail": "Unauthorized: Missing or invalid API key",
"status": 401
}{
"detail": "<string>",
"status": 403
}{
"detail": "<string>",
"status": 404
}{
"error": "<response_code>",
"message": "<error_reason>"
}{
"error": "<response_code>",
"message": "<error_reason>"
}{
"error": "<response_code>",
"message": "<error_reason>"
}Create/reuse draft and edit app content
This API is currently in development and may change.
Create or reuse an existing document’s main draft and apply targeted edits to the app’s HTML without resending the whole document.
curl --request PATCH \
--url https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/app \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"htmlEdits": [
{
"replace": "<string>",
"search": "<string>",
"replaceAll": true
}
],
"settings": {
"allowClipboard": false,
"allowDefaultMapProviders": false,
"allowDownloads": false,
"allowExternalNavigation": false,
"allowFullscreen": false,
"allowInternalNavigation": false,
"externalNavOpensInNewTab": true,
"navAllowedDomains": [],
"navAllowedDomainsEnabled": false,
"safeDomains": [],
"safeDomainsEnabled": false
}
}
'import requests
url = "https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/app"
payload = {
"htmlEdits": [
{
"replace": "<string>",
"search": "<string>",
"replaceAll": True
}
],
"settings": {
"allowClipboard": False,
"allowDefaultMapProviders": False,
"allowDownloads": False,
"allowExternalNavigation": False,
"allowFullscreen": False,
"allowInternalNavigation": False,
"externalNavOpensInNewTab": True,
"navAllowedDomains": [],
"navAllowedDomainsEnabled": False,
"safeDomains": [],
"safeDomainsEnabled": False
}
}
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({
htmlEdits: [{replace: '<string>', search: '<string>', replaceAll: true}],
settings: {
allowClipboard: false,
allowDefaultMapProviders: false,
allowDownloads: false,
allowExternalNavigation: false,
allowFullscreen: false,
allowInternalNavigation: false,
externalNavOpensInNewTab: true,
navAllowedDomains: [],
navAllowedDomainsEnabled: false,
safeDomains: [],
safeDomainsEnabled: false
}
})
};
fetch('https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/app', 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/app",
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([
'htmlEdits' => [
[
'replace' => '<string>',
'search' => '<string>',
'replaceAll' => true
]
],
'settings' => [
'allowClipboard' => false,
'allowDefaultMapProviders' => false,
'allowDownloads' => false,
'allowExternalNavigation' => false,
'allowFullscreen' => false,
'allowInternalNavigation' => false,
'externalNavOpensInNewTab' => true,
'navAllowedDomains' => [
],
'navAllowedDomainsEnabled' => false,
'safeDomains' => [
],
'safeDomainsEnabled' => false
]
]),
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/app"
payload := strings.NewReader("{\n \"htmlEdits\": [\n {\n \"replace\": \"<string>\",\n \"search\": \"<string>\",\n \"replaceAll\": true\n }\n ],\n \"settings\": {\n \"allowClipboard\": false,\n \"allowDefaultMapProviders\": false,\n \"allowDownloads\": false,\n \"allowExternalNavigation\": false,\n \"allowFullscreen\": false,\n \"allowInternalNavigation\": false,\n \"externalNavOpensInNewTab\": true,\n \"navAllowedDomains\": [],\n \"navAllowedDomainsEnabled\": false,\n \"safeDomains\": [],\n \"safeDomainsEnabled\": false\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/app")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"htmlEdits\": [\n {\n \"replace\": \"<string>\",\n \"search\": \"<string>\",\n \"replaceAll\": true\n }\n ],\n \"settings\": {\n \"allowClipboard\": false,\n \"allowDefaultMapProviders\": false,\n \"allowDownloads\": false,\n \"allowExternalNavigation\": false,\n \"allowFullscreen\": false,\n \"allowInternalNavigation\": false,\n \"externalNavOpensInNewTab\": true,\n \"navAllowedDomains\": [],\n \"navAllowedDomainsEnabled\": false,\n \"safeDomains\": [],\n \"safeDomainsEnabled\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/app")
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 \"htmlEdits\": [\n {\n \"replace\": \"<string>\",\n \"search\": \"<string>\",\n \"replaceAll\": true\n }\n ],\n \"settings\": {\n \"allowClipboard\": false,\n \"allowDefaultMapProviders\": false,\n \"allowDownloads\": false,\n \"allowExternalNavigation\": false,\n \"allowFullscreen\": false,\n \"allowInternalNavigation\": false,\n \"externalNavOpensInNewTab\": true,\n \"navAllowedDomains\": [],\n \"navAllowedDomainsEnabled\": false,\n \"safeDomains\": [],\n \"safeDomainsEnabled\": false\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",
"app": {
"settings": {
"allowClipboard": false,
"allowDefaultMapProviders": false,
"allowDownloads": false,
"allowExternalNavigation": false,
"allowFullscreen": false,
"allowInternalNavigation": false,
"externalNavOpensInNewTab": true,
"navAllowedDomains": [],
"navAllowedDomainsEnabled": false,
"safeDomains": [],
"safeDomainsEnabled": false
}
},
"warnings": [
"<string>"
]
}{
"detail": "<string>",
"status": 400
}{
"detail": "Unauthorized: Missing or invalid API key",
"status": 401
}{
"detail": "<string>",
"status": 403
}{
"detail": "<string>",
"status": 404
}{
"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
Document identifier — either the URL slug (e.g. abc123) or the canonical workbook UUID.
"abc123"
Query Parameters
Organization API key required. The membership ID of the user to act as.
Body
- Option 1
- Option 2
Targeted edits applied in order against the current HTML. A failed edit (not found, ambiguous, or result over the 2 MiB cap) rejects the entire request with 400 naming the edit. At most 20 edits per request.
1 - 20 elementsShow child attributes
Show child attributes
When present, replaces the app settings; omitted fields take their locked-down defaults. When absent, the current settings are kept.
Show child attributes
Show child attributes
Response
Draft created or reused and edits applied. Use the draftIdentifier in the response to call the Publish draft API and publish the changes.
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"
Show child attributes
Show child attributes
Included only when non-blocking warnings are encountered when creating/updating an app. Currently, external resource hosts the app's iframe CSP will block until an Organization Admin allows them. The write itself succeeded.
Was this page helpful?

