lads_batch_create_creatives
LinkedIn Ads write high risk
Part of the Sponsored Content Agent.
What it does
Batch-create multiple creatives in ONE ad account: POST /rest/adAccounts/{id}/creatives with header X-RestLi-Method: BATCH_CREATE and body {elements:[{campaign:urn:li:sponsoredCampaign:{id}, content:{...reference to share/image/video/document URN}, intendedStatus:'DRAFT'},...]}. All creatives must belong to the same ad account. Preview->approve->execute->log MANDATORY (no validate_only): build all, create with intendedStatus=DRAFT/PAUSED, show a per-creative plain-English summary (copy + asset + which campaign), get explicit approval, then PATCH intendedStatus->ACTIVE. Returns a per-element batch response (location/id urn:li:sponsoredCreative:{id}/status 201 or per-row error) — surface partial failures. Editorial standards + messaging-opt-out + Thought-Leader-consent guardrails apply per creative. Two-phase (parity with Google, ADR-028/029): the first call (no preview_id) reads the campaign of every row from LinkedIn with one batch get (a missing one is refused, naming its rows), builds the request locally and returns a preview_id — nothing is changed on LinkedIn; re-call with that preview_id and identical arguments to COMMIT (single-use, 30-min; a changed/forged/replayed token fails closed).
When to use it
Use to attach several creatives to campaigns at once for one client. Build all, create DRAFT, preview each (copy + asset + campaign), and only after approval PATCH ACTIVE. Do NOT auto-activate, mix accounts, ship messaging creatives without an opt-out/real sender, or use a Thought Leader post without confirmed member consent.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
account | string | yes | Single sponsored account for ALL elements; normalize to urn:li:sponsoredAccount:{id}. Within bearer scope. |
creatives | array | yes | List of creative objects (same account). Each: campaign (urn:li:sponsoredCampaign:{id}), content (reference to a share/image urn:li:image / video urn:li:video / document urn:li:document / member post urn:li:ugcPost for TL Ads), intendedStatus=DRAFT/PAUSED at create. A text ad row (content.textAd) needs headline (at most 25 characters), description (at most 75) and landingPage; a row missing campaign, content or these is refused at preview, naming it. |
auto_activate | boolean | no | Must be false/omitted; activation is a separate approved PATCH. Never auto-activate. |
preview_id | string | no | Omit it to preview: nothing is applied, and the call returns a preview_id bound to this exact request. Pass it only after the user approves that preview in a later message, with the same arguments (leave out validate_only, and add any confirmation flag the preview names). Single-use, expires in 30 minutes; changed arguments need a fresh preview. |
Safeguards
A change in two steps. The first call previews and changes nothing; Claude shows you the preview and applies it only after you approve, within 30 minutes and with the same arguments. Every applied change goes to the audit log. How changes are approved.
Policy
Create paused/DRAFT and activate only approved creatives. Copy/imagery must meet LinkedIn editorial standards (no ALL CAPS, one link, professional, AI disclosed, no deepfakes, no unsupported claims). Message/Conversation creatives need a working opt-out + a real sender (the EU geo-block was lifted ~Oct 2024). Thought Leader Ad creatives require the named member's verified consent (the ad stops on revoke). Strict per-account isolation across elements.
Reminder
Create all paused; activate only approved creatives; enforce editorial/messaging-opt-out/TL-consent rules per creative; never reference assets or campaigns outside the bearer's scope.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
PARTIAL_FAILURE | Some creatives created (201), others failed (per-element error with index). | Return per-element results; report failures (e.g. missing/processing asset); retry only failed rows. | no |
POLICY_VIOLATION | A creative violates editorial standards, is a messaging creative lacking opt-out/real sender, or is a TL post lacking member consent. | Fix copy/imagery, add the messaging opt-out + real sender, or verify TL consent before creating that element. | no |
INVALID_ARGUMENT | Bad content reference (asset not AVAILABLE, wrong URN type) or campaign mismatch (400) — surface message. | Ensure the asset is processed and the URN type matches the format; campaign must be in the same account. | no |
PERMISSION_DENIED | No rw_ads write access or element references another account (403). | Ensure single scoped account + write role; re-auth if needed (needs_reauth). | no |
TOKEN_REVOKED | Token expired/revoked (401). | Refresh and retry once; else re-auth. | yes |
RESOURCE_EXHAUSTED | Rate/daily limit (429). | Backoff 5/10/20s cap 60s; chunk; alert at 75% quota; respect Retry-After. | yes |
Edge cases
- Mixed accounts -> rejected; all elements one account.
- Referenced image/video/document still PROCESSING -> per-row 400; confirm asset AVAILABLE before batch.
- Partial success: report per-row; never claim full success unless all 201.
- TL Ad creative references urn:li:ugcPost and requires verified member consent -> block without it.
- Messaging creative without a working opt-out/real sender -> block (EU geo-block lifted; opt-out still required).
- Created creatives are DRAFT/PAUSED until the separate approved activation PATCH; re-preview on modification.