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",
"message": "The request could not be understood or was missing required parameters"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Access denied. You are not authorized to access this resource"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Access to this resource is restricted"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "The requested resource could not be found"
}
}{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. Please try again later"
}
}{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "The server has encountered a situation it does not know how to handle"
}
}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",
"message": "The request could not be understood or was missing required parameters"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Access denied. You are not authorized to access this resource"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Access to this resource is restricted"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "The requested resource could not be found"
}
}{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. Please try again later"
}
}{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "The server has encountered a situation it does not know how to handle"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique identifier
"RiHO4e0Ju3DS"
Query Parameters
Select the workspace iframe embed properties that should be returned
customCode, thumbnailUrl, workspaceId, templateIframeEmbedId, createdAt, updatedAt Body
Provide exactly one of customCode or html.
An already-formed embed snippet (iframe HTML), stored verbatim. Provide exactly one of customCode or html.
200000"<iframe src=\"https://example.com/embed\" width=\"100%\" height=\"400\"></iframe>"
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>"
Response
Update a workspace iframe embed by ID
Show child attributes
Show child attributes