Skip to Content
Image
Dot. Manual
Image
Dot. Manual
Back to home

Dot.

Install Dot. AppDiagnostic Tool

Quote

Quote/0New
Pairing Quote/0How to TapShare with Family and FriendsHow to Charge
Content Mode
Loop ContentFixed Content
TimingNewApp Clip and Tap-to-InteractNew
Screen States and Troubleshooting
Update DeviceReset NetworkReset DeviceChangelogNew
Service and RepairCustomize Quote/0

Rand

Rand/0New
Getting StartedNew
FeaturesNew
Book of AnswersFortuneMBTI GuideWooden FishCoin FlipBluetooth RemoteNewPomodoroNewClockTimerNewDice RollNumber Under TenDisplay ModeNewNFC Cards
Wi-FiCustom WallpaperSettingsHow to Charge
Update DeviceReset DeviceChangelogNew
Service and RepairCustomize Rand/0

Read

Read PicoNew
Getting StartedNew
CrossMuxkiikoreadRickyOSWhiteOSCrossLink PixelJust ReadPico PageAuraReaderPageRestif-ink OSThingsOSTake EasyVanOSCPYOSYanReaderFolio BookXH View OS For PicoFolioGlintNewCrossLink 2.0NewTreaderOSNewLumiNewEDC BookNew
Demo SystemDIY Your SystemSubmit Your System

Clock

ClockNew
Getting StartedDIY Your System

Content & Services

Roadmap
Content Studio
Join Content StudioRSS
Shortcuts
Co CreateNew
SoftwareNew
QuoteNew
Rand
ReadNew
ClockNew
HardwareNew
Quote
Rand
ReadNew
Open PlatformNew
Dot AssistantNewRequest rate limitsNew
PersonalNew
Get API KeyCreate an OAuth Client
Manage devicesNew
Get Device Serial NumberGet Device ListGet Device StatusGet TimezonesDevice Settings
ContentNew
Content StudioNew
List Content Studio recommendationsNewSearch Content StudioNewBrowse Content Studio by CategoryNewList Collection ContentsNewRead content detailsNewUpload a content imageNew
List device contentNewAdd device contentNew
Update contentNew
Control Text ContentControl Image ContentControl Canvas Content
Change a fixed scheduleNewReorder loop contentNewRemove device contentNewDisplay a specific itemNewSwitch to Next Content
OrganizationsNew
Create and manage an organizationNewSet Up Organization API AccessNew
Device softwareNew
Manage device software IDsNewUpload a versionNewPublish a versionNewReview and resubmissionNewQuery versions from a deviceNewVersion list and detailsNewQuery published versions from a serverNewDownload and updateNew

Explore More Possibilities

Request New ContentJoin Content StudioOur Repositories

Security

Responsible Disclosure Policy

More

Service StatusService and RepairCustomize ProductsPrivacy PolicyUser AgreementOrganization and Publisher AgreementContact UsAbout MindReset
Content & ServicesOpen PlatformNewPersonalNewManage devicesNewContentNewUpdate contentNew
Image

Control Canvas Content

RSSImprove this page

Quick Guide

Prerequisites

  1. In the Playground, sign in to Dot and select Authorize. In a script, use a personal API key or an OAuth access token as a Bearer token.
  2. Get the serial number for a device you can control.
  3. Make sure the device is powered and online;
  4. Use add device content to add mindreset.canvas_api to the device’s loop or fixed list.

What Canvas API is for

Text API is best for quickly sending a text card, and Image API is best for showing one image. Canvas API lets you turn your own data into custom cards, dashboards, or small visual experiments.

How screen structure works

Canvas API uses windowData to describe the screen with object elements: each element is an object, type selects the element type, props contains style and content, and props.children can be text, one child element, or an array of child elements.

The outer container usually needs no padding

The device layout handles the basic spacing outside windowData.default. Let the outer element focus on structure, background, and alignment. When you need edge-to-edge rendering, a custom background, or FULL layout overrides, pass layoutFull.

Choose a content list and display timing

Choose the loop list or fixed list; the loop list is used by default. A task identifier targets an item only in the selected list. Without an identifier, the first Canvas API item in that list is updated.

Enable immediate display for loop content to request a screen update while the device is online. A sleeping device on battery retrieves saved content after automatic wake. Fixed content follows the times configured in Dot. App: even the item currently on screen waits for the next scheduled refresh. The API preserves its time settings. Read Timing for details.

Each device accepts one immediate refresh request every 2 seconds. If you receive a 429, wait the number of seconds in Retry-After. See API rate limits.

Request Examples

POST
/api/authV2/open/device/:deviceId/canvas

