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
| Name | Type | Required | Description |
|---|---|---|---|
account_id | string | yes | Numeric ad account ID (digits only). |
status | array<string> | no | Filter 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_id | string | no | Filter to one group (search by campaignGroup URN urn:li:sponsoredCampaignGroup:{id}). |
type | array<string> | no | Filter by CampaignType: TEXT_AD|SPONSORED_UPDATES|SPONSORED_INMAILS|DYNAMIC. |
ids | array<string> | no | Filter by campaign URN(s) urn:li:sponsoredCampaign:{id}. |
name | string | no | Filter by name. |
include_test | boolean | no | If true, return ONLY test campaigns (search.test=true); if false/omitted, return both test and non-test. Default false. |
sort_order | string | no | ASCENDING (default) or DESCENDING, sorted by id. |
page_size | integer | no | Cursor page size; default 100, max 1000 (clamp >1000). |
page_token | string | no | Opaque 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 class | Means | What to do | Retry |
|---|---|---|---|
INVALID_ARGUMENT | A 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_FOUND | Account not found / not in scope (404). | Verify account_id. | no |
PERMISSION_DENIED | Missing r_ads/rw_ads or no role (403). | Confirm scope/role. | no |
TOKEN_REVOKED | Token expired/revoked (401). | needs_reauth — refresh once and retry; else reconnect. | yes |
RESOURCE_EXHAUSTED | Rate/quota limit (429). | Backoff 5/10/20s cap 60s. | yes |
PLATFORM_UNAVAILABLE | LinkedIn 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.