curl --request PUT \
--url https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}/app \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"html": "<string>",
"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 = {
"html": "<string>",
"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.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
html: '<string>',
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 => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'html' => '<string>',
'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 \"html\": \"<string>\",\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("PUT", 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.put("https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}/app")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"html\": \"<string>\",\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::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"html\": \"<string>\",\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>"
}Replace app content on a draft
This API is currently in development and may change.
Replace the app HTML on an existing draft. If the specified document does not yet have an app, one will be created.
curl --request PUT \
--url https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}/app \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"html": "<string>",
"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 = {
"html": "<string>",
"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.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
html: '<string>',
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 => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'html' => '<string>',
'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 \"html\": \"<string>\",\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("PUT", 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.put("https://{instance}.omniapp.co/api/v2/documents/{documentId}/draft/{draftId}/app")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"html\": \"<string>\",\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::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"html\": \"<string>\",\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
The complete app HTML document. Replaces the current HTML; capped at 2 MiB of UTF-8. maxLength counts characters — the byte cap is what the server enforces. Every write appends an immutable revision.
1 - 2097152When present, replaces the app settings; omitted fields take their locked-down defaults. When absent, the current settings are retained.
Show child attributes
Show child attributes
Response
App written on the draft.
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?

