Before you start
- An API key from your dashboard.
- A template. Upload a PSD if you do not have one.
- Artwork at a URL that loads without signing in, because SudoMock fetches it.
uuid and a smart_objects array holding the
uuid of every layer you can fill. That page has the call ready to copy in
eight languages. Read the pair once and keep it.
Guide
1
Lay out the table
Four fields are enough to start:
2
Create the automation
Open Automations, create one, and choose the trigger When record
matches conditions. Set the condition to
Status is Pending so a record
enters the run exactly once.3
Add the script action
Add a Run a script action. In the left panel add two input variables,
designUrl mapped to the Design URL field and product mapped to the
Product field, then paste the script.4
Write the result back
Add an Update record action. Map Mockup URL to the script output
mockupUrl, and set Status to Done. Add a second automation on
Status is Error if you want failures to reach someone.What comes back
The finished image URL arrives atdata.print_files[0].export_path. That single
string is what the Update record action writes, and the whole response, field by
field, is on
Render a PSD mockup.
Filling a whole table at once
A script action is built for one record at a time, so a backlog is better sent as asynchronous work. Addis_async: true to the same body and the render is
queued instead of awaited.
The call then answers 202 with job_id, kind, status, and status_url at
the top level, so nothing is nested under data on this path. Put the job id on
the record with output.set, then run a second, scheduled automation that reads
Retrieve a job. Once status reads
succeeded, the image sits at result_url on that same body. A webhook removes
the polling entirely if you have somewhere to receive one.
When a render fails
A401 means the x-api-key header is missing or incomplete. A 422 names the
field it rejected, and is almost always an empty mapped value reaching the API
as literal text. A download failure means the design URL asks for a login. Every
status is listed in Errors.