Publish a canvas page
import requests
url = "https://platform.ankra.app/api/v1/org/canvas-publications"
payload = {
"conversation_id": "<string>",
"artifact_id": "<string>",
"title": "<string>",
"content": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
conversation_id: '<string>',
artifact_id: '<string>',
title: '<string>',
content: '<string>'
})
};
fetch('https://platform.ankra.app/api/v1/org/canvas-publications', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/canvas-publications \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"conversation_id": "<string>",
"artifact_id": "<string>",
"title": "<string>",
"content": "<string>"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"url": "<string>",
"title": "<string>",
"language": "html",
"size_bytes": 123,
"status": "live",
"conversation_id": "<string>",
"artifact_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z"
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"url": "<string>",
"title": "<string>",
"language": "html",
"size_bytes": 123,
"status": "live",
"conversation_id": "<string>",
"artifact_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason": "<string>",
"code": "<string>",
"message": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason": "<string>",
"code": "<string>",
"message": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason": "<string>",
"code": "<string>",
"message": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason": "<string>",
"code": "<string>",
"message": "<string>"
}Canvas Pages
Publish a canvas page
Publishes a chat canvas artifact at a public address on the pages host. The content is sent explicitly, so edited canvases publish as shown. Only html, svg and markdown can be published. The page is a static snapshot served in a sandbox, with a fixed notice naming it as an AI-generated page. Publishing the same conversation_id and artifact_id again keeps the URL and extends the expiry. ttl_hours defaults to 168 and is capped at 720.
POST
/
api
/
v1
/
org
/
canvas-publications
Publish a canvas page
import requests
url = "https://platform.ankra.app/api/v1/org/canvas-publications"
payload = {
"conversation_id": "<string>",
"artifact_id": "<string>",
"title": "<string>",
"content": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
conversation_id: '<string>',
artifact_id: '<string>',
title: '<string>',
content: '<string>'
})
};
fetch('https://platform.ankra.app/api/v1/org/canvas-publications', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/canvas-publications \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"conversation_id": "<string>",
"artifact_id": "<string>",
"title": "<string>",
"content": "<string>"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"url": "<string>",
"title": "<string>",
"language": "html",
"size_bytes": 123,
"status": "live",
"conversation_id": "<string>",
"artifact_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z"
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"url": "<string>",
"title": "<string>",
"language": "html",
"size_bytes": 123,
"status": "live",
"conversation_id": "<string>",
"artifact_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason": "<string>",
"code": "<string>",
"message": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason": "<string>",
"code": "<string>",
"message": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason": "<string>",
"code": "<string>",
"message": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason": "<string>",
"code": "<string>",
"message": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The canvas artifact id, or a client-chosen id such as document- for a canvas extracted from a code fence.
Available options:
html, svg, markdown Maximum string length:
200000Required range:
x >= 1Response
The artifact was already published; its page was updated in place and kept its URL.
Available options:
html, svg, markdown Available options:
live, unpublished, taken_down