openapi: 3.1.0 info: title: LinkedIn Marketing API description: | Partial OpenAPI 3.1 representation of the LinkedIn Marketing API for advertising, campaign management, audience targeting, and reporting. Uses OAuth 2.0 three-legged (authorization code) flow and requires a `LinkedIn-Version` header in YYYYMM format on every versioned request. Reference documentation lives at https://learn.microsoft.com/en-us/linkedin/marketing/. version: "2026.05" contact: name: LinkedIn Marketing API Program url: https://learn.microsoft.com/en-us/linkedin/marketing/ servers: - url: https://api.linkedin.com/rest description: Versioned REST endpoint. security: - OAuth2: [rw_ads] paths: /adAccounts: post: summary: Create an ad account operationId: createAdAccount security: - OAuth2: [rw_ads] parameters: - $ref: '#/components/parameters/LinkedInVersion' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/AdAccount' responses: '201': description: Ad account created. The created entity ID is returned in the `x-restli-id` response header. headers: x-restli-id: schema: type: string /adAccounts/{adAccountId}: get: summary: Get an ad account operationId: getAdAccount security: - OAuth2: [r_ads, rw_ads] parameters: - $ref: '#/components/parameters/LinkedInVersion' - name: adAccountId in: path required: true schema: type: string responses: '200': description: The requested ad account. content: application/json: schema: $ref: '#/components/schemas/AdAccount' /adAccounts/{adAccountId}/adCampaignGroups: post: summary: Create a campaign group operationId: createAdCampaignGroup security: - OAuth2: [rw_ads] parameters: - $ref: '#/components/parameters/LinkedInVersion' - name: adAccountId in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/AdCampaignGroup' responses: '201': description: Campaign group created. headers: x-restli-id: schema: type: string /adAccounts/{adAccountId}/adCampaigns: post: summary: Create a campaign operationId: createAdCampaign security: - OAuth2: [rw_ads] parameters: - $ref: '#/components/parameters/LinkedInVersion' - name: adAccountId in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/AdCampaign' responses: '201': description: Campaign created. headers: x-restli-id: schema: type: string /adAccounts/{adAccountId}/creatives: post: summary: Create an ad creative operationId: createCreative security: - OAuth2: [rw_ads] parameters: - $ref: '#/components/parameters/LinkedInVersion' - name: adAccountId in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Creative' responses: '201': description: Creative created. headers: x-restli-id: schema: type: string /adTargetingFacets: get: summary: List ad targeting facets operationId: listAdTargetingFacets security: - OAuth2: [r_ads, rw_ads] parameters: - $ref: '#/components/parameters/LinkedInVersion' responses: '200': description: Available targeting facets. content: application/json: schema: type: object properties: elements: type: array items: type: object properties: facetName: type: string entityTypes: type: array items: type: string $URN: type: string /adTargetingEntities: get: summary: Discover entities within a targeting facet operationId: getAdTargetingEntities security: - OAuth2: [r_ads, rw_ads] parameters: - $ref: '#/components/parameters/LinkedInVersion' - name: q in: query required: true schema: type: string enum: [adTargetingFacet] - name: queryVersion in: query schema: type: string default: QUERY_USES_URNS - name: facet in: query required: true description: Facet URN, e.g. `urn:li:adTargetingFacet:seniorities`. schema: type: string responses: '200': description: Entities within the requested facet. /audienceCounts: get: summary: Estimate audience count operationId: getAudienceCounts security: - OAuth2: [r_ads, rw_ads] parameters: - $ref: '#/components/parameters/LinkedInVersion' - name: q in: query required: true schema: type: string enum: [targetingCriteria] responses: '200': description: Audience count results. /adBudgetPricing: get: summary: Get ad budget pricing operationId: getAdBudgetPricing security: - OAuth2: [r_ads, rw_ads] parameters: - $ref: '#/components/parameters/LinkedInVersion' - name: account in: query required: true schema: type: string - name: bidType in: query required: true schema: type: string enum: [CPM, CPC, CPV] - name: campaignType in: query required: true schema: type: string enum: [TEXT_AD, SPONSORED_UPDATES, SPONSORED_INMAILS] - name: matchType in: query schema: type: string enum: [EXACT] - name: q in: query required: true schema: type: string enum: [criteria] responses: '200': description: Pricing metrics including suggested, min, and max bids. components: parameters: LinkedInVersion: name: LinkedIn-Version in: header required: true description: API version in `YYYYMM` format, e.g. `202605`. schema: type: string pattern: '^\d{6}$' securitySchemes: OAuth2: type: oauth2 description: OAuth 2.0 three-legged (authorization code) flow. flows: authorizationCode: authorizationUrl: https://www.linkedin.com/oauth/v2/authorization tokenUrl: https://www.linkedin.com/oauth/v2/accessToken scopes: r_ads: Read ads accounts, campaigns, and creatives. rw_ads: Read and write ads accounts, campaigns, and creatives. r_ads_reporting: Read ad campaign reporting data. r_basicprofile: Read basic profile. schemas: AdAccount: type: object required: [currency, name, type, reference] properties: currency: type: string example: USD name: type: string notifiedOnCampaignOptimization: type: boolean notifiedOnCreativeApproval: type: boolean notifiedOnCreativeRejection: type: boolean notifiedOnEndOfCampaign: type: boolean reference: type: string description: Owning organization URN, e.g. `urn:li:organization:101202303`. type: type: string enum: [BUSINESS, ENTERPRISE] AdCampaignGroup: type: object properties: account: type: string name: type: string runSchedule: type: object properties: start: type: integer format: int64 end: type: integer format: int64 status: type: string enum: [ACTIVE, PAUSED, ARCHIVED, DRAFT] totalBudget: $ref: '#/components/schemas/MoneyAmount' AdCampaign: type: object properties: account: type: string name: type: string type: type: string enum: [TEXT_AD, SPONSORED_UPDATES, SPONSORED_INMAILS] costType: type: string enum: [CPC, CPM, CPV] dailyBudget: $ref: '#/components/schemas/MoneyAmount' unitCost: $ref: '#/components/schemas/MoneyAmount' locale: type: object properties: country: type: string language: type: string runSchedule: type: object properties: start: type: integer format: int64 end: type: integer format: int64 targetingCriteria: type: object audienceExpansionEnabled: type: boolean creativeSelection: type: string offsiteDeliveryEnabled: type: boolean Creative: type: object properties: campaign: type: string status: type: string enum: [ACTIVE, PAUSED, ARCHIVED, DRAFT] type: type: string enum: [TEXT_AD, SPONSORED_UPDATES, SPONSORED_INMAILS] variables: type: object MoneyAmount: type: object properties: amount: type: string currencyCode: type: string