Most teams save the template once, then call the Image Automation API with record data from a CMS hook, a build process, or a publishing job.
cURL
Publish hook
curl -sS -X POST "https://studio.pixelixe.com/api/graphic/automation/v2" \
-H "Content-Type: application/json" \
--data '{
"api_key": "YOUR_API_KEY",
"document_uid": "cms-social-card-template",
"format": "json",
"image_type": "png",
"custom_field": "cms/blog/how-to-ship-content-ops",
"modifications": [
{ "name": "headline", "text": "How to ship content ops" },
{ "name": "section", "text": "Blog" },
{ "name": "meta", "text": "Apr 21, 2026 ยท Engineering" },
{ "name": "cover", "image_url": "https://cdn.example.com/covers/content-ops.png" }
]
}'
Typical when the CMS or publishing pipeline can call the API directly and then save the returned image URL back into the content record.
JavaScript
Webhook handler
export async function onEntryPublished(entry) {
const response = await fetch(
"https://studio.pixelixe.com/api/graphic/automation/v2",
{
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
api_key: process.env.PIXELIXE_API_KEY,
document_uid: "cms-social-card-template",
format: "json",
image_type: "png",
custom_field: `cms/${entry.type}/${entry.slug}`,
modifications: [
{ name: "headline", text: entry.title },
{ name: "section", text: entry.category },
{ name: "meta", text: entry.author },
{ name: "cover", image_url: entry.coverImageUrl }
]
})
}
);
const payload = await response.json();
return payload.image_url;
}
Useful for headless CMS webhooks, editorial admin actions, or release workflows that need the image URL immediately after publish.
Python
Build pipeline
import json
import urllib.request
def render_share_image(record):
payload = {
"api_key": "YOUR_API_KEY",
"document_uid": "cms-social-card-template",
"format": "json",
"image_type": "png",
"custom_field": f"cms/{record['type']}/{record['slug']}",
"modifications": [
{"name": "headline", "text": record["title"]},
{"name": "section", "text": record["label"]},
{"name": "meta", "text": record["publish_date"]},
{"name": "cover", "image_url": record["screenshot_url"]}
]
}
req = urllib.request.Request(
"https://studio.pixelixe.com/api/graphic/automation/v2",
data=json.dumps(payload).encode("utf-8"),
headers={"Content-Type": "application/json"},
method="POST"
)
with urllib.request.urlopen(req) as res:
return json.loads(res.read().decode("utf-8"))["image_url"]
Good for static site generators, docs builds, changelog publishing jobs, or nightly refresh tasks that re-render many content assets.