Authorize with your Dot account or enter an API key or OAuth access token.

Generated Code

Before running an example, replace placeholders such as {{VARIABLE}} with actual values and remove the surrounding double braces.

1// Generating...

Update content in the fixed list

  1. In the List device content Playground, select the same device and its fixed list. Copy the taskKey from the Canvas API item.
  2. In the Playground above, select the fixed list (taskType: "fixed") and enter that taskKey and the Canvas content. The fixed item shows the new content at its next scheduled refresh.

Response Example

This is an example response for immediate display of loop content.

{
  "message": "Device ABCD1234ABCD Canvas API content switched."
}

Troubleshooting

Endpoint

/api/authV2/open/device/:deviceId/canvas

Method

POST

Path Parameters

Prop

Type

Device serial number.

Request Schema

Canvas API requests combine content data with a screen description. Use data for values the screen can read, and use windowData to describe the element structure. You can also pass taskAlias to label the item in the device task list, layoutFull to adjust the FULL layout, link to set the tap-to-open URL, and border to choose the screen border color.

Put taskType, taskKey, and refreshNow at the request top level, outside data.

To avoid conflicting meanings, do not use type, key, windowData, layoutFull, taskAlias, link, border, __proto__, constructor, or prototype as keys inside data.

{
  "refreshNow": true,
  "taskAlias": "Morning canvas",
  "data": {
    "badge": "DOT OPENAPI",
    "title": "Canvas API",
    "message": "Compose screen content, state, and layout with JSON.",
    "status": "LIVE",
    "footer": "WRITE / SEND / DONE"
  },
  "windowData": {
    "default": [
      {
        "type": "div",
        "props": {
          "tw": "flex flex-col w-full h-full min-w-0 min-h-0 bg-white text-black gap-[8px]",
          "children": [
            {
              "type": "div",
              "props": {
                "tw": "flex flex-row items-center justify-between shrink-0 text-10-chillduansans",
                "children": [
                  {
                    "type": "span",
                    "props": {
                      "tw": "font-bold",
                      "children": "{{get inputData \"badge\" default=\"DOT OPENAPI\"}}"
                    }
                  },
                  {
                    "type": "span",
                    "props": {
                      "children": "{{get inputData \"status\" default=\"LIVE\"}}"
                    }
                  }
                ]
              }
            },
            {
              "type": "div",
              "props": {
                "tw": "flex flex-col flex-1 min-h-0 justify-center gap-[6px]",
                "children": [
                  {
                    "type": "div",
                    "props": {
                      "tw": "text-28-chillduansans font-bold leading-none min-w-0",
                      "style": {
                        "lineClamp": 2,
                        "overflow": "hidden",
                        "textOverflow": "ellipsis"
                      },
                      "children": "{{get inputData \"title\" default=\"Canvas API\"}}"
                    }
                  },
                  {
                    "type": "div",
                    "props": {
                      "tw": "text-16-chillduansans leading-[1.16] min-w-0",
                      "style": {
                        "lineClamp": 3,
                        "overflow": "hidden",
                        "textOverflow": "ellipsis"
                      },
                      "children": "{{get inputData \"message\" default=\"\"}}"
                    }
                  }
                ]
              }
            },
            {
              "type": "div",
              "props": {
                "tw": "flex flex-row items-center gap-[6px] shrink-0 text-10-chillduansans",
                "children": [
                  {
                    "type": "span",
                    "props": {
                      "tw": "w-[6px] h-[6px] rounded-full bg-black shrink-0",
                      "children": ""
                    }
                  },
                  {
                    "type": "span",
                    "props": {
                      "tw": "min-w-0",
                      "style": {
                        "overflow": "hidden",
                        "textOverflow": "ellipsis",
                        "whiteSpace": "nowrap"
                      },
                      "children": "{{get inputData \"footer\" default=\"WRITE / SEND / DONE\"}}"
                    }
                  }
                ]
              }
            }
          ]
        }
      }
    ]
  },
  "layoutFull": {
    "tw": "p-[12px]"
  },
  "link": "https://dot.mindreset.tech",
  "border": 0
}

Writing windowData

  • windowData must contain a default layer array;
  • Elements are usually written as { "type": "div", "props": { ... } };
  • props.tw writes Tailwind-like styles, while props.style writes explicit inline styles;
  • div defaults to a flex container; when another display mode is needed, set block, grid, hidden, or another display class in props.tw, or set props.style.display;
  • props.children can be a string, one element object, or an array of elements;
  • Dynamic content can read request data with {{get inputData "user.name" default="-"}};
  • List structures can use $for inside the repeated node's props; $empty sits next to $for and replaces that node when the array is empty;
  • Common element types are div, span, and img;
  • Images may use data URIs or anonymously accessible http(s) image URLs;
  • The outermost container does not need extra padding; when layoutFull is omitted, the device FULL layout keeps its default spacing. Use layoutFull.tw or layoutFull.style when you need to override the FULL layout;
  • The request is limited by template size and complexity to keep rendering stable.

