Create read-only link
Create a read-only (embeddable) link to the scene and return it with its URL and embed code.
A read-only link opens the scene for anyone, without signing in, and can be embedded in another site with its embedHtml iframe. Viewers can't change the scene; they see it as it is saved now.
A scene can have several read-only links. Each one starts on its own area of the scene and has its own display options. This is not the scene's public link (PUT /scenes/:sceneId/link-sharing), of which a scene has one.
The link starts on a frame (frameId), on some elements (elementIds) or on an area. Without any of them, it starts on all of the scene's content. Its preview image, which link previews on social media show, is a render of that start.
Creating a link fails with 403 when a workspace admin has disabled scene sharing for the workspace.
Use cases:
- Embedding a diagram in documentation or a wiki
- Sharing one part of a large scene
- Giving several audiences their own starting view of a scene
apiKeyAuthorizationBearer <Bearer>The API will use the Authorization: Bearer <your-key> header for requests.
sceneId*stringapplication/json- body
name?stringThe link's name in the scene's Embeddable links list. Default: '# Readonly link'.
1 <= lengthframeId?stringStart on this frame, which then fills the view. Not combinable with elementIds or area.
elementIds?array<string>Start on these elements with some space around them, e.g. the ids a write tool returned. Not combinable with frameId or area.
1 <= items <= 2000area?Start on this part of the scene, in scene coordinates. Not combinable with frameId or elementIds.
showTitle?booleanShow the scene's name at the top.
showMenu?booleanShow the menu, which saves the scene to a file or as an image.
darkMode?booleanShow the scene in dark mode.
disableInteraction?booleanStop viewers from panning and zooming: they only see the starting area.
showDarkModeToggle?booleanShow a button that switches between light and dark mode.
showFrameOutlines?booleanShow the outlines and names of frames.
This response returns the new link with its URL and embed code.
application/json- response
This response returns the new link with its URL and embed code.
id*stringscene*stringworkspace*stringcreated*stringupdated*stringupdatedBy*string|nullcreator*string|nullpreview*string|nullpreviewPath*string|nulltype*"readonly""readonly"status*|name*string|nulldata*url*stringThe read-only page, in the link's theme.
embedHtml*stringAn iframe that embeds the page in another site.
curl -X POST 'https://api.excalidraw.com/api/v1/scenes/string/readonly-links' \
-H 'Content-Type: application/json' \
-d '{}'{
"id": "string",
"scene": "string",
"workspace": "string",
"created": "string",
"updated": "string",
"updatedBy": "string",
"creator": "string",
"preview": "string",
"previewPath": "string",
"type": "readonly",
"status": "active",
"name": "string",
"data": {
"showTitle": true,
"showMenu": true,
"darkMode": true,
"disableInteraction": true,
"showDarkModeToggle": true,
"showFrameOutlines": true,
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"url": "string",
"embedHtml": "string"
}Last updated on