Canva

Learn how to use Canva with Composio

Overview

SLUG: CANVA

Description

Canva offers a drag-and-drop design suite for creating social media graphics, presentations, and marketing materials with prebuilt templates and a vast element library

Authentication Details

client_id
stringRequired
client_secret
stringRequired
oauth_redirect_uri
stringDefaults to https://backend.composio.dev/api/v1/auth-apps/add
scopes
stringDefaults to app:read,app:write,asset:read,asset:write,brandtemplate:content:read,brandtemplate:meta:read,comment:read,comment:write,design:content:read,design:content:write,design:meta:read,design:permission:read,design:permission:write,folder:read,folder:write,folder:permission:read,folder:permission:write,profile:read
bearer_token
string

Connecting to Canva

Create an auth config

Use the dashboard to create an auth config for the Canva toolkit. This allows you to connect multiple Canva accounts to Composio for agents to use.

1

Select App

Navigate to Canva.

2

Configure Auth Config Settings

Select among the supported auth schemes of and configure them here.

3

Create and Get auth config ID

Click “Create Canva Auth Config”. After creation, copy the displayed ID starting with ac_. This is your auth config ID. This is not a sensitive ID — you can save it in environment variables or a database. This ID will be used to create connections to the toolkit for a given user.

Connect Your Account

Using OAuth2

1from composio import Composio
2
3# Replace these with your actual values
4canva_auth_config_id = "ac_YOUR_CANVA_CONFIG_ID" # Auth config ID created above
5user_id = "0000-0000-0000" # UUID from database/application
6
7composio = Composio()
8
9
10def authenticate_toolkit(user_id: str, auth_config_id: str):
11 connection_request = composio.connected_accounts.initiate(
12 user_id=user_id,
13 auth_config_id=auth_config_id,
14 )
15
16 print(
17 f"Visit this URL to authenticate Canva: {connection_request.redirect_url}"
18 )
19
20 # This will wait for the auth flow to be completed
21 connection_request.wait_for_connection(timeout=15)
22 return connection_request.id
23
24
25connection_id = authenticate_toolkit(user_id, canva_auth_config_id)
26
27# You can also verify the connection status using:
28connected_account = composio.connected_accounts.get(connection_id)
29print(f"Connected account: {connected_account}")

Tools

Executing tools

To prototype you can execute some tools to see the responses and working on the Canva toolkit’s playground

Python
1from composio import Composio
2from openai import OpenAI
3import json
4
5openai = OpenAI()
6composio = Composio()
7
8# User ID must be a valid UUID format
9user_id = "0000-0000-0000" # Replace with actual user UUID from your database
10
11tools = composio.tools.get(user_id=user_id, toolkits=["CANVA"])
12
13print("[!] Tools:")
14print(json.dumps(tools))
15
16def invoke_llm(task = "What can you do?"):
17 completion = openai.chat.completions.create(
18 model="gpt-4o",
19 messages=[
20 {
21 "role": "user",
22 "content": task, # Your task here!
23 },
24 ],
25 tools=tools,
26 )
27
28 # Handle Result from tool call
29 result = composio.provider.handle_tool_calls(user_id=user_id, response=completion)
30 print(f"[!] Completion: {completion}")
31 print(f"[!] Tool call result: {result}")
32
33invoke_llm()

Tool List

Tool Name: Revoke oauth tokens

Description

Revoke a refresh token to end its lineage and user consent, requiring re-authentication. authenticate using either basic access with base64-encoded credentials or body parameters with client id and secret.

Action Parameters

client_id
string
client_secret
string
token
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Access user specific brand templates list

Description

This year, brand template ids will change; integrations storing them must update within 6 months. also, api use requires canva enterprise membership.

Action Parameters

continuation
string
dataset
string
ownership
string
query
string
sort_by
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create canva design with optional asset

Description

Create a new canva design using a preset or custom dimensions, and add an asset with `asset id` from a user's project using relevant apis.

Action Parameters

asset_id
string
title
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create comment reply in design

Description

This preview api allows replying to comments within a design on canva, with a limit of 100 replies per comment. users should note potential unannounced changes, and that preview apis are not eligible for public integrations.

Action Parameters

commentId
stringRequired
message
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create design comment in preview api

Description

This api is in preview and may change without notice; integrations using it won't pass review. it allows creating comments on a design, with a limit of 1000 comments per design.

Action Parameters

assignee_id
string
message
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create user or sub folder

Description

This api creates a folder in a canva user's projects at the top level or within another folder, returning the new folder's id and additional details upon success.

Action Parameters

name
stringRequired
parent_folder_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete asset by id

Description

You can delete an asset by specifying its `assetid`. this operation mirrors the behavior in the canva ui. deleting an item moves it to the trash. deleting an asset doesn't remove it from designs that already use it.

Action Parameters

assetId
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Exchange oauth 2 0 access or refresh token

Description