List Structures: $for / $empty

$for expands elements during JSON compilation. It is not a browser JavaScript loop. Put it inside the props of the node to repeat; the repeated unit is that node itself. items is a JSON path read from the current template context; as and index inject local values for the loop body. limit is optional. When omitted, all rows are rendered, and the device layout decides how many fit on screen.

{
  "type": "div",
  "props": {
    "$for": {
      "items": "inputData.tasks",
      "as": "task",
      "index": "index"
    },
    "$empty": {
      "type": "div",
      "props": {
        "children": "No tasks"
      }
    },
    "children": "{{index}}. {{get task \"title\" default=\"\"}}"
  }
}

Conditions And Formatting

Use $ifAny / $then / $else for structural conditions that add, replace, or remove whole elements. $ifAny may be a single JSON path or an array of paths. If any value exists and has content, $then is used; otherwise $else is used.

{
  "$ifAny": ["inputData.icon", "inputData.signature"],
  "$then": {
    "type": "div",
    "props": {
      "children": "{{get inputData \"signature\" default=\"\"}}"
    }
  },
  "$else": {
    "type": "div",
    "props": {
      "children": "No signature"
    }
  }
}

For short text conditions inside a string, use template if / else syntax or compare. Use if to check whether a value has content, and use compare when two values must be compared explicitly:

