curl --request PATCH \
--url https://api.dock.us/{version}/workspace-iframe-embeds/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customCode": "<iframe src=\"https://example.com/embed\" width=\"100%\" height=\"400\"></iframe>",
"html": "<!doctype html><html><body><h1>Q3 Report</h1></body></html>"
}
'import requests
url = "https://api.dock.us/{version}/workspace-iframe-embeds/{id}"
payload = {
"customCode": "<iframe src=\"https://example.com/embed\" width=\"100%\" height=\"400\"></iframe>",
"html": "<!doctype html><html><body><h1>Q3 Report</h1></body></html>"
}
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({
customCode: '<iframe src="https://example.com/embed" width="100%" height="400"></iframe>',
html: '<!doctype html><html><body><h1>Q3 Report</h1></body></html>'
})
};
fetch('https://api.dock.us/{version}/workspace-iframe-embeds/{id}', 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://api.dock.us/{version}/workspace-iframe-embeds/{id}",
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([
'customCode' => '<iframe src="https://example.com/embed" width="100%" height="400"></iframe>',
'html' => '<!doctype html><html><body><h1>Q3 Report</h1></body></html>'
]),
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://api.dock.us/{version}/workspace-iframe-embeds/{id}"
payload := strings.NewReader("{\n \"customCode\": \"<iframe src=\\\"https://example.com/embed\\\" width=\\\"100%\\\" height=\\\"400\\\"></iframe>\",\n \"html\": \"<!doctype html><html><body><h1>Q3 Report</h1></body></html>\"\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://api.dock.us/{version}/workspace-iframe-embeds/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customCode\": \"<iframe src=\\\"https://example.com/embed\\\" width=\\\"100%\\\" height=\\\"400\\\"></iframe>\",\n \"html\": \"<!doctype html><html><body><h1>Q3 Report</h1></body></html>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dock.us/{version}/workspace-iframe-embeds/{id}")
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 \"customCode\": \"<iframe src=\\\"https://example.com/embed\\\" width=\\\"100%\\\" height=\\\"400\\\"></iframe>\",\n \"html\": \"<!doctype html><html><body><h1>Q3 Report</h1></body></html>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"workspaceIframeEmbed": {
"id": "RiHO4e0Ju3DS",
"updatedAt": "2021-01-01T00:00:00.000Z",
"createdAt": "2021-01-01T00:00:00.000Z",
"object": "workspace-iframe-embed",
"url": "https://api.dock.us/v1/workspace-iframe-embeds/RiHO4e0Ju3DS",
"customCode": "<iframe src=\"https://example.com/embed\" width=\"100%\" height=\"400\"></iframe>",
"thumbnailUrl": "https://cdn.dock.us/thumbnails/RiHO4e0Ju3DS.png",
"workspaceId": "RiHO4e0Ju3DS",
"templateIframeEmbedId": "RiHO4e0Ju3DS"
}
}
}{
"error": {
"code": "BAD_REQUEST",
"reason": "NOT_FOUND",
"message": "The request could not be understood or was missing required parameters",
"retryable": true,
"requestId": "6f1c2a9e-3b4d-4c5e-8f70-1a2b3c4d5e6f",
"docUrl": "<string>",
"details": [
{
"field": "body.shareSetting",
"message": "'shareSetting' is required in body"
}
]
}
}{
"error": {
"code": "INVALID_TOKEN",
"reason": "NOT_FOUND",
"message": "Access denied. You are not authorized to access this resource",
"retryable": true,
"requestId": "6f1c2a9e-3b4d-4c5e-8f70-1a2b3c4d5e6f",
"docUrl": "<string>"
}
}{
"error": {
"code": "FORBIDDEN",
"reason": "NOT_FOUND",
"message": "Access to this resource is restricted",
"retryable": true,
"requestId": "6f1c2a9e-3b4d-4c5e-8f70-1a2b3c4d5e6f",
"docUrl": "<string>"
}
}{
"error": {
"code": "NOT_FOUND",
"reason": "NOT_FOUND",
"message": "The requested resource could not be found",
"retryable": true,
"requestId": "6f1c2a9e-3b4d-4c5e-8f70-1a2b3c4d5e6f",
"docUrl": "<string>"
}
}{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"reason": "NOT_FOUND",
"message": "Rate limit exceeded. Please try again later",
"retryable": true,
"retryAfter": 2,
"requestId": "6f1c2a9e-3b4d-4c5e-8f70-1a2b3c4d5e6f",
"docUrl": "<string>"
}
}{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"reason": "NOT_FOUND",
"message": "The server has encountered a situation it does not know how to handle",
"retryable": true,
"requestId": "6f1c2a9e-3b4d-4c5e-8f70-1a2b3c4d5e6f",
"docUrl": "<string>"
}
}Update a workspace iframe embed
Update a workspace iframe embed by ID, from an embed snippet (JSON customCode), raw HTML (JSON html), or an HTML file sent as the request body (Content-Type: text/html). HTML input behaves exactly like the in-app Upload HTML button: full documents are wrapped in a sandboxed srcdoc iframe. Updates the embed code rendered in the workspace and directly in the published workspace view — no new publication is created and no publish side effects run. Returns 404 if the embed’s iframe is no longer placed in a section on an existing workspace page (unless it backs a task action).
curl --request PATCH \
--url https://api.dock.us/{version}/workspace-iframe-embeds/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customCode": "<iframe src=\"https://example.com/embed\" width=\"100%\" height=\"400\"></iframe>",
"html": "<!doctype html><html><body><h1>Q3 Report</h1></body></html>"
}
'import requests
url = "https://api.dock.us/{version}/workspace-iframe-embeds/{id}"
payload = {
"customCode": "<iframe src=\"https://example.com/embed\" width=\"100%\" height=\"400\"></iframe>",
"html": "<!doctype html><html><body><h1>Q3 Report</h1></body></html>"
}
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({
customCode: '<iframe src="https://example.com/embed" width="100%" height="400"></iframe>',
html: '<!doctype html><html><body><h1>Q3 Report</h1></body></html>'
})
};
fetch('https://api.dock.us/{version}/workspace-iframe-embeds/{id}', 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://api.dock.us/{version}/workspace-iframe-embeds/{id}",
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([
'customCode' => '<iframe src="https://example.com/embed" width="100%" height="400"></iframe>',
'html' => '<!doctype html><html><body><h1>Q3 Report</h1></body></html>'
]),
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://api.dock.us/{version}/workspace-iframe-embeds/{id}"
payload := strings.NewReader("{\n \"customCode\": \"<iframe src=\\\"https://example.com/embed\\\" width=\\\"100%\\\" height=\\\"400\\\"></iframe>\",\n \"html\": \"<!doctype html><html><body><h1>Q3 Report</h1></body></html>\"\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://api.dock.us/{version}/workspace-iframe-embeds/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customCode\": \"<iframe src=\\\"https://example.com/embed\\\" width=\\\"100%\\\" height=\\\"400\\\"></iframe>\",\n \"html\": \"<!doctype html><html><body><h1>Q3 Report</h1></body></html>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dock.us/{version}/workspace-iframe-embeds/{id}")
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 \"customCode\": \"<iframe src=\\\"https://example.com/embed\\\" width=\\\"100%\\\" height=\\\"400\\\"></iframe>\",\n \"html\": \"<!doctype html><html><body><h1>Q3 Report</h1></body></html>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"workspaceIframeEmbed": {
"id": "RiHO4e0Ju3DS",
"updatedAt": "2021-01-01T00:00:00.000Z",
"createdAt": "2021-01-01T00:00:00.000Z",
"object": "workspace-iframe-embed",
"url": "https://api.dock.us/v1/workspace-iframe-embeds/RiHO4e0Ju3DS",
"customCode": "<iframe src=\"https://example.com/embed\" width=\"100%\" height=\"400\"></iframe>",
"thumbnailUrl": "https://cdn.dock.us/thumbnails/RiHO4e0Ju3DS.png",
"workspaceId": "RiHO4e0Ju3DS",
"templateIframeEmbedId": "RiHO4e0Ju3DS"
}
}
}{
"error": {
"code": "BAD_REQUEST",
"reason": "NOT_FOUND",
"message": "The request could not be understood or was missing required parameters",
"retryable": true,
"requestId": "6f1c2a9e-3b4d-4c5e-8f70-1a2b3c4d5e6f",
"docUrl": "<string>",
"details": [
{
"field": "body.shareSetting",
"message": "'shareSetting' is required in body"
}
]
}
}{
"error": {
"code": "INVALID_TOKEN",
"reason": "NOT_FOUND",
"message": "Access denied. You are not authorized to access this resource",
"retryable": true,
"requestId": "6f1c2a9e-3b4d-4c5e-8f70-1a2b3c4d5e6f",
"docUrl": "<string>"
}
}{
"error": {
"code": "FORBIDDEN",
"reason": "NOT_FOUND",
"message": "Access to this resource is restricted",
"retryable": true,
"requestId": "6f1c2a9e-3b4d-4c5e-8f70-1a2b3c4d5e6f",
"docUrl": "<string>"
}
}{
"error": {
"code": "NOT_FOUND",
"reason": "NOT_FOUND",
"message": "The requested resource could not be found",
"retryable": true,
"requestId": "6f1c2a9e-3b4d-4c5e-8f70-1a2b3c4d5e6f",
"docUrl": "<string>"
}
}{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"reason": "NOT_FOUND",
"message": "Rate limit exceeded. Please try again later",
"retryable": true,
"retryAfter": 2,
"requestId": "6f1c2a9e-3b4d-4c5e-8f70-1a2b3c4d5e6f",
"docUrl": "<string>"
}
}{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"reason": "NOT_FOUND",
"message": "The server has encountered a situation it does not know how to handle",
"retryable": true,
"requestId": "6f1c2a9e-3b4d-4c5e-8f70-1a2b3c4d5e6f",
"docUrl": "<string>"
}
}Authorizations
Query Parameters
Body
Provide exactly one of customCode or html.
Raw HTML for the embed — the API equivalent of the in-app Upload HTML button. The markup is structurally validated (400 on broken markup, with line/column), and a full HTML document (<!doctype html>, <html>, <head> or <body>) is wrapped in a sandboxed srcdoc iframe before being stored as the embed code; fragments are stored as-is. Max 1MB. Provide exactly one of customCode or html.
1048576"<!doctype html><html><body><h1>Q3 Report</h1></body></html>"