SCALIX help

← All tools

lads_update_campaign

LinkedIn Ads write high risk

Part of the LinkedIn Campaign Manager Agent.

What it does

Updates a campaign via partial update (PATCH $set). The preview echoes the requested changes and includes the current values of the fields being changed (when the campaign already holds every value requested, the answer is changed: false with no preview_id); commit applies the PATCH and audits. Editable: name, status, dailyBudget/totalBudget, unitCost, pacingStrategy, optimizationTargetType, creativeSelection, targetingCriteria, runSchedule, audienceExpansionEnabled, politicalIntent. Use lads_pause/resume/archive_campaign for those specific status moves and lads_delete_campaign for deletion. Accuracy notes: budgets/bids are decimal strings in account currency (not micros); if targeting changes, RE-CHECK anti-discrimination and EU politicalIntent and re-run the >=300 audience check; this tool cannot remove a budget (it sends $set patches only; remove it in Campaign Manager). Some fields (type, objectiveType) are immutable post-launch. Two-phase (parity with Google, ADR-028/029): the first call (no preview_id) reads the campaign from LinkedIn (a nonexistent id is refused), 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 change a campaign's name, budget, bid strategy, schedule, or targeting. Always preview the before/after and quantify spend/delivery impact before approval. If targeting changes, re-run the audience-size check (warn if <300) and re-validate protected-category rules and EU political consent. For pure pause/resume/archive, prefer the dedicated tools.

Inputs

NameTypeRequiredDescription
account_idstringyesNumeric ad account ID (digits only).
campaign_idstringyesNumeric campaign ID (digits only).
namestringnoNew name.
statusstringnoNew status, upper-cased and checked at preview against LinkedIn's campaign statuses (ACTIVE|PAUSED|ARCHIVED|COMPLETED|CANCELED|DRAFT|PENDING_DELETION|REMOVED; any other is refused, naming them). Prefer lads_pause/resume/archive_campaign for those moves, and avoid PENDING_DELETION here: lads_delete_campaign deletes a DRAFT campaign with HTTP DELETE, as LinkedIn requires.
daily_budgetobjectno{amount:string,currencyCode:string}; currency must match account.
total_budgetobjectno{amount:string,currencyCode:string}. This tool cannot remove a campaign's total budget: change the amount, or remove it in Campaign Manager.
unit_costobjectno{amount:string,currencyCode:string} bid; required non-zero if switching to manual/target/cost-cap optimization.
optimization_target_typestringnoBid strategy, upper-cased before sending (NONE|ENHANCED_CONVERSION|MAX_IMPRESSION|MAX_CLICK|MAX_CONVERSION|MAX_VIDEO_VIEW|MAX_LEAD|MAX_QUALIFIED_LEAD|MAX_REACH|TARGET_COST_PER_*|CAP_COST_AND_MAXIMIZE_*). Explain the delivery/cost tradeoff.
pacing_strategystringnoLIFETIME|ACCELERATED, upper-cased before sending.
creative_selectionstringnoOPTIMIZED|ROUND_ROBIN, upper-cased before sending.
targeting_criteriaobjectnoNew targeting, in LinkedIn's targetingCriteria form as for lads_create_campaign's targeting_criteria ({include: {and: [{or: {<facet URN>: [<value URNs>]}}]}, exclude: {or: {<facet URN>: [<value URNs>]}}}); any other shape, such as the retired includedTargetingFacets form, is refused at preview, naming the fault. It replaces the campaign's whole targeting. Scalix re-checks LinkedIn's EU political-intent rule and its age and gender rules at preview (no age or gender on a JOB_APPLICANT or TALENT_LEAD campaign, none in exclude), but not the audience: before asking for approval, re-run the audience count (lads_get_audience_count; >=300 members to serve).
run_scheduleobjectno{start,end} epoch ms. start is required whenever run_schedule is set: LinkedIn replaces the whole schedule, so to change only the end send the current start too. A missing start, or a bound that is not epoch ms (such as an ISO date), is refused at preview.
audience_expansion_enabledbooleannoToggle lookalike expansion.
political_intentstringnoNOT_POLITICAL or NOT_DECLARED; POLITICAL is refused at preview. When the update sets status ACTIVE, the targeting or the intent, the campaign's resulting declaration and targeting are checked at preview: EU targeting with NOT_DECLARED is refused, and an EU campaign declared NOT_POLITICAL shows LinkedIn's statement for the user to confirm.
preview_idstringnoOmit 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

Show before/after; apply only approved changes; re-preview on any modification. If targeting changes, re-enforce anti-discrimination (no protected-attribute targeting/exclusion on employment/housing/education/credit; age off for recruitment) and re-capture EU consent + set politicalIntent honestly. Budget/bid edits affect spend — surface projected impact. Strict per-account isolation.

Reminder

Preview the diff, confirm, then patch; re-check anti-discrimination and EU politicalIntent whenever targeting changes; budgets are decimal strings (not micros).

Errors

Error classMeansWhat to doRetry
INVALID_ARGUMENTRejected field — currency mismatch, non-decimal amount, unitCost 0 with manual/cost-cap optimization, or invalid status transition.Surface the exact platform message; fix and re-preview. Don't guess.no
FIELD_NOT_EDITABLEAttempted to change an immutable field post-launch (e.g., type, objectiveType).Do not patch immutable fields; surface the platform message. To change them, create a new campaign.no
POLICY_VIOLATIONNew targeting/declaration breaks policy (protected-attribute targeting on regulated objectives, or false/missing politicalIntent for EU).Block the update; explain the policy and require corrected targeting/declaration.no
PERMISSION_DENIEDMissing rw_ads / insufficient role / out of scope (403).Confirm CAMPAIGN_MANAGER+ and rw_ads.no
CUSTOMER_NOT_FOUNDCampaign/account not found or out of scope (404).Verify IDs.no
PREVIEW_EXPIREDpreview_id unknown/expired (TTL elapsed) or fields changed since preview.Re-preview before committing.no
TOKEN_REVOKEDToken expired/revoked (401).needs_reauth — refresh once and retry the idempotent PATCH; else reconnect.yes
RESOURCE_EXHAUSTEDRate/quota limit (429).Backoff 5/10/20s cap 60s.yes
PLATFORM_UNAVAILABLELinkedIn 5xx.Retry with backoff; PATCH is idempotent.yes

Edge cases

  • Removing totalBudget is not supported by this tool (it sends $set patches only); remove it in Campaign Manager.
  • Switching to manual/target/cost-cap optimization requires a non-zero unitCost (defaults to 0).
  • A targeting change re-triggers the EU political-intent and the age/gender checks at preview; the audience size is not re-checked: run lads_get_audience_count first (>=300 members to serve).
  • Some fields are immutable post-launch (e.g., objectiveType, type) -> FIELD_NOT_EDITABLE rather than guessing.
  • PATCH idempotent (204) -> safe retry after transient 5xx.
  • Modifying a field after preview invalidates preview_id -> re-preview.
  • Currency must equal account currency or INVALID_ARGUMENT.
  • Preview TTL expiry -> PREVIEW_EXPIRED.