Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to LinkedIn

Scalekit connector
Open markdown

The LinkedIn connector lets your AI agent act in each user's LinkedIn account. Each user signs in to LinkedIn once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 59 tools.

Tools
59
What they doRead · write · destructive
34 · 18 · 734 read18 write7 destructive
Users sign in with
OAuth app
Your own LinkedIn app

What you can do

  • Publish posts: create, update, and delete posts for a member or an organization page
  • Engage with posts: comment on posts, add reactions, and read comments, reactions, and engagement counts
  • Manage ad campaigns: create and update campaign groups, campaigns, and ad creatives, and delete drafts
  • Report on ads and pages: get ad impressions, clicks, and spend, plus organization follower and post statistics
  • Look up organizations: search company pages, fetch page details and admins, and view follower counts
  • Collect leads: list Lead Gen Forms and fetch submitted lead responses for an ad account or organization

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the LinkedIn connection

    In AgentKit > Connections, create a LinkedIn connection and copy its redirect URI. The name you give it is the connection_name your code passes. See Configure connections.

  4. Register an OAuth app

    LinkedIn connections use your own OAuth app. Register one with LinkedIn and add the redirect URI you copied.

    Then enter the app's Client ID and Client Secret on the LinkedIn connection.

  5. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'linkedin'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize LinkedIn:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'linkedin_userinfo_get',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user signs in once. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • linkedin_ad_account_getGet a LinkedIn ad account by its ID.Read-only

    Get Ad Account

    Get a LinkedIn ad account by its ID.

    Inputs

    account_idstringrequired
    The ID of the ad account to retrieve.
  • linkedin_ad_account_users_listList all users who have access to a LinkedIn ad account.Read-only

    List Ad Account Users

    List all users who have access to a LinkedIn ad account.

    Inputs

    account_idstringrequired
    The ID of the ad account to list users for.
  • linkedin_ad_analytics_getGet analytics data for a LinkedIn ad campaign including impressions, clicks, and spend.Read-only

    Get Ad Analytics

    Get analytics data for a LinkedIn ad campaign including impressions, clicks, and spend. Requires r_ads_reporting scope and Marketing Developer Platform access.

    Inputs

    date_range_endstringrequired
    End date for the analytics period in YYYY-MM-DD format.
    date_range_startstringrequired
    Start date for the analytics period in YYYY-MM-DD format.
    pivotstringrequired
    Dimension to pivot analytics by. One of: CREATIVE, CAMPAIGN, CAMPAIGN_GROUP, ACCOUNT, MEMBER_COMPANY, MEMBER_COUNTRY_V2, MEMBER_REGION_V2, MEMBER_JOB_TITLE.
    time_granularitystringrequired
    Time granularity for grouping analytics data. One of: DAILY, MONTHLY, ALL.
    campaignsstring
    Campaign URN to filter analytics (e.g. 'urn:li:sponsoredCampaign:712345678'). Provide this or account_id.
  • linkedin_asset_getGet the status and details of a LinkedIn image upload by its image URN.Read-only

    Get Media Asset

    Get the status and details of a LinkedIn image upload by its image URN.

    Inputs

    asset_idstringrequired
    The image URN returned from the initializeUpload response (e.g. urn:li:image:C4E22AQGadflBbEegg).
  • linkedin_campaign_getGet a specific ad campaign by ID within a LinkedIn ad account.Read-only

    Get Ad Campaign

    Get a specific ad campaign by ID within a LinkedIn ad account.

    Inputs

    account_idstringrequired
    The ID of the ad account that owns the campaign.
    campaign_idstringrequired
    The ID of the campaign to retrieve.
  • linkedin_campaign_group_getGet a specific campaign group by ID within a LinkedIn ad account.Read-only

    Get Campaign Group

    Get a specific campaign group by ID within a LinkedIn ad account.

    Inputs

    account_idstringrequired
    The ID of the ad account that owns the campaign group.
    group_idstringrequired
    The ID of the campaign group to retrieve.
  • linkedin_campaign_groups_listList campaign groups for a LinkedIn ad account.Read-only

    List Campaign Groups

    List campaign groups for a LinkedIn ad account.

    Inputs

    account_idstringrequired
    The ID of the ad account to list campaign groups for.
    countinteger
    Number of results to return per page.
    startinteger
    Offset for pagination.
    statusstring
    Filter by campaign group status (e.g. ACTIVE, PAUSED, ARCHIVED).