SCALIX help

← All tools

lads_create_campaign_group

LinkedIn Ads write high risk

Part of the LinkedIn Campaign Manager Agent.

What it does

Creates a campaign group (container that manages status/budget/schedule across related campaigns). Two-phase write (Scalix guardrail): the first call (no preview_id) builds the request locally and returns a preview_id — nothing is sent to LinkedIn; the commit creates the group with the given status (DRAFT by default) and writes an immutable audit log. Required: account (urn:li:sponsoredAccount), name (<=100 chars), runSchedule.start (epoch ms; runSchedule.end REQUIRED when totalBudget is set). Optional: totalBudget{amount(string),currencyCode} and/or dailyBudget (LinkedIn accepts it only on a group with the DYNAMIC budget optimization strategy, 202504+, which this tool cannot set), objectiveType (IMMUTABLE; children inherit). The preview includes the exact request it will send (preview.request). Accuracy notes: budgets are DECIMAL STRINGS in account currency (NOT micros); currencyCode MUST equal the account's ISO currency; the group budget caps spend across all child campaigns. ENTERPRISE accounts auto-create a default (backfilled=true) group whose fields are immutable. The new group id is returned in the x-restli-id response header (201 Created), not the body.

When to use it

Use whenever a client needs a new container to manage budget/schedule/status across a set of related campaigns BEFORE creating those campaigns — set the shared budget cap and (optionally) the inherited objective here so children stay consistent. Always run preview (DRAFT) first and get explicit approval; if the account is ENTERPRISE, do not try to mutate the auto-created default (backfilled) group — create a new one. First call the matching planner skill (lads_plan_sponsored_content_campaign, lads_plan_lead_gen_campaign, lads_plan_message_campaign, or lads_plan_dynamic_ad_campaign) for the campaign blueprint, operation ordering, and policy pre-checks.

Inputs

NameTypeRequiredDescription
account_idstringyesNumeric ad account ID (digits only) for the path; the body 'account' field is urn:li:sponsoredAccount:{id}. Strip any urn prefix from the path segment.
namestringyesGroup name; hard cap 100 chars (reject longer; do not silently trim).
run_schedule_startintegeryesInclusive start as epoch milliseconds (UTC). Required: a missing one, or one that is not epoch ms (such as an ISO date), is refused at preview.
run_schedule_endintegernoExclusive end as epoch ms; REQUIRED when total_budget is set; omit for open-ended.
total_budgetobjectno{amount:string, currencyCode:string} — decimal string (e.g. '60000.00'), currency MUST equal the account currency. Not micros.
daily_budgetobjectno{amount:string, currencyCode:string}; only valid when budgetOptimizationStrategy=DYNAMIC (202504+).
objective_typestringnoOptional, IMMUTABLE after create: BRAND_AWARENESS|CREATIVE_ENGAGEMENT|ENGAGEMENT|JOB_APPLICANT|LEAD_GENERATION|TALENT_LEAD|VIDEO_VIEW|WEBSITE_CONVERSION|WEBSITE_TRAFFIC|WEBSITE_VISIT, singular (LinkedIn refuses the plurals its schema table lists); any other value is refused at preview. A campaign created in the group without an objective takes it, and one with another objective is refused.
statusstringnoStatus at create: DRAFT (default) | ACTIVE, enum-normalized uppercase. LinkedIn creates groups only in these two, so anything else is refused before the API call; to pause a group, create it and then call lads_pause_campaign_group. Sent as given — the preview is a local echo, nothing is sent until commit.
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

Create paused/DRAFT, never live; activate only the fields the user approved. The group's objectiveType is IMMUTABLE and is inherited by every child campaign — if it is an employment/housing/education/credit objective, anti-discrimination rules bind all children (no targeting or excluding by protected attributes; age targeting must be off for recruitment). Strict per-account isolation: operate only on the account the bearer is scoped to.

Reminder

Create in DRAFT, confirm the preview, then activate; respect per-account isolation and the inherited objective's policy constraints.

Errors

Error classMeansWhat to doRetry
INVALID_ARGUMENTLinkedIn rejected a field (e.g., name > 100 chars, runSchedule.end missing while totalBudget set, currencyCode != account currency, amount not a decimal string, dailyBudget set without DYNAMIC optimization).Surface the exact platform message; fix the named field and re-preview. Do not guess valid values.no
PERMISSION_DENIEDToken lacks rw_ads, or the member role is VIEWER/CREATIVE_MANAGER (insufficient to create groups), or the account is out of bearer scope (403).Confirm CAMPAIGN_MANAGER+ role and rw_ads scope; do not retry without them.no
FIELD_NOT_EDITABLEAttempted to set/change an immutable field (e.g., objectiveType after create, or editing an ENTERPRISE default/backfilled group).Create a new non-default group; do not patch immutable fields.no
CUSTOMER_NOT_FOUNDAccount not found / not in scope (404).Verify account_id via lads_list_ad_accounts.no
TOKEN_REVOKEDAccess token expired/revoked (401).needs_reauth — refresh once and retry the same idempotent step; else prompt reconnect.yes
RESOURCE_EXHAUSTEDRate/quota limit (429).Backoff 5/10/20s cap 60s; honor reset header.yes
PREVIEW_EXPIREDThe supplied preview_id is unknown/expired (TTL elapsed) or its fields changed since preview.Re-run preview to regenerate a fresh preview_id before committing.no
PLATFORM_UNAVAILABLELinkedIn 5xx.Retry with backoff; if the create may have partially applied, search by name (lads_list_campaign_groups) before retrying to avoid duplicates.yes

Edge cases

  • Preview-only (approve=false) leaves a DRAFT group + preview_id; it never serves until commit activates it.
  • totalBudget set without runSchedule.end -> INVALID_ARGUMENT; require end at preview time.
  • currencyCode mismatch with account currency -> rejected; read account currency via lads_get_ad_account first.
  • ENTERPRISE default group is backfilled=true and immutable — create a new group instead of editing it.
  • objectiveType is immutable post-create; setting it wrong forces a delete+recreate.
  • Group budget is a shared cap — all child campaigns draw from it (CAMPAIGN_GROUP_TOTAL_BUDGET_HOLD stops every child when reached).
  • Idempotency: capture the x-restli-id; on 5xx after POST, check for an existing group with the same name before retrying to avoid duplicates.
  • Modifying any field after preview invalidates the preview_id -> must re-preview.
  • Preview TTL expiry -> PREVIEW_EXPIRED; re-preview before committing.