SCALIX help

← All tools

lads_list_campaigns

LinkedIn Ads read low risk

Part of the LinkedIn Campaign Manager Agent.

What it does

Searches/lists campaigns in an account via q=search. Uses CURSOR pagination (pageSize/pageToken; nextPageToken in metadata) — NOT start/count. Filter by status[], id[], name, type[], campaignGroup, and test. Returns campaign elements (same shape as lads_get_campaign) + metadata.nextPageToken while more remain (the last page has none, and LinkedIn may answer it with a start/count paging block, which is not a cursor), and warnings (an empty first page carries a note that the account has none matching the filters). Use to inventory campaigns, find by status/group/type, or build a working set for bulk operations. Accuracy notes: every filter is optional (with none, LinkedIn lists every campaign); max pageSize 1000, default 100; includes test campaigns (include_test=true returns ONLY test campaigns); budgets are decimal strings (not micros); never assume one call returns all campaigns — page until nextPageToken is null.

Inputs

NameTypeRequiredDescription
account_idstringyesNumeric ad account ID (digits only).
statusarray<string>noFilter by status, upper-cased and checked before sending: ACTIVE|PAUSED|DRAFT|ARCHIVED|COMPLETED|CANCELED|PENDING_DELETION|REMOVED (LinkedIn's values; any other is refused, naming them).
campaign_group_idstringnoFilter to one group (search by campaignGroup URN urn:li:sponsoredCampaignGroup:{id}).
typearray<string>noFilter by CampaignType: TEXT_AD|SPONSORED_UPDATES|SPONSORED_INMAILS|DYNAMIC.
idsarray<string>noFilter by campaign URN(s) urn:li:sponsoredCampaign:{id}.
namestringnoFilter by name.
include_testbooleannoIf true, return ONLY test campaigns (search.test=true); if false/omitted, return both test and non-test. Default false.
sort_orderstringnoASCENDING (default) or DESCENDING, sorted by id.
page_sizeintegernoCursor page size; default 100, max 1000 (clamp >1000).
page_tokenstringnoOpaque cursor from prior metadata.nextPageToken (null when exhausted).

Safeguards

Policy

Strict per-account isolation: enumerate campaigns only within the bearer's authorized account; never aggregate across unaffiliated clients.

Reminder

List only within the authorized account; no cross-account inventories.

Errors

Error classMeansWhat to doRetry
INVALID_ARGUMENTA status outside LinkedIn's values, or a sort_order other than ASCENDING|DESCENDING, is refused before the call, naming the values; LinkedIn's own 400 (a malformed filter value) is surfaced.Use a value the message names, or fix the filter LinkedIn names; every filter is optional.no
CUSTOMER_NOT_FOUNDAccount not found / not in scope (404).Verify account_id.no
PERMISSION_DENIEDMissing r_ads/rw_ads or no role (403).Confirm scope/role.no
TOKEN_REVOKEDToken expired/revoked (401).needs_reauth — refresh once and retry; else reconnect.yes
RESOURCE_EXHAUSTEDRate/quota limit (429).Backoff 5/10/20s cap 60s.yes
PLATFORM_UNAVAILABLELinkedIn 5xx.Retry with backoff.yes

Edge cases

  • Every filter is optional: with none, LinkedIn lists every campaign in the account (a search with no criteria answered 200 in the 30 Sep e2e).
  • Cursor pagination: echo metadata.nextPageToken; null/absent = last page.
  • No matches -> success with an empty elements list and a note that the account has none (matching these filters).
  • Test campaigns are included; include_test=true returns only test campaigns.
  • page_size over 1000 is clamped to 1000 before sending.
  • Large accounts (thousands of campaigns) require multiple pages — never assume completeness from one call.