get-assets
Use get-assets to look up the images or videos on a page, for example to work out which one the user means before changing it. Asset IDs come from the fills returned by start-editing-transaction.
Example prompt
"Which of the photos on slide 3 is the team photo? Swap that one out."
Pass asset_ids, an array of image or video IDs.
Example response
IDs, URLs, and tokens below are placeholders; field names and structure are exactly as returned.
The result is a list of content blocks rather than one JSON value. For each requested ID, in the order you supplied them, there's a text block holding that asset's JSON, followed by an image block with the asset itself when the lookup succeeded. A request for two IDs where the second can't be found returns three blocks:
-
A text block for the first ID:
{"asset": {"type": "image","id": "ASSET_EXAMPLE_1","name": "Team photo","tags": ["team", "offsite"],"created_at": 1758000000,"updated_at": 1758000000,"owner": { "user_id": "USER_EXAMPLE", "team_id": "TEAM_EXAMPLE" },"thumbnail": {"width": 595,"height": 335,"url": "https://document-export.canva.com/EXAMPLE_THUMBNAIL"},"import_status": { "state": "success" },"metadata": { "type": "image", "width": 1920, "height": 1080, "smart_tags": ["people", "outdoors"] }}}JSON -
An image block containing the first asset's image data.
-
A text block for the second ID:
{ "error": { "code": "asset_not_found", "message": "<human-readable description>" } }JSON
asset.type is image or video, and metadata carries the dimensions (and duration for videos) when available. The call succeeds as a whole even if individual assets fail, so check each text block.
Thumbnail URLs expire after 15 minutes. Use them immediately, and don't store or share them.