Excalidraw+ API

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
POST
/api/v1/scenes/{sceneId}/readonly-links

Authorization

apiKey
headerAuthorizationBearer <Bearer>

The API will use the Authorization: Bearer <your-key> header for requests.

Path Parameters

sceneId*string

Request Body

application/json
  1. body
name?string

The link's name in the scene's Embeddable links list. Default: '# Readonly link'.

Length1 <= length
frameId?string

Start 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.

Items1 <= items <= 2000
area?

Start on this part of the scene, in scene coordinates. Not combinable with frameId or elementIds.

showTitle?boolean

Show the scene's name at the top.

showMenu?boolean

Show the menu, which saves the scene to a file or as an image.

darkMode?boolean

Show the scene in dark mode.

disableInteraction?boolean

Stop viewers from panning and zooming: they only see the starting area.

showDarkModeToggle?boolean

Show a button that switches between light and dark mode.

showFrameOutlines?boolean

Show the outlines and names of frames.

Response Body

This response returns the new link with its URL and embed code.

application/json
  1. response

This response returns the new link with its URL and embed code.

id*string
scene*string
workspace*string
created*string
updated*string
updatedBy*string|null
creator*string|null
preview*string|null
previewPath*string|null
type*"readonly"
Value in"readonly"
status*|
name*string|null
data*
url*string

The read-only page, in the link's theme.

embedHtml*string

An iframe that embeds the page in another site.

Example Request
curl -X POST 'https://api.excalidraw.com/api/v1/scenes/string/readonly-links' \
  -H 'Content-Type: application/json' \
  -d '{}'
Example Response
{
  "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