Canva Integration Guide

Technology: canva · Category: design · Last reviewed: 2026-10-20

Source: https://tech-stack.codeamanilabs.org/guide/canva

Insight:

Canva's REST APIs (the renamed Connect API) mass-produce on-brand graphics — design a Brand Template once, then autofill it from data. Since 2026-09-21 autofill works for Canva Pro and Teams users too, not just Enterprise, so it fits small-business products. The client secret and per-user tokens stay server-side, and refresh tokens are single-use.

 ██████╗ █████╗ ███╗   ██╗██╗   ██╗ █████╗
██╔════╝██╔══██╗████╗  ██║██║   ██║██╔══██╗
██║     ███████║██╔██╗ ██║██║   ██║███████║
██║     ██╔══██║██║╚██╗██║╚██╗ ██╔╝██╔══██║
╚██████╗██║  ██║██║ ╚████║ ╚████╔╝ ██║  ██║
 ╚═════╝╚═╝  ╚═╝╚═╝  ╚═══╝  ╚═══╝  ╚═╝  ╚═╝

Canva Integration Guide

Focus: Programmatic design with the Canva REST APIs (OAuth 2.0 + PKCE): create designs, autofill brand templates, upload assets, export to PNG/PDF/MP4. Also covers the Canva MCP server (Canva tools for AI assistants, including Claude Code), the Canva CLI, and the Apps SDK for apps that run inside the Canva editor.

Overview

Canva now calls its platform the Canva Developers SDK. It has three surfaces, and all of them are documented under canva.dev/docs/apps/. The old /docs/connect/ URLs 301-redirect there.

