Excalidraw+ API

Patch scene content

Patch scene content by merging supplied fields into the existing scene instead of replacing it.

Unlike the PUT endpoint which replaces all content, PATCH performs a server-side merge:

  • Elements: Merged by element ID using version-based reconciliation. Higher version wins; equal versions are resolved by versionNonce tie-breaking. Elements not included in the request are preserved. Send elements with isDeleted: true and a higher version to soft-delete them. A deleted element stays in the stored scene for 14 days and is then removed.
  • App State: Shallow merge of provided fields over existing state.
  • Files: New files are added; existing files are preserved unless replaced by a file with the same ID.

PATCH accepts a partial scene-content object. You may provide any subset of elements, appState, and files, but at least one of them must be present. This endpoint does not perform an authoritative replacement and does not force connected editors to reload. It writes a merged scene using the current stored content as the base. If the scene is modified concurrently, the merge result may temporarily diverge until the next editor save/reconciliation cycle. If you want to replace the entire scene with a new authoritative version, use PUT /scenes/:sceneId/content instead.

Use cases:

  • Adding or updating specific elements without affecting others
  • Updating background color without touching elements
  • Programmatically adding images/files to an existing scene
  • Building integrations that modify scenes without full content replacement
PATCH
/api/v1/scenes/{sceneId}/content

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
elements?unknown
appState?
files?
filesFailedToEmbed?array<string>

Ignored on write requests. Present so GET responses can be reused as PUT/PATCH inputs.

Response Body

This response returns the merged content of the scene after applying the patch.

application/json
  1. response

This response returns the merged content of the scene after applying the patch.

type*"excalidraw"
Value in"excalidraw"
version*number
source*string
appState*
elements*array<unknown>
sceneVersion*string
files*
Example Request
curl -X PATCH 'https://api.excalidraw.com/api/v1/scenes/string/content' \
  -H 'Content-Type: application/json' \
  -d '{}'
Example Response
{
  "type": "excalidraw",
  "version": 0,
  "source": "string",
  "appState": {
    "viewBackgroundColor": "string",
    "lockedMultiSelections": {
      "property1": true,
      "property2": true
    }
  },
  "elements": [
    null
  ],
  "sceneVersion": "string",
  "files": {
    "property1": {
      "mimeType": "string",
      "id": "string",
      "created": 1,
      "lastRetrieved": 1,
      "version": 1,
      "dataURL": "string"
    },
    "property2": {
      "mimeType": "string",
      "id": "string",
      "created": 1,
      "lastRetrieved": 1,
      "version": 1,
      "dataURL": "string"
    }
  }
}

Last updated on