canvases.create
method
We're still building and not all features are available quite yet. Enjoy this peek into the future!
Not ready for the future? Return to the past at api.slack.com.
Usage info
This method is used to create a new standalone canvas owned by the acting user.
The canvas will be created untitled and empty if none of the optional parameters are specified.
The canvas may be created with a title
. The canvas may also be created with some initial document_content
. The canvas's ID is returned in the response from the create call.
You can update the canvas's channel or user access by calling the canvases.access.set
method. In order to share a canvas, you need to explicitly share the canvas link in the message. Here are a couple of examples:
Using a text
argument:
// ID of the channel you want to send the message to
const channelId = "C12345";
try {
// Call the chat.postMessage method using the client
const result = await client.chat.postMessage({
channel: channelId,
text:
`https://your_workspace_URL.slack.com/docs/<team_id>/<canvas_id>`
});
console.log(result);
}
catch (error){
console.error(error);
}
Using a blocks
argument:
{
"blocks": [
{
"type": "rich_text",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "link",
"url": "https://your_workspace_URL.slack.com/docs/<team_id>/<canvas_id>"
}
]
}
]
}
]
}
The following formatting elements are supported in the document_content
object:
- bold
- bulleted lists
- checklist
- canvas unfurl
- code block
- code span
- divider (horizontal rule)
- emojis—standard and custom
- file unfurls
- hard line break
- headings h1-h3
- italic
- link (in line)
- link reference
- message unfurl
- ordered lists
- paragraph
- profile unfurl
- quote block
- strikethrough
- website unfurl
- @ mentions for users and channels## Response