To add an embed element to the user's design, set the following parameters:
The type of element. For embed elements, this must be "EMBED"
.
The URL of the embeddable media.
The width of the element, in pixels.
The height of the element, in pixels.
The distance from the top edge of the container, in pixels.
The distance from the left edge of the container, in pixels.
The rotation of the element, in degrees. This must be a number between -180
and 180
.
To add a group element to the user's design, set the following parameters:
The type of element. For group elements, this must be "GROUP"
.
The elements to include in the group.
The width of the element, in pixels.
The height of the element, in pixels.
The distance from the top edge of the page, in pixels.
The distance from the left edge of the page, in pixels.
The rotation of the element, in degrees. This must be a number between -180
and 180
.
To add an image element to the user's design, set the following parameters:
The type of element. For image elements, this must be "IMAGE"
.
A unique identifier that points to an image in Canva's backend.
The width of the element, in pixels.
The height of the element, in pixels.
The distance from the top edge of the container, in pixels.
The distance from the left edge of the container, in pixels.
The rotation of the element, in degrees. This must be a number between -180
and 180
.
To add a shape element to the user's design, set the following parameters:
The type of element. For shape elements, this must be "SHAPE"
.
The paths that define the shape of the element.
The shape of the path.
The appearance of the path's interior.
If true
, users can drop images or videos onto the path to use them as a fill.
The color of the fill as a hex code.
If set, a user can fill a shape with an asset.
The type of asset to fill the shape.
The unique identifier of the paths[0].fill.asset.type
asset to fill the shape.
The weight of the stroke. This must be an integer between 0 and 100.
The color of the stroke as a hex code.
The alignment of the stroke. The only supported value is "inset"
.
The scale and cropping of a shape. This is similar to the viewBox
attribute of a HTMLSVGElement
.
The width of the view box, in pixels.
The height of the view box, in pixels.
The distance of the shape from the top edge of the element, in pixels.
The distance of the shape from the left edge of the element, in pixels.
The width of the element, in pixels.
The height of the element, in pixels.
The distance from the top edge of the container, in pixels.
The distance from the left edge of the container, in pixels.
The rotation of the element, in degrees. This must be a number between -180
and 180
.
To add a text element to the user's design, set the following parameters:
The type of element. For text elements, this must be "TEXT"
.
The text to add to the user's design, provided as a array of strings.
The size of the text. This must be an integer between 1 and 1000. The default value is 16
.
The alignment of the text.
The color of the text as a hex code.
The weight of the font.
The style of the font.
The decoration of the font.
The width of the element, in pixels.
The distance from the top edge of the container, in pixels.
The distance from the left edge of the container, in pixels.
The rotation of the element, in degrees. This must be a number between -180
and 180
.
To add a video element to the user's design, set the following parameters:
The type of element. For video elements, this must be "VIDEO"
.
A unique identifier that points to a video in Canva's backend.
The width of the element, in pixels.
The height of the element, in pixels.
The distance from the top edge of the page, in pixels.
The distance from the left edge of the container, in pixels.
The rotation of the element, in degrees. This must be a number between -180
and 180
.