Guide · LinkedIn ad creative API

How to generate LinkedIn ad creative with an API

A LinkedIn ad creative API that produces 1200×628 PNGs with readable headlines and CTAs — pre-sized for Campaign Manager. No Photoshop, no retyping the headline.

Running paid LinkedIn campaigns at any volume means you need a LinkedIn ad creative API, not a design tool. Most text-to-image models still produce unreadable text and generic 1024×1024 squares — so the workflow becomes: generate, crop, retouch, retype the headline in Photoshop, then upload to Campaign Manager.

This guide walks through a different approach. Describe the ad in natural language, get back a 1200×628 PNG at the exact sponsored-post format with the headline, stat, and CTA rendered as real HTML/CSS text on top of the visual — not diffusion pixels. One API call, one file ready for upload.

Step by step

  1. 01

    Describe the ad, not the picture

    Focus the prompt on the brief: brand, audience, key message, tone, CTA. Skip visual directions like "cyberpunk cityscape" — the art director handles composition. A solid prompt is one sentence of context plus the literal headline, stat, and CTA copy you want rendered.

  2. 02

    Pick the LinkedIn format

    LinkedIn sponsored content uses 1200×628 (landscape). 1080×1080 (square) works in feed too. The API returns one PNG at the exact pixel dimensions — no client-side cropping.

  3. 03

    POST and ship

    Send a POST with prompt and format, get back a URL to the PNG. Typical generation lands around 2–3 minutes; longer prompts (multi-paragraph briefs) can extend further. Upload the file via Campaign Manager API or download it manually.

Example prompts

Copy, click, tweak — the CTA opens the terminal with the prompt pre-loaded.

SaaS product launch LinkedIn sponsored post for a B2B observability SaaS. Headline: "See your p99 before your customers do". Stat: "3× faster root-cause". CTA: "Start free". Target: engineering leaders. Tone: confident, technical. Try →
Recruitment / employer branding LinkedIn ad for a climate-tech startup hiring 20 engineers in Milan. Headline: "Build what the planet needs". CTA: "See open roles". Tone: inspiring, human, optimistic. Brand colour: forest green. Try →
Enterprise case study LinkedIn sponsored post featuring Acme Corp as a customer. Headline: "How Acme cut reporting time by 78%". CTA: "Read the case study". Target: VP Finance. Tone: authoritative, data-driven. Try →

API call

Standard REST. Bearer token, JSON body, URL response. Works in any HTTP client, n8n, Make, Zapier, or MCP agent.

curl -X POST https://api.42rows.com/v1/image-creative \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "LinkedIn sponsored post for a B2B observability SaaS...",
    "format": "1200x628"
  }'

Pricing

Pay-per-call, no subscription. Subscription plans are on the roadmap — they will not change pay-per-call rates.

FAQ

Is the text in the image really readable?

Yes. Headlines, stats, and CTA labels are rendered via an HTML/CSS overlay on top of the AI-generated visual — pixel-perfect typography, not diffusion pixels. The system prompt targets WCAG AA contrast (4.5:1), but contrast is not post-validated per output yet — that check is on the roadmap. If you find an output below 4.5:1, send us the slug and we will add it to the eval set.

What LinkedIn formats are supported?

1200×628 (landscape sponsored content), 1080×1080 (square feed), and 1080×1920 (Stories). These cover every paid placement except video — see the video creative guide for that.

Can I bring my brand palette and logo?

Mention brand name, hex colours, and tone in the prompt and the art director honours them. Brand-kit pinning and direct logo upload ship in a future release.

How fast is a single generation?

Typical end-to-end is 2–3 minutes (sampled from the public feed at 42rows.com/tools). Multi-paragraph or layout-heavy prompts can extend longer. Same prompt twice may finish in different times depending on GPU queue.

Does this work inside n8n, Make, or Zapier?

Yes — it is a plain REST endpoint. Any workflow tool that can do an HTTP POST plugs in. There is also an MCP server for agent-based pipelines.

Ship it

Use the first example prompt as a starter — the button opens the public terminal with it pre-filled.