Create a campaign via LinkedIn Marketing API with versioned header
domain: learn.microsoft.com/en-us/linkedin/marketing · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Register an app in the LinkedIn Developer Portal, request the r_ads and rw_ads permissions, and complete OAuth 2.0 to obtain an access token.
Include the LinkedIn-Version header (format YYYYMM, e.g. 202501) on every request — the API version is header-driven rather than URL-path-driven.
POST to https://api.linkedin.com/rest/adAccounts/{AD_ACCOUNT_URN}/campaigns with a JSON body specifying name, type (SPONSORED_UPDATES or TEXT_AD), costType (CPM, CPC, or CPV), status (DRAFT or ACTIVE), and targeting criteria.
Reference the ad account as a URN (urn:li:sponsoredAccount:ACCOUNT_ID) in both the URL and body fields that accept account identifiers.
Create an AdCreative under the campaign by POSTing to /rest/adCreatives with the campaign URN and reference to a share or sponsored content URN.
Activate the campaign by PATCHing its status to ACTIVE when ready to serve.
Known gotchas
The LinkedIn-Version header is mandatory — omitting it or using an unsupported version date will return a 400 error; always use a version within the supported window.
LinkedIn URNs must be URL-encoded when used in path parameters (colons become %3A); failure to encode returns 404 or unexpected results.
Campaign type and costType combinations are constrained — not all pairings are valid; consult the compatibility table in LinkedIn's documentation before creation.
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?