Canva Connect
Manage Canva designs, assets, and folders via the Connect API.
What This Skill Does (and Doesn't Do)
| ✅ CAN DO | ❌ CANNOT DO |
|---|
| List/search designs | Add content to designs |
| Create blank designs |
Edit existing design content |
| Export designs (PNG/PDF/JPG) | Upload documents (images only) |
| Create/manage folders | AI design generation |
| Move items between folders | |
| Upload images as assets | |
| Autofill brand templates | |
Realistic Use Cases
1. Asset Pipeline 🖼️
CODEBLOCK0
2. Export Automation 📤
CODEBLOCK1
3. Design Organization 📁
CODEBLOCK2
4. Brand Template Autofill 📋
CODEBLOCK3
Quick Start
CODEBLOCK4
Setup
1. Create Canva Integration
- 1. Go to canva.com/developers/integrations
- Click Create an integration
- Set scopes:
-
design:content (Read + Write)
-
design:meta (Read)
-
asset (Read + Write)
-
brandtemplate:meta (Read)
-
brandtemplate:content (Read)
-
profile (Read)
- 4. Set OAuth redirect: INLINECODE6
- Note Client ID and generate Client Secret
2. Configure Environment
Add to ~/.clawdbot/clawdbot.json under skills.entries:
CODEBLOCK5
Or set environment variables:
CODEBLOCK6
3. Authenticate
CODEBLOCK7
Opens browser for OAuth consent. Tokens stored in ~/.clawdbot/canva-tokens.json.
Commands
Authentication
| Command | Description |
|---|
| INLINECODE10 | Start OAuth flow (opens browser) |
| INLINECODE11 |
Check authentication status |
|
auth logout | Clear stored tokens |
Designs
| Command | Description |
|---|
| INLINECODE13 | List your designs |
| INLINECODE14 |
Get design details |
|
designs create --type <type> --title <title> | Create new design |
|
designs delete <id> | Move design to trash |
Design types: doc, presentation, whiteboard, poster, instagram_post, facebook_post, video, logo, flyer, INLINECODE26
Export
| Command | Description |
|---|
| INLINECODE27 | Export design |
| INLINECODE28 |
Check export job status |
Formats: pdf, png, jpg, gif, pptx, INLINECODE34
Assets
| Command | Description |
|---|
| INLINECODE35 | List uploaded assets |
| INLINECODE36 |
Upload asset |
|
assets get <id> | Get asset details |
|
assets delete <id> | Delete asset |
Brand Templates
| Command | Description |
|---|
| INLINECODE39 | List brand templates |
| INLINECODE40 |
Get template details |
|
autofill <template_id> --data <json> | Autofill template with data |
Folders
| Command | Description |
|---|
| INLINECODE42 | List folders |
| INLINECODE43 |
Create folder |
|
folders get <id> | Get folder contents |
User
| Command | Description |
|---|
| INLINECODE45 | Get current user profile |
Examples
Create and Export a Poster
CODEBLOCK8
Upload Brand Assets
CODEBLOCK9
Autofill a Template
CODEBLOCK10
API Reference
Base URL: INLINECODE46
See references/api.md for detailed endpoint documentation.
Troubleshooting
Token Expired
CODEBLOCK11
Rate Limited
The API has per-endpoint rate limits. The script handles backoff automatically.
Missing Scopes
If operations fail with 403, ensure your integration has the required scopes enabled.
Data Files
| File | Purpose |
|---|
| INLINECODE47 | OAuth tokens (encrypted) |
| INLINECODE48 |
Response cache |
Canva Connect
通过Connect API管理Canva设计、资源和文件夹。
此技能的功能与限制
| ✅ 可执行操作 | ❌ 不可执行操作 |
|---|
| 列出/搜索设计 | 向设计中添加内容 |
| 创建空白设计 |
编辑现有设计内容 |
| 导出设计(PNG/PDF/JPG) | 上传文档(仅支持图片) |
| 创建/管理文件夹 | AI设计生成 |
| 在文件夹间移动项目 | |
| 上传图片作为资源 | |
| 自动填充品牌模板 | |
实际应用场景
1. 资源管理流水线 🖼️
生成图表 → 上传至Canva → 整理到项目文件夹
2. 导出自动化 📤
在Canva中完成设计 → 通过CLI导出 → 用于文档/网站
3. 设计整理 📁
创建项目文件夹 → 移动相关设计 → 保持Canva整洁
4. 品牌模板自动填充 📋
在Canva中设置模板 → 通过API传递数据 → 获取个性化输出
快速开始
bash
身份验证(打开浏览器进行OAuth认证)
{baseDir}/scripts/canva.sh auth
列出您的设计
{baseDir}/scripts/canva.sh designs list
创建新设计
{baseDir}/scripts/canva.sh designs create --type doc --title 我的文档
导出设计
{baseDir}/scripts/canva.sh export
--format pdf
设置
1. 创建Canva集成
- 1. 访问 canva.com/developers/integrations
- 点击 创建集成
- 设置权限范围:
- design:content(读写)
- design:meta(读取)
- asset(读写)
- brandtemplate:meta(读取)
- brandtemplate:content(读取)
- profile(读取)
- 4. 设置OAuth重定向地址:http://127.0.0.1:3001/oauth/redirect
- 记录客户端ID并生成客户端密钥
2. 配置环境
在 ~/.clawdbot/clawdbot.json 的 skills.entries 下添加:
json
{
skills: {
entries: {
canva: {
clientId: 您的客户端ID,
clientSecret: 您的客户端密钥
}
}
}
}
或设置环境变量:
bash
export CANVACLIENTID=yourclientid
export CANVACLIENTSECRET=yourclientsecret
3. 身份验证
bash
{baseDir}/scripts/canva.sh auth
打开浏览器进行OAuth授权。令牌存储在 ~/.clawdbot/canva-tokens.json 中。
命令
身份验证
| 命令 | 描述 |
|---|
| auth | 启动OAuth流程(打开浏览器) |
| auth status |
检查身份验证状态 |
| auth logout | 清除存储的令牌 |
设计
| 命令 | 描述 |
|---|
| designs list [--limit N] | 列出您的设计 |
| designs get <id> |
获取设计详情 |
| designs create --type --title | 创建新设计 |
| designs delete | 将设计移至回收站 |
设计类型: doc、presentation、whiteboard、poster、instagrampost、facebookpost、video、logo、flyer、banner
导出
| 命令 | 描述 |
|---|
| export <designid> --format <fmt> | 导出设计 |
| export status <jobid> |
检查导出任务状态 |
格式: pdf、png、jpg、gif、pptx、mp4
资源
| 命令 | 描述 |
|---|
| assets list | 列出已上传的资源 |
| assets upload <file> [--name <name>] |
上传资源 |
| assets get | 获取资源详情 |
| assets delete | 删除资源 |
品牌模板
| 命令 | 描述 |
|---|
| templates list | 列出品牌模板 |
| templates get <id> |
获取模板详情 |
| autofill --data | 使用数据自动填充模板 |
文件夹
| 命令 | 描述 |
|---|
| folders list | 列出文件夹 |
| folders create <name> |
创建文件夹 |
| folders get | 获取文件夹内容 |
用户
示例
创建并导出海报
bash
创建
{baseDir}/scripts/canva.sh designs create --type poster --title 活动海报
导出为PNG
{baseDir}/scripts/canva.sh export DAF... --format png --output ./poster.png
上传品牌资源
bash
上传logo
{baseDir}/scripts/canva.sh assets upload ./logo.png --name 公司Logo
批量上传
for f in ./brand/*.png; do
{baseDir}/scripts/canva.sh assets upload $f
done
自动填充模板
bash
列出可用模板
{baseDir}/scripts/canva.sh templates list
使用数据自动填充
{baseDir}/scripts/canva.sh autofill TEMPLATE_ID --data {
title: 第一季度报告,
subtitle: 财务摘要,
date: 2026年1月
}
API参考
基础URL:https://api.canva.com/rest
详细端点文档请参见 references/api.md。
故障排除
令牌过期
bash
{baseDir}/scripts/canva.sh auth # 重新认证
频率限制
API对每个端点有频率限制。脚本会自动处理退避。
缺少权限范围
如果操作返回403错误,请确保您的集成已启用所需的权限范围。
数据文件
| 文件 | 用途 |
|---|
| ~/.clawdbot/canva-tokens.json | OAuth令牌(加密) |
| ~/.clawdbot/canva-cache.json |
响应缓存 |