Templates as parameters
A MostlyRender template is a canvas (width × height, background) plus a stack of named layers. The key idea:
The layer name is the API parameter. To change what a layer shows at render time, send
modificationskeyed by the layer’s name.
# Modifications
Given a template with a text layer named title, an image layer named photo, and a
QR layer named link:
{
"template": "tpl_abc",
"modifications": {
"title": "Renders that never go dark",
"photo": "https://example.com/hero.jpg",
"link": "https://mostlyrender.com"
}
}
- A string on a text layer sets its text.
- A string on an image layer sets its
src. - A string on a QR layer sets the encoded value.
- An object is merged into the layer, so you can override styling too:
{ "modifications": { "title": { "text": "On sale", "color": "#e11d48" } } }
Layers you don’t mention keep their designed defaults. Unknown layer names are ignored.
# Listing templates
curl https://api.mostlyrender.com/v1/templates \
-H "Authorization: Bearer mr_live_…"
{
"templates": [
{ "id": "tpl_abc", "name": "Launch card", "width": 1200, "height": 630, "engine": "layers" }
]
}
Use the id as the template in a render call. Manage templates (create, edit,
delete) in the app editor.