Skip to content

Sharing canvases

Share links let anyone view a canvas without a CanvasMesh account. You control when they expire and can revoke them at any time.

LevelWho can view
privateOnly the owner
publicAnyone with the canvas URL

Set visibility at create time or with an update call. Share links (below) are orthogonal — a private canvas can still have a public share link.

Terminal window
canvasmesh share cv_abc123 --expires 7d

Accepted durations: 30m, 24h, 7d, etc. Omit --expires for a link that never expires.

const share = await client.share('cv_abc123', { expiresIn: '7d' });
console.log(share.url); // https://canvasmesh.app/s/<token>
console.log(share.token); // short opaque token
Terminal window
curl -X POST https://api.canvasmesh.app/v1/canvases/cv_abc123/share \
-H "Authorization: Bearer $CANVASMESH_API_KEY" \
-H "Content-Type: application/json" \
-d '{"expires_in": "7d"}'

Share URLs are under https://canvasmesh.app/s/<token> and render the canvas in the viewer. To download the raw file:

Terminal window
curl "https://api.canvasmesh.app/share/<token>/content?dl=1" -o downloaded.file

The CLI download command handles this for you:

Terminal window
canvasmesh download https://canvasmesh.app/s/<token> -o ./downloaded.file
Terminal window
curl -X DELETE https://api.canvasmesh.app/v1/canvases/cv_abc123/share \
-H "Authorization: Bearer $CANVASMESH_API_KEY"

This invalidates all share links for that canvas. Create a new share call to issue a replacement.

Each share token tracks how many times it has been accessed. Fetch via the canvas detail API (see REST reference).