Dynamic elements let you change any part of your design via API.
How It Works
- In the editor, name your layers (e.g.,
product_title,user_avatar) - In your API call, reference those names in
dynamicElements - The API replaces the content and generates your image
Basic Example
Design has a text layer named "greeting":
json{ "designId": "abc123", "dynamicElements": { "greeting": { "text": "Hello, Sarah!" } } }
Changing Multiple Properties
You can change more than just content:
json{ "dynamicElements": { "main_title": { "text": "Summer Sale", "fill": "#FF5733", "fontSize": 72 }, "product_image": { "src": "https://example.com/product.jpg" }, "price_tag": { "text": "$29.99", "fill": "#00AA00" } } }
Available Properties
For Text Elements:
text- The text contentfill- Text color (hex)fontSize- Size in pixelsfontFamily- Font namefontWeight- bold, normal, etc.
For Image Elements:
src- Image URLopacity- 0 to 1
For All Elements:
x,y- Positionwidth,height- Sizerotation- Degreesvisible- true/false
Finding Element Names
- Open your design in the editor
- Click on any element
- Look for "Layer Name" in the right panel
- Use that exact name in your API call