editContent

API reference for the editContent method.
This version of the API is a preview. Preview APIs are unstable and may change without warning. You can't release public apps using this API until it's stable.

Reads and edits fill content from the user's design.

Parameters

optionsobject
Required

Options for configuring how a design is read. Must specify contentType: 'fill'.

targetstring
Required

This must be "current_page".

contentTypestring
Required

This must be "fill".

callbackfunction
Required

A callback that receives a FillContentSession for editing.

Parameters

sessionFillContentSession
Required

Session for reading and updating fill content in a user's design.

contentsFillContent[]Read-only
Required

Fill content in the design.

typestring
Required

This must be "image".

refImageRef
Required

A unique identifier that points to an image asset in Canva's backend.

deletedboolean
Required

Indicates whether the object containing this fill has been deleted.

altTextAltText
Optional

A description of the image content.

Use undefined for content with no description.

textstring
Required

The text content.

decorativeboolean | undefined
Required

Indicates where the alternative text should be displayed.

  • If true, the alternative text will only be displayed in the editor.
  • If false, the alternative text will be displayed in the editor and in view-only mode.
typestring
Required

This must be "video".

refVideoRef
Required

A unique identifier that points to an video asset in Canva's backend.

deletedboolean
Required

Indicates whether the object containing this fill has been deleted.

altTextAltText
Optional

A description of the video content.

Use undefined for content with no description.

textstring
Required

The text content.

decorativeboolean | undefined
Required

Indicates where the alternative text should be displayed.

  • If true, the alternative text will only be displayed in the editor.
  • If false, the alternative text will be displayed in the editor and in view-only mode.
syncfunction
Required
  • Any changes in the session are only reflected in the design after this method is called.
  • Once this method is called, further changes in the session can still be made.

Returns

Promise<void>

Returns

void or Promise<void>

Returns

A promise that resolves when editing is complete.

Promise<void>