curl --request PATCH \
--url https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}/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,
"allowInternalNavigation": false,
"externalNavOpensInNewTab": true,
"navAllowedDomains": [],
"navAllowedDomainsEnabled": false,
"safeDomains": [],
"safeDomainsEnabled": false
}
}
'import requests
url = "https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}/app"
payload = {
"htmlEdits": [
{
"replace": "<string>",
"search": "<string>",
"replaceAll": True
}
],
"settings": {
"allowClipboard": False,
"allowDefaultMapProviders": False,
"allowDownloads": False,
"allowExternalNavigation": 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,
allowInternalNavigation: false,
externalNavOpensInNewTab: true,
navAllowedDomains: [],
navAllowedDomainsEnabled: false,
safeDomains: [],
safeDomainsEnabled: false
}
})
};
fetch('https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}/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/{draftId}/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,
'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/{draftId}/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 \"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/{draftId}/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 \"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/{draftId}/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 \"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,
"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>"
}{
"detail": "<string>",
"status": 409
}{
"error": "<response_code>",
"message": "<error_reason>"
}Edit app content on a draft
This API is currently in development and may change.
Apply targeted changes to an existing app on an existing draft without resending the HTML. Changes are all or nothing — an edit that matches zero times, matches more than once without replaceAll, or would push the HTML past the 2 MiB cap rejects the whole request with 400 naming the edit, and nothing is applied. This endpoint does not create an app.
Use the draftIdentifier in the response to call the Publish draft API and publish the changes.
curl --request PATCH \
--url https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}/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,
"allowInternalNavigation": false,
"externalNavOpensInNewTab": true,
"navAllowedDomains": [],
"navAllowedDomainsEnabled": false,
"safeDomains": [],
"safeDomainsEnabled": false
}
}
'import requests
url = "https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}/app"
payload = {
"htmlEdits": [
{
"replace": "<string>",
"search": "<string>",
"replaceAll": True
}
],
"settings": {
"allowClipboard": False,
"allowDefaultMapProviders": False,
"allowDownloads": False,
"allowExternalNavigation": 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,
allowInternalNavigation: false,
externalNavOpensInNewTab: true,
navAllowedDomains: [],
navAllowedDomainsEnabled: false,
safeDomains: [],
safeDomainsEnabled: false
}
})
};
fetch('https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}/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/{draftId}/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,
'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/{draftId}/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 \"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/{draftId}/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 \"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/{draftId}/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 \"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,
"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>"
}{
"detail": "<string>",
"status": 409
}{
"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
Draft workbook identifier. Use List document drafts to retrieve draft IDs.
"def456"
Published document identifier.
"abc123"
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
Edits applied on the draft. warnings names any resource hosts the app’s iframe CSP will block until an Organization Admin allows them.
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. 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?

