LinkedIn’s official Marketing API for managing the full lifecycle of LinkedIn advertising — ad accounts, campaign groups, campaigns, creatives, and ad analytics reporting. Best for agents that need to launch, optimize, or report on B2B ads on behalf of an authenticated LinkedIn advertiser. Distinguished from other ad networks by professional/firmographic targeting (job title, industry, seniority, company size) not available elsewhere. 10 example endpoints available through Lava’s AI Gateway. See the LinkedIn Ads API docs for full documentation.Documentation Index
Fetch the complete documentation index at: https://lava.so/docs/llms.txt
Use this file to discover all available pages before exploring further.
This is a catch-all provider — any valid URL under
https://api.linkedin.com is supported. LinkedIn Marketing API. Base URL: https://api.linkedin.com. Versioned endpoints live at /rest/* and require LinkedIn-Version (YYYYMM) + X-Restli-Protocol-Version: 2.0.0 headers (Lava attaches both automatically). Legacy endpoint /v2/userinfo (OIDC identity) needs no version header. Discover ad accounts via GET /rest/adAccountUsers?q=authenticatedUser; campaign groups under GET /rest/adAccounts//adCampaignGroups; campaigns under GET /rest/adAccounts//adCampaigns; creatives under GET /rest/adAccounts//creatives; ad analytics finder at GET /rest/adAnalytics?q=analytics&pivot=CAMPAIGN&timeGranularity=DAILY&dateRange=(start:(year:Y,month:M,day:D),end:(year:Y,month:M,day:D))&accounts=List(urn%3Ali%3AsponsoredAccount%3A)&fields=impressions,clicks,costInUsd. Pagination: cursor-based (pageToken/pageSize) for adAccounts/adCampaignGroups/adCampaigns/creatives; legacy start/count for some finders; adAnalytics has no pagination (chunk by date range instead). URN encoding for IDs: urn:li:sponsoredAccount:, urn:li:sponsoredCampaign:. URL-encode the colons (%3A) when embedding URNs in query parameters. Errors: Rest.li envelope . 400 with “A version must be present” = header dropped; 401 = expired token (auto-retried after refresh); 403 = wrong scope (cannot be fixed by refresh; user must re-authorize with additional scopes); 429 = rate limit, respect Retry-After. See https://learn.microsoft.com/en-us/linkedin/marketing/overview for full reference. The endpoints below are curated examples.Endpoints
List ad accounts the authenticated user has access to. Returns role (ACCOUNT_BILLING_ADMIN, ACCOUNT_MANAGER, CAMPAIGN_MANAGER, CREATIVE_MANAGER, VIEWER) and the sponsored-account URN per assignment. Start here to discover account IDs before fetching campaigns or analytics.
GEThttps://api.linkedin.com/rest/adAccountUsers?q=authenticatedUser — Free
- SDK
- cURL
Get an ad account by ID. Returns currency, type (BUSINESS/ENTERPRISE), status, time zone, name, and reference org URN.
GEThttps://api.linkedin.com/rest/adAccounts/{account_id} — Free
- SDK
- cURL
List campaign groups under an ad account. Campaign groups roll up status, budget, and performance across related campaigns. Supports cursor-based pagination via pageToken/pageSize.
GEThttps://api.linkedin.com/rest/adAccounts/{account_id}/adCampaignGroups?q=search — Free
- SDK
- cURL
Create a new campaign group. Account reference goes in the body as a sponsoredAccount URN. New campaign groups default to DRAFT; set status to ACTIVE to start serving once child campaigns are configured.
POSThttps://api.linkedin.com/rest/adCampaignGroups — Free
- SDK
- cURL
List campaigns under an ad account. Each campaign sits inside a campaign group and carries targeting, bidding, schedule, and creative associations. Supports cursor-based pagination via pageToken/pageSize.
GEThttps://api.linkedin.com/rest/adAccounts/{account_id}/adCampaigns?q=search — Free
- SDK
- cURL
Create a new campaign. Requires campaignGroup URN, sponsoredAccount URN, type (TEXT_AD, SPONSORED_UPDATES, etc.), objectiveType (BRAND_AWARENESS, WEBSITE_VISITS, etc.), unitCost, and targetingCriteria. Defaults to DRAFT; activate by updating status to ACTIVE.
POSThttps://api.linkedin.com/rest/adCampaigns — Free
- SDK
- cURL
List creatives under an ad account. Each creative references a sponsored campaign and a content URN (post, video, document, etc.). Use search.test=true|false to filter test creatives.
GEThttps://api.linkedin.com/rest/adAccounts/{account_id}/creatives?q=criteria — Free
- SDK
- cURL
Fetch ad performance analytics. Specify q=analytics or q=statistics, a pivot dimension (CAMPAIGN, CREATIVE, ACCOUNT, MEMBER_COUNTRY_V2, etc.), timeGranularity (DAILY/MONTHLY/YEARLY/ALL), a dateRange tuple, an accounts List of sponsoredAccount URNs, and a fields list (impressions, clicks, costInUsd, conversions, etc.). Returns an elements array; this endpoint does not support pagination — chunk by date range for large result sets.
GEThttps://api.linkedin.com/rest/adAnalytics?q=analytics&pivot=CAMPAIGN&timeGranularity=DAILY&dateRange=(start:(year:2026,month:5,day:1),end:(year:2026,month:5,day:18))&accounts=List(urn%3Ali%3AsponsoredAccount%3A{account_id})&fields=impressions,clicks,costInUsd,conversions — Free
- SDK
- cURL
Update a campaign (status, budget, schedule, targeting, bidding). LinkedIn uses Rest.li partial-update semantics: the body is wrapped in { patch: { $set: { ... } } }. The most common use is activating a campaign by setting status from DRAFT to ACTIVE.
PATCH https://api.linkedin.com/rest/adCampaigns/{campaign_id} — Free
- SDK
- cURL
Delete a creative by URN. Only DRAFT creatives can be deleted; ACTIVE creatives must be archived (PATCH status to ARCHIVED) instead. URL-encode the URN colons (%3A).
DELETEhttps://api.linkedin.com/rest/creatives/urn%3Ali%3AsponsoredCreative%3A{creative_id} — Free
- SDK
- cURL
Next Steps
All Providers
Browse all supported AI providers
Forward Proxy
Learn how to construct proxy URLs and authenticate requests