The oauth 2.0 endpoint issues time-limited (4-hour) access tokens of up to 4kb for user authorization via codes or refresh tokens. it requires client id/secret for authentication.

Action Parameters

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Fetch asset upload job status

Description

Summarize asset upload outcome by repeatedly calling the endpoint until a 'success' or 'failed' status is received after using the create asset upload job api.

Action Parameters

jobId
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Fetch canva connect signing public keys

Description

The api for verifying canva webhooks, 'connect/keys,' is in preview, meaning unstable, not for public integrations, and provides a rotating jwk for signature verification to prevent replay attacks. cache keys for efficiency.

Action Parameters

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Fetch current user details

Description

Returns the user id, team id, and display name of the user account associated with the provided access token.

Action Parameters

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Fetch design metadata and access information

Description

Gets the metadata for a design. this includes owner information, urls for editing and viewing, and thumbnail information.

Action Parameters

designId
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get design export job result

Description

Get the outcome of a canva design export job; if done, receive download links for the design’s pages. for details, visit the create design export job api documentation.

Action Parameters

exportId
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Initiates canva design export job

Description

Canva's new job feature exports designs in multiple formats using a design id, with provided download links. the export status can be tracked via an api. exports with 'pro' quality may fail if the design contains unpaid premium elements.

Action Parameters

design_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Initiate canva design autofill job

Description

Upcoming brand template id updates require migration within 6 months. canva enterprise users can auto-fill designs using various data types, including experimental chart data. monitor jobs with specific api.

Action Parameters

brand_template_id
stringRequired
data
objectRequired
title
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List design pages with pagination

Description

Preview api for canva: subject to unannounced changes and not for public integrations. lists metadata for design pages with optional `offset` and `limit`; not applicable to all design types.

Action Parameters

designId
stringRequired
limit
integerDefaults to 50
offset
integerDefaults to 1

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List folder items by type with sorting

Description

Lists the items in a folder, including each item's `type`. folders can contain: - other folders. - designs, such as instagram posts, presentations, and documents ([canva docs](https://www.canva.com/create/documents/)). - image assets.

Action Parameters

continuation
string
folderId
stringRequired
item_types
array
sort_by
stringDefaults to modified_descending

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List User Designs

Description

Provides a summary of canva user designs, includes search filtering, and allows showing both self-created and shared designs with sorting options.

Action Parameters

continuation
string
ownership
string
query
string
sort_by
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Move item to specified folder

Description

Transfers an item to a different folder by specifying both the destination folder's id and the item's id. if the item is in various folders, an error occurs; manual relocation via canva ui is required.

Action Parameters

item_id
stringRequired
to_folder_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Remove folder and move contents to trash

Description

Deletes a folder by moving the user's content to trash and reassigning other users' content to their top-level projects.

Action Parameters

folderId
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Retrieve app public key set

Description

Returns the json web key set (public keys) of an app. these keys are used to verify jwts sent to app backends.

Action Parameters

appId
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Retrieve asset metadata by id

Description

You can retrieve the metadata of an asset by specifying its `assetid`.

Action Parameters

assetId
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Retrieve a specific design comment

Description

This preview api is subject to unannounced changes and can't be used in public integrations. it retrieves a comment, details of which are on canva help center.

Action Parameters

commentId
stringRequired
designId
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Retrieve brand template dataset definition

Description

Canva's brand template ids will change later this year, including a 6-month integration migration. api access requires enterprise membership, providing autofill for images, text, and charts, although chart data could change during preview.

Action Parameters

brandTemplateId
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Retrieve canva enterprise brand template metadata

Description

Upcoming update will change brand template ids; integrations must migrate within 6 months. api use requires canva enterprise membership.

Action Parameters

brandTemplateId
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Retrieve design autofill job status

Description

Api users with canva enterprise membership can retrieve design autofill job results, potentially requiring multiple requests until a `success` or `failed` status is received.

Action Parameters

jobId
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Retrieve design import job status

Description

Gets the status and results of design import jobs created using the [create design import job api](https://www.canva.dev/docs/connect/api-reference/design-imports/create-design-import-job/).

Action Parameters

jobId
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Retrieve folder details by id

Description

Gets the name and other details of a folder using a folder's `folderid`.

Action Parameters

folderId
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Retrieveuserprofiledata

Description

Currently, this returns the display name of the user account associated with the provided access token. more user information is expected to be included in the future.

Action Parameters

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update asset s name and tags by id

Description

You can update the name and tags of an asset by specifying its `assetid`. updating the tags replaces all existing tags of the asset.

Action Parameters

assetId
stringRequired
name
string
tags
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update folder details by id

Description

Updates a folder's details using its `folderid`. currently, you can only update a folder's name.

Action Parameters

folderId
stringRequired
name
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Validate oauth token properties

Description

Check an access token's validity and properties via introspection, requiring authentication. use basic access (base64 encoded `client id:client secret`) or body parameters for credentialing.

Action Parameters

client_id
string
client_secret
string
token
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired