CONNECT APP
Build with LinkedIn Ads
Communication
- OAuth
MCP
Give your agent LinkedIn Ads tools
Every LinkedIn Ads action is exposed as an MCP tool on Pipedream's remote server. Point a client at it with your end user's ID and Connect resolves that user's LinkedIn Ads account for each tool call — you store no tokens.
// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "linkedin_ads",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// e.g. run Create A Report:
const result = await mcp.callTool({
name: "linkedin_ads-create-report",
arguments: {
adAccountId: "Ad Account Id",
pivot: "Pivot",
},
})# access_token: mint a short-lived token with the Connect SDK — see the MCP guide
headers = {
"Authorization": f"Bearer {access_token}",
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", # any stable ID for this user in your system
"x-pd-app-slug": "linkedin_ads",
}
async with streamablehttp_client("https://remote.mcp.pipedream.net/v3", headers=headers) as (read, write, _):
async with ClientSession(read, write) as session:
await session.initialize()
tools = await session.list_tools()
# e.g. run Create A Report:
result = await session.call_tool("linkedin_ads-create-report", {
"adAccountId": "Ad Account Id",
"pivot": "Pivot",
})API PROXY
Call the LinkedIn Ads API directly
For an endpoint with no pre-built tool, the Connect proxy forwards your request to the LinkedIn Ads API with the connected user's credentials attached. You store no tokens and write no refresh logic.
const resp = await pd.proxy.get({
externalUserId: "{external_user_id}", // any stable ID for this user in your system
accountId: "apn_xxxxxxx",
url: "https://api.linkedin.com/v2/me",
})
// Any allowed LinkedIn Ads endpoint works here. Pipedream attaches the
// connected account's credentials to the outgoing request.# The path segment is the target URL, URL-safe base64 encoded:
# https://api.linkedin.com/v2/me
curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9hcGkubGlua2VkaW4uY29tL3YyL21l?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
-H "Authorization: Bearer {access_token}" \
-H "x-pd-environment: production"SDK
Run LinkedIn Ads actions from your backend
Connect a user's LinkedIn Ads account once, then run Create A Report on their behalf from your own code — TypeScript, Python, or plain HTTP.
import { PipedreamClient } from "@pipedream/sdk"
const pd = new PipedreamClient({
projectId: process.env.PIPEDREAM_PROJECT_ID!,
clientId: process.env.PIPEDREAM_CLIENT_ID!,
clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
projectEnvironment: "production",
})
const result = await pd.actions.run({
id: "linkedin_ads-create-report",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
linkedin_ads: { authProvisionId: "apn_xxxxxxx" },
adAccountId: "Ad Account Id",
pivot: "Pivot",
},
})from pipedream import Pipedream
pd = Pipedream(
client_id="{oauth_client_id}",
client_secret="{oauth_client_secret}",
project_id="{project_id}",
project_environment="production",
)
result = pd.actions.run(
id="linkedin_ads-create-report",
external_user_id="{external_user_id}", # any stable ID for this user in your system
configured_props={
"linkedin_ads": {"authProvisionId": "apn_xxxxxxx"},
"adAccountId": "Ad Account Id",
"pivot": "Pivot",
},
)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "linkedin_ads-create-report",
"configured_props": {
"linkedin_ads": { "authProvisionId": "apn_xxxxxxx" },
"adAccountId": "Ad Account Id",
"pivot": "Pivot"
}
}'TOOLS
LinkedIn Ads actions
On-demand operations your product or agent can configure and run on behalf of a connected user.
-
Create A Report
actionQueries the Analytics Finder to get analytics for the specified entity i.e company, account, campaign. See the docs hereRead-onlyv0.0.8 -
Create Report By Advertiser Account
actionSample query using analytics finder that gets analytics for a particular account for date range starting in a given year. See the docs hereRead-onlyv0.0.8 -
List Accounts Options
actionRetrieves available options for the Accounts field.Read-onlyv0.0.2 -
Query Analytics Finder Campaign Sample
actionSample query using analytics finder that gets analytics for a particular campaign in a date range starting in a given year. See the docs hereRead-onlyv0.0.8 -
Send Conversion Event
actionSends a conversion event to LinkedIn Ads. See the documentationWritev0.0.8
EVENTS
LinkedIn Ads triggers
Event sources your backend can deploy for users and receive through a webhook.
-
New Event Registration Form Response
triggerEmit new event when a fresh response is received on the event registration form. User needs to configure the prop of the specific event. See the documentationv0.0.6 -
New Lead Gen Form Created
triggerEmit new event when a new lead is captured through a form. See the documentationv0.0.5
MULTI-APP
Use LinkedIn Ads with other popular apps
Most products don't stop at one integration. Pair LinkedIn Ads with the other apps your users rely on, and ship use cases that span both.
- App slug
- linkedin_ads
- Authentication
- OAuth
- Categories
- Communication
- Actions
- 5
- Triggers
- 2
- API proxy
- Available
OAuth scopes
These are the scopes Pipedream's managed LinkedIn Ads OAuth client requests when one of your users connects an account. Supply your own OAuth client to request a different set.
- r_ads_reporting
- rw_ads
- r_ads
- r_basicprofile
- r_marketing_leadgen_automation
- r_ads_leadgen_automation
- r_organization_admin
- rw_conversions
- r_events