- Personalise a run: keep a customer name inside the box the designer drew for it, whatever its length.
- Ship a colourway: send the same template out in a new colour without opening the source file.
- Change one run: replace part of a line that mixes styles and leave the rest as designed.
A layer’s uuid, and the fields that say which overrides it takes, come from
the upload response. Text layers covers it and lists
every error and warning code.
Send an override with the render call
fit decides what happens when the new text is wider than the layer’s area,
color and stroke_color set the colour of the text and of the outline around
it, group_layers recolours an outline the enclosing group owns, and
segments replaces one run inside a layer that mixes styles. Each tab below
carries one of them, and the highlighted lines carry the change.
Response format
A render answers with the files it produced and, when something needed attention, awarnings array. A shrink that actually reduced a layer adds
TEXT_FIT_SHRUNK for that layer, so the response alone tells you the text came
out smaller than designed. A render that touches only text and group layers
leaves smart_object_uuid empty.
Render response with a fit warning
Configuration
string
default:"overflow"
What happens when the replacement text is wider than the layer’s area. This
is the text layer’s own value, not
asset.fit on a smart object.overflow: the text keeps its size and may extend past the area.clip: the text keeps its size and is cut to what fits.shrink: the text is scaled down so it stays inside the area.
string
default:"top"
Where smaller text sits in the room it leaves behind. It takes effect only
when
shrink actually reduced a single-style point-text layer.top: the text stays where the designer placed it.center: the text sits in the vertical middle.bottom: the text sits on the bottom edge.
shrink with center is the pairing
that keeps a personalised run looking composed at any length.string
A hex string for the colour you actually see. Designers often give a layer
its final colour through a colour effect rather than the fill, so your value
goes to whichever one defines the visible colour.
has_color_overlay in the
upload response is true when the colour comes from an effect.string | array
The colour of an outline the layer owns, keeping its width and placement.
has_stroke_effect in the upload response is true when the layer has at
least one, and stroke_count gives how many.- A hex string recolours the front outline.
- A front-to-back list recolours a stack, one entry per outline.
nullin any position keeps that outline as designed.
object[]
The styled runs to replace in a layer that mixes styles, which the upload
response marks with
segment_count above 1 and lists under segments. Send
only the runs you want to change. Every run keeps its own font, size and
colour, and a run you leave out keeps its original text.index: the position of the run, read from the upload response.text: the replacement wording for that run.
string
A hex string for an outline owned by an enclosing group, which recolours the
outline around everything inside that group. Take the group uuid from the
layer’s
enclosing_group_layers.Limitations
When overriding text layers, keep in mind:fitapplies to single-style layers. Paragraph, or box, layers wrap on their own and layers that mix styles keep their own layout.- A gradient effect covering the text returns
TEXT_COLOR_HIDDEN_BY_EFFECT, because the requested colour may not be visible in the result. - A layer with no outline of its own accepts
stroke_color, returnsTEXT_STROKE_NOT_PRESENTand ignores it. Stack entries paststroke_countare ignored the same way. - Sending
textto a layer that mixes styles returnsTEXT_SEGMENTS_REQUIRED, and sendingsegmentsto a single-style layer returnsTEXT_SEGMENTS_UNSUPPORTED. Readsegment_countonce and branch on it, rather than guessing per layer. - A layer takes 1 to 32 segment entries of 1 to 200 characters each, and its combined segment text is capped at 500 characters.
- One render carries at most 200 segment overrides across its text layers, and at most 50 group overrides.
API reference
For the complete request and response, see the Render a PSD mockup API reference. The upload fields named above come from Create a mockup from a PSD.Text layers
The upload response, render overrides, and what renders from a text layer.
Fonts
Pick a catalogue font, or upload your own.