Skip to main content
POST
Publish a canvas page

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

authorization
string | null
x-ankra-organisation-id
string | null

Body

application/json

Either a chat artifact publish (conversation_id and artifact_id) or a durable canvas publish (canvas_id and revision_id), never both.

conversation_id
string
required
artifact_id
string
required

The canvas artifact id, or a client-chosen id such as document- for a canvas extracted from a code fence.

title
string
required
language
enum<string>
required
Available options:
html,
svg,
markdown
content
string
required
Maximum string length: 200000
ttl_hours
integer | null
Required range: x >= 1
interactive
boolean | null

Opts the page into running its scripts under the interactive sandbox policy (inline scripts only, no eval, no network, opaque origin). Accepted only when the published language is html; any other language answers 400 invalid_request. Omitted or null publishes a static page, also on a republish.

Response

The artifact was already published; its page was updated in place and kept its URL.

id
string<uuid>
required
slug
string
required
url
string
required
title
string
required
language
enum<string>
required
Available options:
html,
svg,
markdown
size_bytes
integer
required
status
enum<string>
required
Available options:
live,
unpublished,
taken_down
conversation_id
string | null
required

The conversation a chat artifact publication came from; null on a canvas publication.

artifact_id
string | null
required

The chat artifact published; null on a canvas publication.

canvas_id
string<uuid> | null
required

The durable canvas published; null on a chat artifact publication.

revision_id
string<uuid> | null
required

The canvas revision the page was published from (for a json dashboard revision, the revision its html snapshot was rendered from); null on a chat artifact publication.

created_at
string<date-time>
required
updated_at
string<date-time>
required
expires_at
string<date-time>
required
interactive
boolean
required

True when the page runs its scripts under the interactive sandbox policy; false for a static page and for a legacy row.