Design Editing API now supports Multi-Page Editing in Beta!

Hey folks! :waving_hand:

We’re excited to announce that the Design Editing API now supports Multi-Page Editing in Beta!

What it does

The new all_pages design context lets your apps work across ALL pages in a design, not just the current page. You can now iterate through and edit every page in a multi-page design.

Why it matters

Until now, apps were limited to editing only the current page. This was a major limitation for bulk editing workflows - imagine needing to update brand colors across 50 presentation slides! This unlocks a whole new category of powerful design tools! :rocket:

How to use it

1. Switch to the preview package to access the new APIs:

npm install @canva/design@beta

2. Use the new context: all_pages, and use session.helpers.openPage() to iterate through session.pageRefs (a catalog of all pages) and edit individual pages:

openDesign({ type: 'all_pages' }, async session => {
  for (const pageRef of session.pageRefs.toArray()) {
    if (pageRef.type !== 'absolute' || pageRef.locked) continue;

    await session.helpers.openPage(pageRef, async pageResult => {
      pageResult.page.elements.forEach(element => {
        if (element.type === 'unsupported' || element.locked) return;

        // Update all supported elements across all pages
        element.top += 10;
        element.left += 10;
      });
    });
  }
  await session.sync(); // Apply all changes at once
});

Docs & details

Happy bulk editing!

5 Likes

wow this is stellar! Cant wait for my team to try it soon. Thankyou!

1 Like

I’ve been waiting for this API for a year - ty for building it out!

I would also love:

  • All elements returning some sort of a UUID so I can keep tracking of which elements to edit and which to not. Same for the pages, they should return some sort of an ID.
  • Being able to use the existing Canva assets in designs without having to upload, get refs.
2 Likes

@sssaini1995 Currently, you should be able to get refs from existing elements in a design. May I ask your use case?

I’m more speaking about the community assets Canva already has.

I’m helping people create social media carousels and I want to be able to use the publicly available Canva assets but I don’t think I can

@sssaini1995 Did you mean that you’d like a way to conveniently get the ref of any publicly available asset?

Currently, you could use the Selection API as a workaround.

2 Likes