{{#if (get inputData "title" default="")}}{{get
    inputData
    "title"
  }}{{else}}Untitled{{/if}}
{{#compare inputData.status "===" "done"}}Done{{else}}In progress{{/compare}}

Use formatDate for dates and formatCompactNumber for numbers. For standard number formatting instead of compact K/M output, set the third argument to standard.

{{formatDate inputData.date "yyyy/MM/dd" "Asia/Shanghai"}}
{{formatDate inputData.date "EEE" "Asia/Shanghai"}}
{{formatCompactNumber inputData.count}}
{{formatCompactNumber inputData.count "en-US" "standard" 0}}

Supported Styles And Custom Tailwind Classes

Canvas API supports a device-oriented static rendering style surface. In practice, the styling boundary is: React object-like elements + a static CSS subset, plus Dot.'s custom Tailwind font utilities, breakpoint handling, and image-processing classes.

SyntaxSourceNotes
props.styleDot Canvas static style subsetBest for deterministic pixel values and explicit styles.
props.twTailwind-like syntax + Dot. extensionsBest for quick layout, color, spacing, font classes, and image-processing classes.
layoutFull.tw / layoutFull.styleDot. layout wrapper overrideUse for full-bleed screens, background, and padding overrides.

The props.style support list is aligned with the static CSS support table. Common categories include CSS variables, display, position, color, margin, padding, top/right/bottom/left, width/height, minWidth/minHeight/maxWidth/maxHeight, border*, borderRadius*, Flexbox, gap, fontFamily, fontSize, fontWeight, fontStyle, tabSize, textAlign, textIndent, textTransform, textOverflow, textDecoration, textShadow, letterSpacing, lineHeight, whiteSpace, lineClamp, wordBreak, textWrap, backgroundColor, backgroundImage, backgroundPosition, backgroundSize, backgroundClip, backgroundRepeat, transform, transformOrigin, objectFit, objectPosition, opacity, boxSizing, boxShadow, overflow, filter, clipPath, mask*, and WebkitTextStroke*.

This style list only describes props.style. The font classes, breakpoint processing, and img-* image-processing classes below are Dot. custom Tailwind extensions on top of props.tw.

Important boundaries: Canvas API is not a full browser environment. It does not support <style>, external <link>, or <script>; it does not support 3D transforms, z-index, or calc(); currentColor is only reliable on the color property; advanced typography features and RTL languages are not the current focus. Canvas API also does not support JSX, arbitrary JS expressions, React hooks, browser APIs, external CSS, or custom components.

Common props.tw classes include flex, flex-row, flex-col, flex-1, shrink-0, grow, items-*, justify-*, w-full, h-full, w-[84px], h-[40px], min-w-0, min-h-0, max-h-[200px], gap-*, gap-[5px], p-*, px-[8px], py-[5px], bg-*, text-*, border*, rounded*, overflow-hidden, box-border, box-content, fill-black, and fill-white. If a Tailwind class is uncertain, prefer props.style.

Text supports two font families of class patterns:

TypeSyntaxExample
Regular fonttext-{size}-{font}text-18-chillduansans
Regular font with arbitrary px sizetext-[Npx]-{font}text-[20px]-playfairdisplay
Tailwind font size keytext-{xs/sm/base/lg/xl/2xl...}-{font}text-lg-chillduansans
Pixel fonttext-pixel-{size}[-variant]text-pixel-12-zpix

Common regular font keys: chillduansans, chillksans, chillorganic, chillroundf, chillroundgothic, logoscunboundedsans, maokenyingbikaishuj0.09, playfairdisplay, zihunzhoukesong.

Pixel font classes: text-pixel-8, text-pixel-8-quan, text-pixel-10, text-pixel-12, text-pixel-12-xiaoya, text-pixel-12-zpix, text-pixel-16, text-pixel-16-cusong, text-pixel-16-unifont, text-pixel-16-unifontmono, text-pixel-24.

For text layout, prefer these props.style fields: fontSize, fontWeight, lineHeight, letterSpacing, whiteSpace, wordBreak, lineClamp, textOverflow, and overflow. A multi-line body usually looks like:

{
  "tw": "text-18-chillduansans",
  "style": {
    "lineHeight": "20px",
    "whiteSpace": "pre-wrap",
    "wordBreak": "break-word",
    "overflow": "hidden"
  }
}

Image elements support extra e-ink image-processing classes in img.props.tw:

img-dither-none
img-dither-diffusion
img-dither-ordered

img-kernel-threshold
img-kernel-atkinson
img-kernel-burkes
img-kernel-floyd-steinberg
img-kernel-sierra2
img-kernel-stucki
img-kernel-jarvis-judice-ninke
img-kernel-diffusion-row
img-kernel-diffusion-column
img-kernel-diffusion-2d

img-levels-2
img-levels-3
img-levels-4
img-levels-8
img-levels-16

For image layout, use style.objectFit and style.objectPosition, such as contain / center bottom. Avoid relying on aspect-ratio, CSS Grid, absolute positioning, pseudo classes, media queries, external CSS, scripts, or custom components; these are not part of the stable Canvas API surface.

Response Schema

Prop

Type

Request result.

Status Codes

HTTP status codeDescription
200The content was saved or a refresh was requested.
400Check the fields and canvas elements you sent.
404Check the device and the target item key.
429Wait for the number of seconds in Retry-After.

Common Error Examples

Unsupported element type:

{
  "windowData": {
    "default": [
      {
        "type": "button",
        "props": {
          "children": "Bad type"
        }
      }
    ]
  }
}

Response:

{
  "message": "The canvas element button for device ABCD1234ABCD is not supported (path: windowData.default[0].type). Only div, span, and img are currently supported."
}

Unsupported property:

{
  "windowData": {
    "default": [
      {
        "type": "div",
        "props": {
          "children": [
            {
              "type": "span",
              "props": {
                "onClick": "alert(1)",
                "children": "Unsafe"
              }
            }
          ]
        }
      }
    ]
  }
}

Response:

{
  "message": "The canvas property onClick for device ABCD1234ABCD is not supported (path: windowData.default[0].props.children[0].props.onClick)."
}

Invalid image source:

{
  "windowData": {
    "default": [
      {
        "type": "div",
        "props": {
          "children": [
            {
              "type": "img",
              "props": {
                "src": "data:image/png;base64,not-a-png"
              }
            }
          ]
        }
      }
    ]
  }
}

Response:

{
  "message": "The canvas image src for device ABCD1234ABCD is invalid (path: windowData.default[0].props.children[0].props.src). Provide data:image/*;base64,... or an anonymously accessible http(s) image URL."
}

Troubleshoot list selection and display timing

  • 400: use only loop or fixed for taskType.
  • 404: ensure the request uses the same taskType as the list query and a taskKey from a matching API item in that list. Omitting taskType selects the loop list.
  • Fixed content was saved but the screen did not change: check its time settings in Dot. App and wait for the next scheduled refresh. refreshNow: true does not immediately refresh fixed content.

Did this solve your problem?

Join our community

Control Image Content

Previous

Change a fixed scheduleNew

Set the start, duration, and daily, weekly, or one-time recurrence of a fixed item.

Contents

Quick GuidePrerequisitesRequest ExamplesUpdate content in the fixed listResponse ExampleTroubleshootingEndpointMethodPath ParametersRequest SchemaWriting windowDataList Structures: $for / $emptyConditions And FormattingSupported Styles And Custom Tailwind ClassesResponse SchemaStatus CodesCommon Error ExamplesTroubleshoot list selection and display timing