Surface What it is When codeAmani uses it
Canva for your platform (REST APIs, formerly "Connect API") REST at https://api.canva.com/rest/v1/, per-user OAuth Default. Server-side autofill, export, and asset sync
Canva for AI assistants (Canva MCP server) Remote MCP server exposing Canva as tools Ad-hoc design work from Claude; embedding Canva in our own AI products
Apps inside Canva (Apps SDK) JS app in an iframe in the Canva editor, built with @canva/* packages Only if we ship a Canva Marketplace or team app

No first-party npm client exists for the REST APIs. You have three options:

flowchart LR
  A["codeAmani server"] -->|"Bearer token (per user)"| B["REST APIs<br/>api.canva.com/rest/v1"]
  B --> C["Autofill<br/>brand template or design"]
  B --> D["Asset uploads"]
  B --> E["Export job<br/>PNG/PDF/MP4/PPTX"]
  E --> F["Download URLs<br/>expire in 24h -> copy to R2"]
  G["Claude / AI assistant"] -->|"OAuth per user"| H["Canva MCP server"]
  H --> B

Official Documentation

Resource URL
REST APIs overview https://www.canva.dev/docs/apps/rest-apis/
Quickstart (all three surfaces) https://www.canva.dev/docs/apps/quickstart/
Authentication (OAuth + PKCE) https://www.canva.dev/docs/apps/rest-apis/authentication/
Scopes https://www.canva.dev/docs/apps/rest-apis/scopes/
Capabilities (plan gating) https://www.canva.dev/docs/apps/rest-apis/capabilities/
Autofill guide https://www.canva.dev/docs/apps/rest-apis/autofill-guide/
API reference index https://www.canva.dev/docs/apps/rest-apis/reference/
Changelog https://www.canva.dev/docs/apps/rest-apis/changelog/
Webhooks https://www.canva.dev/docs/apps/rest-apis/webhooks/
OpenAPI spec (YAML) https://www.canva.dev/sources/connect/api/latest/api.yml
Canva MCP https://www.canva.dev/docs/apps/mcp/
MCP tools + rate limits https://www.canva.dev/docs/apps/mcp/tools/
Dev MCP server (docs helper) https://www.canva.dev/docs/apps/dev-mcp-server/
Canva CLI https://www.canva.dev/docs/apps/canva-cli/
Apps SDK (apps inside Canva) https://www.canva.dev/docs/apps/apps-inside-canva/
Developer Portal https://www.canva.com/developers/apps

1. Set up the app and credentials

  1. In the Developer Portal, create an app. Under Outside Canva → Configuration → Integration methods, turn on Canva REST APIs, Canva MCP, or both. Copy the client ID and generate a client secret.
  2. Select the scopes and add at least one redirect URL. Only scopes enabled here can be requested at runtime.

Only the client secret is a secret. Put it in the vault, or in .env.local for local development:

CANVA_CLIENT_SECRET=cnvca_...
Setting Value Notes
CANVA_CLIENT_ID from the Developer Portal Identifies the app; not a secret, but keep it server-side with the secret
CANVA_REDIRECT_URI https://<app>/api/canva/callback Must exactly match a URL registered in the Portal
REST base URL https://api.canva.com/rest
OAuth token host https://api.canva.com/auth Spec's primary server; /rest is listed as deprecated

Each user's access and refresh tokens belong in your database, encrypted, keyed by user. They do not go in environment variables.

2. Authentication (OAuth 2.0 Authorization Code + PKCE)

  1. Generate a code_verifier (43–128 chars) and code_challenge = base64url(sha256(verifier)). Generate a random state as well. Store both server-side.
  2. Redirect the user to https://www.canva.com/api/oauth/authorize?code_challenge=…&code_challenge_method=s256&scope=…&response_type=code&client_id=…&state=…&redirect_uri=….
  3. On the callback, check state, then POST /v1/oauth/token with grant_type=authorization_code, code, and code_verifier. Authenticate with HTTP Basic (base64(client_id:client_secret)), which Canva recommends.
  4. Call the APIs with Authorization: Bearer <access_token>.

Rules that cause production bugs:

Common scopes:

Scope Grants
design:meta:read List or get designs; poll autofill jobs
design:content:read Read design content; export; read design datasets
design:content:write Create designs, autofill, imports, resizes (with read)
asset:read / asset:write Read / upload, update, or delete assets
brandtemplate:meta:read List or get brand templates
brandtemplate:content:read Read a brand template's dataset (autofill fields)
brandtemplate:content:write Publish a design as a brand template (preview)
folder:read / folder:write / folder:permission:write Folders
comment:read / comment:write Comments (preview APIs)
profile:read User profile and capabilities
collaboration:event Receive webhooks

3. Plans and capabilities (check before calling)

Some APIs are tied to the user's Canva plan. They declare an x-required-capabilities value in the spec. If the user lacks the capability, the call fails with 403. Call GET /v1/users/me/capabilities (scope profile:read, 10 req/min) first and hide UI the user can't use.

Capability values: autofill, brand_template, resize, design_generation, background_removal, export_png_transparency, image_to_design_imports, analytics, team_restricted_app.

Feature Who can use it (per canva.dev, 2026-10-20)
Autofill (designs + brand templates) Canva Pro (incl. Education, Nonprofits), Teams, Enterprise. Opened beyond Enterprise on 2026-09-21; "usage limits will be introduced in the future"
Brand templates (list, get, dataset) Plans with brand templates: Pro, Teams, Enterprise
Resize resize capability (Pro and above; Free gets a limited trial via MCP)
Export export_quality: "pro", transparent PNG Pro and above. Premium elements without a licence give license_required
Free-plan PNG export Can't upscale a fixed-size design by more than 1.125×
Design analytics (preview) analytics capability
Design/image generation, background removal (preview) Uses the user's Canva AI credits

Canva's Help Center contradicts itself on autofill plans. One page says Enterprise only; another says every plan except Free and Pro Lite. Trust the capability check, not a plan name. See NOTES.md.

4. Brand template autofill (the high-leverage feature)

A designer builds a template with named data fields. Your server then fills those fields from data, at scale.

sequenceDiagram
  participant S as "codeAmani server"
  participant API as "Canva REST APIs"
  S->>API: "GET /v1/brand-templates/{id}/dataset"
  API-->>S: "field names + types"
  S->>API: "POST /v1/autofills - type + data"
  API-->>S: "job.id, status in_progress"
  loop "exponential backoff"
    S->>API: "GET /v1/autofills/{jobId}"
    API-->>S: "status success + result.design"
  end
  S->>S: "export, or send the user to urls.edit_url"

POST /v1/autofills accepts three type modes. All of them are GA as of 2026-08-25:

type Source Result
create_from_brand_template (default if type is omitted) brand_template_id New design in the user's root folder
create_from_design design_id of a design with data fields New design
update_design design_id Fills the same design in place

Data value types: text (text), image (asset_id), video (asset_id, placed into an image field), chart (chart_data, max 100 rows × 20 columns, optional column_configs), and sheet (sheet_data). Number cells with formatting metadata and media cells are rejected for chart and sheet.

curl -X POST 'https://api.canva.com/rest/v1/autofills' \
  -H "Authorization: Bearer $CANVA_ACCESS_TOKEN" -H "Content-Type: application/json" \
  -d '{"type":"create_from_brand_template","brand_template_id":"DAFVztcvd9z",
       "title":"Fall promo - October",
       "data":{
         "headline":{"type":"text","text":"20% off this week"},
         "hero":{"type":"image","asset_id":"Msd59349ff"}
       }}'
# -> { "job": { "id": "...", "status": "in_progress" } }

Gotchas:

5. Export a design (async job)

curl -X POST 'https://api.canva.com/rest/v1/exports' \
  -H "Authorization: Bearer $CANVA_ACCESS_TOKEN" -H "Content-Type: application/json" \
  -d '{"design_id":"DAVZr1z5464","format":{"type":"png","export_quality":"regular"}}'
# poll GET /v1/exports/{exportId} until status == success -> job.urls[]

6. Upload an asset

# Binary (GA): name goes base64-encoded in a header
curl -X POST 'https://api.canva.com/rest/v1/asset-uploads' \
  -H "Authorization: Bearer $CANVA_ACCESS_TOKEN" -H "Content-Type: application/octet-stream" \
  -H 'Asset-Upload-Metadata: {"name_base64":"aGVyby5wbmc="}' --data-binary '@hero.png'

# From a public URL (PREVIEW API; videos limited to 100 MB)
curl -X POST 'https://api.canva.com/rest/v1/url-asset-uploads' \
  -H "Authorization: Bearer $CANVA_ACCESS_TOKEN" -H "Content-Type: application/json" \
  -d '{"name":"hero","url":"https://cdn.example.com/hero.png"}'

Poll GET /v1/asset-uploads/{jobId} or GET /v1/url-asset-uploads/{jobId}. On success the response contains job.asset.id. URL uploads are a preview API. Public apps that use preview APIs fail Canva's review, so production code should use the binary upload.

7. Canva CLI (@canva/cli)

npm i -g @canva/cli. The package declares node >=22; the docs ask for Node v24 and npm v11. canva login stores an encrypted token locally, and canva logout revokes it.

Command Purpose
canva apps create "Name" --template=hello_world --distribution=public --git --installDependencies Scaffold an Apps SDK app
canva apps start / build / upload / doctor / migrate Dev server, production build, upload a bundle, health check, migrate to @canva/app-scripts
canva api designs list | jq '.data.items[].id' New: call the REST APIs with your CLI login. Output is one JSON object {ok,data,next,meta}, which suits agents
canva api describe exports create Show an operation's scopes, capabilities, rate limit, and flags
canva api post /v1/designs --body @body.json Raw request to any REST path
canva profile switch work / --profile / CANVA_CLI_PROFILE Multiple stored logins
canva mcp Start the Dev MCP server (docs and SDK help, not design access)

If you logged in with a CLI version older than the api command, run canva login again so the stored token carries the REST scopes.

8. Canva MCP server (Canva for AI assistants)

Canva runs a remote MCP server that exposes design generation, editing transactions, search, autofill, export, resize, comments, folders, and image tools. Every user authenticates individually. There is no org-wide service account, and tools only see what that user can see in Canva.

Use case Endpoint and setup
codeAmani devs in Claude Code / claude.ai The claude.ai Canva connector is already wired in. Tools appear as mcp__claude_ai_Canva__* (generate-design, autofill-design, export-design, resize-design, …). The Canva plugin skills (canva:*) build on them
Embedding Canva in our own AI product Register an app, turn on Canva MCP, and use client ID and secret against https://api.canva.com/connect/v1/mcp (streamable HTTP; per-user OAuth). If the client has no remote-MCP support, use the mcp-remote stdio bridge
Public "Canva AI Connector" https://mcp.canva.com/mcp (OAuth with dynamic registration; consumer assistants use it). canva.dev doesn't document this URL; it was verified live via its OAuth metadata
Writing Apps SDK code with AI claude mcp add canva-dev -- npx -y @canva/cli@latest mcp (local stdio Dev MCP server)

MCP limits and plans (from /docs/apps/mcp/tools/):

9. Webhooks and return navigation

10. Other REST APIs worth knowing

API Status Notes
Designs: create (preset/custom), list, get, pages, export-formats, dataset GA. Create-by-copy (type: design) and create-from-brand-template are preview Custom designs: each side 40–8000 px, max 25M px². Blank designs are auto-deleted if left unedited
Resizes (POST /v1/resizes) GA, needs the resize capability 20/min
Design imports (file, URL) GA Import PDF/PPTX and similar files as editable designs
Folders GA list items can include brand_template items
Comments, image-to-design imports, merges, design generations (2026-09-29), image generations (2026-10-01), image transformations (background removal), analytics, publish brand template Preview Generation and transformation consume Canva AI credits. Don't ship preview APIs in public apps

Rate limits (REST, requests/min/client-user, from the OpenAPI spec)

Over the limit returns 429 with error code too_many_requests. Back off exponentially and honour Retry-After.

Operation Limit
Create design / resize / import / export 20
Create asset upload (binary or URL) 30
Poll asset upload 180
Create autofill 60
Poll autofill / export / resize / import 120
List / get brand templates, get dataset 100
Publish brand template (preview) 20
Get/list designs, folders, assets 100
users/me, capabilities, profile, OIDC userinfo 10

Exports have extra throttles; see §5.

11. Apps SDK (apps inside Canva)

Use the Apps SDK only for in-editor apps. It runs in an iframe with a strict CSP, and your backend must allow CORS. All new apps must implement at least one intent: Content Publisher, Data Connector, Design Editor, or URL Expander.

Package Version (npm, 2026-10-20)
@canva/app-ui-kit 5.15.0
@canva/design 2.13.1
@canva/intents 2.7.1
@canva/asset 2.3.1
@canva/user 2.3.0
@canva/platform 2.2.3
@canva/error 2.2.2
@canva/app-components 2.8.1
@canva/app-i18n-kit 1.3.0
@canva/app-scripts 1.1.2

Canva injects the SDK methods at runtime; the npm packages contain only type declarations. Rolling a package back therefore never fixes a runtime bug. Preview methods ship under the @beta dist-tag, and apps that use them fail app review.

codeAmani notes

Official docs: