Create a canvas
import requests
url = "https://platform.ankra.app/api/v1/org/canvases"
payload = {
"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({title: '<string>', content: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/canvases', 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/canvases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"content": "<string>"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "dashboard",
"title": "<string>",
"visibility": "private",
"owner_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_owner": true,
"is_pinned": true,
"language": "json",
"draft_revision_id": "<string>",
"published_revision_id": "<string>",
"source_conversation_id": "<string>",
"source_artifact_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"draft": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": 2,
"parent_revision_id": "<string>",
"language": "json",
"schema_version": 1,
"size_bytes": 123,
"author_kind": "user",
"created_at": "2023-11-07T05:31:56Z",
"content": "<string>"
}
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "dashboard",
"title": "<string>",
"visibility": "private",
"owner_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_owner": true,
"is_pinned": true,
"language": "json",
"draft_revision_id": "<string>",
"published_revision_id": "<string>",
"source_conversation_id": "<string>",
"source_artifact_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"draft": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": 2,
"parent_revision_id": "<string>",
"language": "json",
"schema_version": 1,
"size_bytes": 123,
"author_kind": "user",
"created_at": "2023-11-07T05:31:56Z",
"content": "<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>"
}
]
}Canvases
Create a canvas
Saves a new canvas with its first revision as the draft. A canvas is private to its creator until shared. Saving a chat artifact names source_conversation_id and source_artifact_id together; saving the same artifact again returns the canvas it already made (200) instead of creating another.
POST
/
api
/
v1
/
org
/
canvases
Create a canvas
import requests
url = "https://platform.ankra.app/api/v1/org/canvases"
payload = {
"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({title: '<string>', content: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/canvases', 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/canvases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"content": "<string>"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "dashboard",
"title": "<string>",
"visibility": "private",
"owner_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_owner": true,
"is_pinned": true,
"language": "json",
"draft_revision_id": "<string>",
"published_revision_id": "<string>",
"source_conversation_id": "<string>",
"source_artifact_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"draft": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": 2,
"parent_revision_id": "<string>",
"language": "json",
"schema_version": 1,
"size_bytes": 123,
"author_kind": "user",
"created_at": "2023-11-07T05:31:56Z",
"content": "<string>"
}
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "dashboard",
"title": "<string>",
"visibility": "private",
"owner_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_owner": true,
"is_pinned": true,
"language": "json",
"draft_revision_id": "<string>",
"published_revision_id": "<string>",
"source_conversation_id": "<string>",
"source_artifact_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"draft": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": 2,
"parent_revision_id": "<string>",
"language": "json",
"schema_version": 1,
"size_bytes": 123,
"author_kind": "user",
"created_at": "2023-11-07T05:31:56Z",
"content": "<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>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Available options:
dashboard, page Required string length:
1 - 200Available options:
json, html, svg, markdown Maximum string length:
524288Maximum string length:
128Maximum string length:
128Response
The chat artifact was already saved; its canvas is returned unchanged.
A canvas with its draft revision.
Available options:
dashboard, page Available options:
private, organisation Whether the caller pinned the canvas.
The language of the draft revision.
Available options:
json, html, svg, markdown Show child attributes
Show child attributes