SCALIX help

← All tools

lads_list_campaign_groups

LinkedIn Ads read low risk

Part of the LinkedIn Campaign Manager Agent.

What it does

Searches/lists campaign groups in an account via the q=search finder. Uses CURSOR pagination (pageSize/pageToken; nextPageToken in metadata) — NOT start/count. Filter by status[], id[], name, and test. Returns elements with the same shape as lads_get_campaign_group plus 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 groups, find groups by status (e.g., ACTIVE,DRAFT), or locate the default vs non-default groups. Accuracy notes: every filter is optional (with none, LinkedIn lists every group); max pageSize 1000, default 100; budgets are decimal strings (not micros); test groups are included (include_test=true returns ONLY test groups).

Inputs

NameTypeRequiredDescription
account_idstringyesNumeric ad account ID (digits only).
statusarray<string>noFilter by status, upper-cased and checked before sending: ACTIVE|ARCHIVED|CANCELED|DRAFT|PAUSED|PENDING_DELETION|REMOVED (LinkedIn's values; any other is refused, naming them). Encoded as search=(status:(values:List(...))).
idsarray<string>noFilter by group URN(s) urn:li:sponsoredCampaignGroup:{id} (search.id.values).
namestringnoFilter by name (search.name.values).
include_testbooleannoIf true, return ONLY test groups (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 values >1000 to 1000).
page_tokenstringnoOpaque cursor; pass the prior response's metadata.nextPageToken to fetch the next page (null when exhausted).

Safeguards

Policy

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

Reminder

List only within the authorized account; don't build 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 on the account (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; honor reset header.yes
PLATFORM_UNAVAILABLELinkedIn 5xx.Retry with backoff.yes

Edge cases

  • Every filter is optional: with none, LinkedIn lists every group in the account (its guide calls search criteria mandatory, but a search with none answered 200 in the 30 Sep e2e).
  • Cursor pagination: pass back metadata.nextPageToken; nextPageToken null/absent means last page.
  • No matches -> success with empty elements and a note that the account has none (matching these filters).
  • Test groups are included; include_test=true returns only test groups (search.test=true).
  • page_size over 1000 is clamped to 1000 before sending.
  • Result set spans multiple pages — never assume a single call returns all groups.