← Back to dashboard

Canva Integration Guide

What is Canva for developers?

The real model

PKCE → single-use refresh tokens → capability check → POST /v1/autofills → poll → POST /v1/exports → copy to R2 within 24 h.

Exchange the code at api.canva.com/auth/v1/oauth/token with HTTP Basic client auth; access tokens last 4 h (up to 4 KB) and each refresh token works exactly once, so persist the new one inside a per-user lock. Autofill takes type create_from_brand_template | create_from_design | update_design, with text, image/video (asset_id, never a URL), chart (≤100×20) and sheet values — read field names from the dataset endpoint first. Limits are per user per minute: autofill 60, export 20 (plus 75 per 5 min / 500 per day per user), polls 120. url-asset-uploads, generations, comments and merges are preview APIs — fine internally, but they fail Canva's public app review. For scripts, @canva/cli 2.14.1 adds canva api … with a JSON envelope; for AI products, point an MCP client at api.canva.com/connect/v1/mcp.

Five Canva primitives

Per-user OAuth plus async jobs; autofill is the reason to reach for it.

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

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.

SurfaceWhat it isWhen codeAmani uses it
Canva for your platform (REST APIs, formerly "Connect API")REST at https://api.canva.com/rest/v1/, per-user OAuthDefault. Server-side autofill, export, and asset sync
Canva for AI assistants (Canva MCP server)Remote MCP server exposing Canva as toolsAd-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/* packagesOnly if we ship a Canva Marketplace or team app

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

  • Write plain fetch calls. See examples/canva-rest.ts, which is type-checked.
  • Generate a client from the public OpenAPI description (https://www.canva.dev/sources/connect/api/latest/api.yml, API version 2024-06-18). The official Starter Kit does this with @hey-api/openapi-ts.
  • Use the Canva CLI canva api … commands for scripts and agents (see §7).

Official Documentation


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:

Bash
CANVA_CLIENT_SECRET=cnvca_...
SettingValueNotes
CANVA_CLIENT_IDfrom the Developer PortalIdentifies the app; not a secret, but keep it server-side with the secret
CANVA_REDIRECT_URIhttps://<app>/api/canva/callbackMust exactly match a URL registered in the Portal
REST base URLhttps://api.canva.com/rest
OAuth token hosthttps://api.canva.com/authSpec'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:

  • Access tokens last 4 hours (expires_in: 14400, "subject to change") and can be up to 4 KB, so size DB columns accordingly.
  • Each refresh token works only once. Every refresh returns a new refresh token. Persist it atomically, and serialize refreshes per user so two workers don't race on the same token.
  • Scopes are not cumulative. asset:write does not grant asset:read; request both. On refresh you can narrow the scope but not widen it.
  • Token calls are server-only. Canva's CORS policy blocks browser calls that carry the client secret.
  • Token host: the OpenAPI spec lists https://api.canva.com/auth/v1/oauth/token as primary and https://api.canva.com/rest/v1/oauth/token as deprecated. The current reference page examples still show the /rest form. Both work. See NOTES.md.
  • POST /v1/oauth/introspect checks a token. POST /v1/oauth/revoke revokes one, for example when a user disconnects.
  • OIDC is available: the openid, profile, and email scopes, plus GET https://api.canva.com/auth/v1/oidc/userinfo (10 req/min).

Common scopes:

ScopeGrants
design:meta:readList or get designs; poll autofill jobs
design:content:readRead design content; export; read design datasets
design:content:writeCreate designs, autofill, imports, resizes (with read)
asset:read / asset:writeRead / upload, update, or delete assets
brandtemplate:meta:readList or get brand templates
brandtemplate:content:readRead a brand template's dataset (autofill fields)
brandtemplate:content:writePublish a design as a brand template (preview)
folder:read / folder:write / folder:permission:writeFolders
comment:read / comment:writeComments (preview APIs)
profile:readUser profile and capabilities
collaboration:eventReceive 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.

FeatureWho 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
Resizeresize capability (Pro and above; Free gets a limited trial via MCP)
Export export_quality: "pro", transparent PNGPro and above. Premium elements without a licence give license_required
Free-plan PNG exportCan'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.

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

typeSourceResult
create_from_brand_template (default if type is omitted)brand_template_idNew design in the user's root folder
create_from_designdesign_id of a design with data fieldsNew design
update_designdesign_idFills 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.

Bash
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:

  • Get field names from GET /v1/brand-templates/{id}/dataset. For designs, use GET /v1/designs/{id}/dataset. Never hard-code them; designers rename fields.
  • Image and video fields take an asset_id, never a URL. Upload the file first (§6).
  • Job error codes: autofill_error, thumbnail_generation_error, create_design_error, design_approval_error, design_update_error, and trial_quota_exceeded. The last one applies to users on a plan without autofill who have a limited trial. result.trial_information (uses_remaining, upgrade_url) is itself a preview field.
  • GET /v1/brand-templates?dataset=non_empty lists only templates that have autofill fields.

5. Export a design (async job)

Bash
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[]
  • Formats: pdf, jpg (requires quality), png, pptx, gif, mp4 (requires quality), html_bundle, html_standalone (email designs), and csv (Canva Sheets only). Call GET /v1/designs/{id}/export-formats to see what a given design supports, page by page.
  • export_quality: regular (default) or pro. A pro export can fail with license_required if the design has premium elements and the user's plan doesn't cover them.
  • Other error codes: approval_required (the design needs reviewer approval) and internal_failure.
  • MP4 quality (horizontal_1080p, vertical_4k, and so on) is a target pixel count. Since 2026-09-18 the video keeps the design's own aspect ratio, so a square design at *_4k comes out 2880×2880.
  • urls[] are valid for 24 hours, served from export-download.canva.com. You get one per page for some formats. Download them and store the files in R2.
  • Export-specific throttles, on top of 20 create requests/min/user:
    • App: 750 per 5 min and 5,000 per 24 h
    • Document: 75 per 5 min
    • User: 75 per 5 min and 500 per 24 h

6. Upload an asset

Bash
# 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.

CommandPurpose
canva apps create "Name" --template=hello_world --distribution=public --git --installDependenciesScaffold an Apps SDK app
canva apps start / build / upload / doctor / migrateDev 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 createShow an operation's scopes, capabilities, rate limit, and flags
canva api post /v1/designs --body @body.jsonRaw request to any REST path
canva profile switch work / --profile / CANVA_CLI_PROFILEMultiple stored logins
canva mcpStart 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 caseEndpoint and setup
codeAmani devs in Claude Code / claude.aiThe 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 productRegister 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 AIclaude mcp add canva-dev -- npx -y @canva/cli@latest mcp (local stdio Dev MCP server)

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

  • Each tool has its own per-minute limit, for example generate-design 20, generate-image 10, export-design 20, autofill-design 60, and perform-editing-operations 50.
  • Tools without their own limit share a cap of 300 req/min per user, counted across all of that user's MCP clients.
  • autofill-design, the brand-template tools, list-brand-kits, and resize-design need Pro or above. Everything else works on all plans.
  • generate-design can be slow, so set client timeouts to about 60 s.
  • Allow responses from both the canva.com and canva.ai domains.
  • Team admins can turn the AI Connector off for the whole team. When they do, existing connections stop working.

9. Webhooks and return navigation

  • Webhooks need the collaboration:event scope, plus a per-type scope; for example, comments also need design:meta:read and comment:read. Types include comment, share_design, share_folder, design_approval_*, design_access_requested, folder_access_requested, design_mention, suggestion, and team_invite. Reply with 200 quickly and do the work async.
  • Verify every webhook. Canva publishes Ed25519 public keys (JWK, kid-rotated) at GET https://api.canva.com/rest/v1/connect/keys. That endpoint is public and currently preview. Cache keys by kid and refetch only when you see an unknown kid.
  • Return navigation: when a user finishes editing in Canva, they are redirected to your app with a correlation_jwt query parameter. Verify it with jose.jwtVerify(token, createRemoteJWKSet(keysUrl), { audience: CANVA_CLIENT_ID }), as the Starter Kit does (see examples/canva-rest.ts).

10. Other REST APIs worth knowing

APIStatusNotes
Designs: create (preset/custom), list, get, pages, export-formats, datasetGA. Create-by-copy (type: design) and create-from-brand-template are previewCustom 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 capability20/min
Design imports (file, URL)GAImport PDF/PPTX and similar files as editable designs
FoldersGAlist 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 templatePreviewGeneration 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.

OperationLimit
Create design / resize / import / export20
Create asset upload (binary or URL)30
Poll asset upload180
Create autofill60
Poll autofill / export / resize / import120
List / get brand templates, get dataset100
Publish brand template (preview)20
Get/list designs, folders, assets100
users/me, capabilities, profile, OIDC userinfo10

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.

PackageVersion (npm, 2026-10-20)
@canva/app-ui-kit5.15.0
@canva/design2.13.1
@canva/intents2.7.1
@canva/asset2.3.1
@canva/user2.3.0
@canva/platform2.2.3
@canva/error2.2.2
@canva/app-components2.8.1
@canva/app-i18n-kit1.3.0
@canva/app-scripts1.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

  • Default path: use the REST APIs from a Next.js route handler or server action. The client secret and per-user tokens never reach the browser. Store tokens encrypted in Supabase/Neon, and serialize refreshes because refresh tokens are single-use.
  • Brand templates + autofill are still the highest-leverage feature. Autofill is now available on Pro and Teams, so small US business customers on Canva Pro can use it. Gate the UI on GET /v1/users/me/capabilities (autofill, brand_template) rather than assuming a plan.
  • Persist exports: copy urls[] into R2 (the same pipeline as the dashboard thumbnails at thumbs.codeamanilabs.org) within 24 h. Never store the Canva URL itself.
  • AI routing: Canva's generation APIs and MCP tools spend the user's Canva AI credits, not our Anthropic or OpenAI budget. Use Claude for copy and structure, then Canva to render on-brand designs.
  • Payments: Canva is a design dependency, not a payment rail. Stripe stays the default. M-Pesa applies only to Kenya-targeted projects, for example the duka-order-bot promo graphics.
  • Kenya-targeted apps: autofill output can carry KES pricing text, for example "KES 499". Export compressed jpg or png at small sizes for 2G/3G WhatsApp delivery rather than large PDFs.
  • Preview APIs: fine for internal tools, never for anything we publish to Canva's Marketplace.