← Resources

Playbooks

Linkedin ads api

How the LinkedIn Marketing API works in 2026 - sandbox-to-production approval flow, authentication, the endpoints worth using, and what the API still won't let you do.

Updated

Before you start

  • LinkedIn developer account (sign up at developer.linkedin.com - separate from your Campaign Manager login)
  • LinkedIn Company Page with admin access (apps must be associated with a Page)
  • A real production use case you can describe in 1-2 paragraphs - LinkedIn rejects 'exploring options' applications
  • Engineering capacity for OAuth 2.0 implementation and webhook handling
  • Server able to host a publicly-reachable OAuth redirect URL (https required)

The playbook

7 steps

0/7
  1. Create the LinkedIn developer app

    Go to developer.linkedin.com/apps → Create app. You'll need: app name, your LinkedIn Page (the app will be 'verified by' the Page admin), app logo, legal terms URL. The Page verification step is non-obvious - a Page admin has to click a verification link before the app is usable. Get this out of the way day 1.

    Expected outcome

    App created and verified by a Page admin; appears in your developer console.

  2. Apply for Marketing Developer Platform (sandbox)

    Default app permissions don't include ads endpoints. Under your app → Products tab → request 'Marketing Developer Platform'. This grants sandbox access. The application form asks for: company info, use case description, integration partner status (yes/no), and which endpoints you need. Be specific in the use case - 'syncing campaign performance into our internal analytics warehouse for B2B SaaS clients' beats 'building marketing tools'.

    TipSandbox approval is typically 1-3 business days. Production access (next step) is 2-4 weeks and is the slow part. Start the sandbox application the day you start engineering work, not when you're ready to ship.

    Expected outcome

    Marketing Developer Platform shows as 'Approved' under your app's Products tab; sandbox scopes (`r_ads`, `r_ads_reporting`, etc) become available.

  3. Implement OAuth 2.0 three-legged auth

    LinkedIn requires 3-legged OAuth for any user-scoped action (read someone's ad accounts, create campaigns on their behalf). Build the standard authorization-code flow: redirect to https://www.linkedin.com/oauth/v2/authorization with your client ID, scopes, state, and redirect URI; exchange the code for an access token at https://www.linkedin.com/oauth/v2/accessToken; store the access token + refresh token. Access tokens are valid 60 days; refresh tokens 365 days.

    // Authorization URL
    GET https://www.linkedin.com/oauth/v2/authorization
      ?response_type=code
      &client_id=YOUR_CLIENT_ID
      &redirect_uri=https://yourapp.com/oauth/linkedin/callback
      &state=RANDOM_CSRF_TOKEN
      &scope=r_ads r_ads_reporting rw_ads
    
    // Token exchange
    POST https://www.linkedin.com/oauth/v2/accessToken
      Content-Type: application/x-www-form-urlencoded
      grant_type=authorization_code
      &code=AUTH_CODE_FROM_REDIRECT
      &redirect_uri=https://yourapp.com/oauth/linkedin/callback
      &client_id=YOUR_CLIENT_ID
      &client_secret=YOUR_CLIENT_SECRET

    Expected outcome

    OAuth flow returns an access token; you can hit /v2/me successfully.

  4. Query the core endpoints

    The endpoints worth knowing: /v2/adAccountsV2 (list accounts the user has access to), /v2/adCampaignGroupsV2 (campaign groups), /v2/adCampaignsV2 (campaigns), /v2/adCreativesV2 (creatives), /v2/adAnalyticsV2 (reporting - the heaviest-used endpoint). All require the X-Restli-Protocol-Version: 2.0.0 header. URN-based IDs throughout (`urn:li:sponsoredAccount:12345`).

    // List ad accounts
    GET https://api.linkedin.com/v2/adAccountsV2?q=search
      Authorization: Bearer ACCESS_TOKEN
      X-Restli-Protocol-Version: 2.0.0
    
    // Get analytics for a campaign
    GET https://api.linkedin.com/v2/adAnalyticsV2
      ?q=analytics
      &pivot=CAMPAIGN
      &dateRange.start.day=1&dateRange.start.month=5&dateRange.start.year=2026
      &dateRange.end.day=20&dateRange.end.month=5&dateRange.end.year=2026
      &campaigns=List(urn%3Ali%3AsponsoredCampaign%3A123456789)
      &fields=impressions,clicks,costInUsd,conversionValueInLocalCurrency

    Expected outcome

    API returns campaign list + analytics data in expected JSON shape.

  5. Handle rate limits properly

    LinkedIn enforces per-app and per-user daily/throttled rate limits. Headers `x-li-daily-limit` and `x-li-daily-limit-used` tell you where you stand. Hit 429 and back off exponentially - LinkedIn does not provide a Retry-After header reliably. Batch reads via the analyticsV2 endpoint's bulk-pivot capability instead of looping campaign-by-campaign.

    TipThe biggest API mistake is reporting at Ad-level when you really need Campaign-level. Ad-level analytics multiplies API call volume by 10-50x. Start at Campaign or AdGroup pivot; only drill to Ad pivot for specific investigations.

    Expected outcome

    App stays under daily rate limit during normal operation; backoff handler in place for spikes.

  6. Apply for production access

    Once your sandbox integration works end-to-end, submit for production. Same Products tab → 'Apply for production'. LinkedIn reviews: use case clarity, OAuth implementation correctness, screenshots of your tool, links to legal docs (privacy policy, terms). Production review is 2-4 weeks typically. Be specific about volume estimates (number of accounts, calls/day).

    Expected outcome

    Production access approved; rate limits lift from sandbox tier (~100/day) to production tier (~25,000/day depending on use case).

  7. Set up Marketing API webhooks (where available)

    LinkedIn has limited webhook coverage compared to Meta - the platform leans heavily on poll-based integration. Where webhooks exist (Lead Gen Form leads, primarily), subscribe via the developer console → Webhooks. For everything else, you'll be polling on a schedule. Set polling cadence based on use case: analytics every 15-60 min, account/campaign list daily.

    Expected outcome

    Lead Gen Form webhook firing for new leads; polling job scheduled for analytics; jobs idempotent against LinkedIn's eventually-consistent reads.

Shuttergen

Ship more LinkedIn creative than the API can analyze.

The LinkedIn Marketing API tells you which ads worked. Shuttergen generates the next batch of thought-leader-style variants to feed your pipeline - so your API integration always has fresh data to chew on.

Pitfalls

What goes wrong

  • Underestimating production-approval timeline

    Sandbox is fast (days). Production is slow (weeks). Teams ship a working sandbox integration and discover they can't onboard real customers for another month. Submit production application as soon as sandbox is end-to-end functional.

  • Polling Ad-level analytics

    Looping every Ad URN for analytics blows up API call volume and hits rate limits fast. Use Campaign or AdGroup pivot for routine reporting; reserve Ad pivot for specific drill-down queries.

  • Forgetting X-Restli-Protocol-Version header

    LinkedIn's Rest.li framework requires this header on most v2 endpoints. Forgetting it returns confusing 400/500 errors that don't mention the header. Set it in your HTTP client defaults.

  • Storing only access tokens

    60-day token expiry will catch you off guard. Store the refresh token too and implement automatic refresh when the access token has < 7 days left. Refresh tokens live 365 days.

  • Mixing sandbox and production credentials

    Sandbox and production are the same OAuth endpoints with different scope behavior. Easy to ship sandbox tokens against production accounts and silently get throttled data. Tag tokens with the environment they were issued under.

Limits

When this playbook won't work

  • Hobby projects without a real production use case - LinkedIn rejects vague applications
  • Use cases that require creating thousands of campaigns programmatically - LinkedIn rate-limits campaign creation aggressively, this isn't Meta
  • Real-time event streaming - LinkedIn is poll-first, the webhook surface is thin
  • Reading data from accounts you're not granted access to - LinkedIn's account-access model is strict; users must explicitly grant your app per account

What the LinkedIn Marketing API actually unlocks

The API is read-heavy by design. 80% of API usage is pulling analytics into internal dashboards, BI tools, or attribution stacks. Write operations (creating campaigns, updating budgets, swapping creative) exist but LinkedIn rate-limits them more aggressively than Meta does. If your use case is 'spin up 500 campaigns/day from a CSV', LinkedIn isn't the right surface.

The endpoints to know. /v2/adAnalyticsV2 is the workhorse - flexible enough to pivot by Campaign, AdGroup, Ad, Member Country, Member Job Function, Member Seniority, Member Industry, Member Company Size. /v2/adAccountsV2, /v2/adCampaignGroupsV2, /v2/adCampaignsV2, /v2/adCreativesV2 cover the entity hierarchy. /v2/adForms and /v2/leadGenForms handle Lead Gen Form responses.

The big missing pieces. No webhook for impression-level events. No real-time creative performance push. Thin coverage for Conversation Ads message-level analytics. Reasonable-quality coverage for Lead Gen Form leads via webhook. If your integration depends on real-time pull, you'll be polling.

Ship more LinkedIn creative than the API can analyze. The LinkedIn Marketing API tells you which ads worked. Shuttergen generates the next batch of thought-leader-style variants to feed your pipeline - so your API integration always has fresh data to chew on.

Try Shuttergen free

Sandbox-to-production: the real timeline

Sandbox approval: 1-3 business days if your application is specific. 'Building an internal analytics dashboard to track our LinkedIn ad performance against pipeline data' - approved. 'Exploring marketing automation options' - rejected.

Production approval: 2-4 weeks is the standard range. Faster if you have an established integration partner relationship; slower if your use case requires scopes flagged for additional review (e.g., bulk write access).

Order of operations that doesn't bite you: Apply for sandbox day 1. Build the OAuth + analytics-read integration over weeks 1-2. Apply for production end of week 2 once you have working screenshots. Continue building the write/automation features during the production-review wait. By the time production is approved, you're ready to ship.

Internal: linkedin-ads-dashboard, hubspot-linkedin-ads-integration, linkedin-ads-reporting.

FAQ

Frequently asked

How do I get access to the LinkedIn Marketing API?
Create a developer app at developer.linkedin.com, verify it with a Page admin, then apply for Marketing Developer Platform under the Products tab. Sandbox approval takes 1-3 days; production approval 2-4 weeks. Be specific about your use case.
What's the difference between sandbox and production?
Sandbox grants the same scopes but with low rate limits (~100 calls/day) and limited account access. Production lifts rate limits (~25,000/day depending on use case) and allows you to onboard real customer accounts.
Does LinkedIn Ads API have webhooks?
Limited. Lead Gen Form leads webhook reliably; impression-level events and most analytics do not. The platform is poll-first - schedule analytics polls every 15-60 minutes for most use cases.
How long do LinkedIn access tokens last?
Access tokens are valid 60 days; refresh tokens 365 days. Implement automatic refresh when access tokens have less than 7 days left. Store both tokens.
Can I create campaigns programmatically with the LinkedIn API?
Yes, via /v2/adCampaignsV2 POST. But rate limits on write operations are aggressive - this is not Meta where you can create thousands of campaigns/day. Use for automation, not bulk seed-data scenarios.
What rate limits does the LinkedIn API enforce?
Per-app and per-user daily limits, plus throttled-per-minute limits. Check the x-li-daily-limit and x-li-daily-limit-used headers. Production limits are ~25,000 calls/day for most use cases; sandbox is ~100/day.

Related

Keep reading

Ship more LinkedIn creative than the API can analyze.

The LinkedIn Marketing API tells you which ads worked. Shuttergen generates the next batch of thought-leader-style variants to feed your pipeline - so your API integration always has fresh data to chew on.