Generate Open Graph images with one API call

Send your content and get back a ready to publish OG image.

/api/v1/images/generate

saas-6 · cURL

curl -X POST https://api.mosaicora.io/api/v1/images/generate \
  -H "Authorization: Bearer mos_your_token" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: saas-6-webp-001" \
  -d '{
  "type": "og",
  "templateId": "template_saas_6",
  "format": "webp",
  "content": {
    "title": "Generate social images with one API call",
    "subtitle": "Saved templates in. Production-ready image bytes out.",
    "brand": "Mosaicora",
    "codeExample": "POST /api/v1/images/generate",
    "cta": "200 OK · image/webp"
  }
}' \
  --output og-saas-6.webp
1200 × 630200 OK

From saved template to image bytes

Discover the fields your template accepts, then generate an image with only the values you want to render.

1

Inspect template fields

Read the ordered content contract without exposing saved values or design configuration.

GET/api/v1/templates/{template_id}/fields
{
  "templateId": "template_123",
  "baseTemplateId": "saas-6",
  "defaultFormat": "jpeg",
  "acceptedFormats": ["jpg", "jpeg", "png", "webp"],
  "fields": [
    {
      "key": "title",
      "valueType": "text",
      "semanticRole": "content.title",
      "autoMap": true
    },
    {
      "key": "subtitle",
      "valueType": "text",
      "semanticRole": "content.description",
      "autoMap": true
    },
    {
      "key": "brand",
      "valueType": "text",
      "semanticRole": "organization.name",
      "autoMap": true
    },
    {
      "key": "codeExample",
      "valueType": "text",
      "semanticRole": "software.codeExample",
      "autoMap": false
    },
    {
      "key": "cta",
      "valueType": "text",
      "semanticRole": "template.saas-6.cta",
      "autoMap": false
    }
  ]
}
2

Generate the image

Send the saved template and only the content values you want to render.

POST/api/v1/images/generate

Request body

application/json

{
  "type": "og",
  "templateId": "template_123",
  "format": "webp",
  "content": {
    "title": "Generate social images with one API call",
    "subtitle": "Saved templates in. Production-ready image bytes out."
  }
}

200 OKimage/webp

Response headersX-Request-Id, X-Template-Id

If you omit a content field, it stays empty.

One endpoint, many publishing workflows

Generate on-brand images automatically from your templates and application data.

Product launches

Create launch visuals from product and campaign data using saved templates.

Editorial publishing

Generate article social images from headlines, authors, and categories in your templates.

Changelog automation

Turn release notes and version details into polished social images automatically.

Customer-specific reports

Deliver branded report thumbnails tailored to each customer's data and context.

Build your first image

Follow the public guide from token setup to image bytes.

API access for Growth and Scale

Generate images from saved templates through the API with a Growth or Scale plan.