Skip to content

HighLevel: Upsert ad campaign group

HighLevel adPublishing.liUpsertCampaignGroup: arguments, response, policy and SDK examples.

← Ad publishing operations · Get started

Operation gohighlevel.li_upsert_campaign_group

Provider route: PUT /ad-publishing/linkedin/ads. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/gohighlevel with npm, or alter-sdk-gohighlevel with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { HighLevelIntegration } from "@alter-ai/gohighlevel";
async function execute(input: Parameters<HighLevelIntegration["adPublishing"]["liUpsertCampaignGroup"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new HighLevelIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.adPublishing.liUpsertCampaignGroup(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_gohighlevel import HighLevelIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = HighLevelIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.ad_publishing.li_upsert_campaign_group(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
bodyModelRequired within parentExpand Upsert ad campaign group — request body — body

Referenced models: Upsert ad campaign group — request body — body

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$JSONRoot

2 more schemas are linked from the tables above, on the schema pages.

Upsert ad campaign group — request body — body
FieldTypePresenceDescription and constraints
$objectRoot
adBudgetOptimizationstringOptionalAd budget optimization mode
One of: MAXIMUM_DELIVERY, COST_CAP
adCampaignGroupIdstringOptionalLinkedIn campaign group resource ID
adCampaignsarrayOptionalChild ad campaigns
adCampaigns[]ModelEach itemExpand Upsert ad campaign group — request body — body ad Campaigns item
budgetJSONOptionalCampaign group budget
budget (allOf 1)ModelAll variants applyExpand Upsert ad campaign group — request body — body / budget / budgetType: DAILY, LIFETIME
idstringOptionalInternal ID
linkedInAdAccountIdstringOptionalLinkedIn ad account identifier
linkedInErrorstringOptionalLinkedIn API error message
locationIdstringRequired within parentLocation ID
metaobjectOptionalAdditional metadata
namestringOptionalCampaign group name
objectiveTypestringOptionalCampaign group objective
One of: LEAD_GENERATION, WEBSITE_VISIT
publishingStatusstringOptionalPublishing status
One of: DRAFT, SCHEDULED, PUBLISHED, PUBLISHING, FAILED, IN_REVIEW, PAUSED, ARCHIVED, WITH_ISSUES, REJECTED
unpublishedChangesbooleanOptionalWhether the campaign group has unpublished changes

Referenced models: Upsert ad campaign group — request body — body ad Campaigns item, Upsert ad campaign group — request body — body / budget / budgetType: DAILY, LIFETIME

Upsert ad campaign group — request body — body ad Campaigns item
FieldTypePresenceDescription and constraints
$objectRoot
adCampaignGroupIdstringOptionalParent campaign group identifier
adCampaignIdstringOptionalLinkedIn campaign resource ID
adsarrayOptionalAds in the campaign
ads[]ModelEach itemExpand Upsert ad campaign group — request body — body ad Campaigns item ads item
audienceJSONOptionalCampaign audience targeting
audience (allOf 1)ModelAll variants applyExpand Upsert ad campaign group — request body — body ad Campaigns item audience geo Locations, target Audience
campaignTypestringOptionalLinkedIn campaign type
idstringOptionalInternal campaign identifier
linkedInErrorstringOptionalLinkedIn API error message
localeJSONOptionalCampaign locale
locale (allOf 1)ModelAll variants applyExpand Create lead form — request body — body creation Locale country, language
mediaTypestringOptionalCreative media type for the campaign
One of: STANDARD_UPDATE, SINGLE_VIDEO, CAROUSEL
metaobjectOptionalAdditional campaign metadata
namestringOptionalCampaign name
publishingStatusstringOptionalPublishing status
One of: DRAFT, SCHEDULED, PUBLISHED, PUBLISHING, FAILED, IN_REVIEW, PAUSED, ARCHIVED, WITH_ISSUES, REJECTED
unitCostJSONOptionalBid unit cost
unitCost (allOf 1)ModelAll variants applyExpand Upsert ad campaign group — request body — body ad Campaigns item unit Cost amount

Referenced models: Upsert ad campaign group — request body — body ad Campaigns item audience geo Locations, target Audience, Create lead form — request body — body creation Locale country, language, Upsert ad campaign group — request body — body ad Campaigns item ads item, Upsert ad campaign group — request body — body ad Campaigns item unit Cost amount

Upsert ad campaign group — request body — body / budget / budgetType: DAILY, LIFETIME
FieldTypePresenceDescription and constraints
$objectRoot
amountnumberOptionalBudget amount (currency minor units)
budgetTypestringOptionalLinkedIn campaign budget type
One of: DAILY, LIFETIME
scheduleEndDatestringOptionalSchedule end date (ISO 8601)
scheduleStartDatestringOptionalSchedule start date (ISO 8601)
Upsert ad campaign group — request body — body ad Campaigns item audience geo Locations, target Audience
FieldTypePresenceDescription and constraints
$objectRoot
geoLocationsarrayOptionalGeographic location targets
geoLocations[]ModelEach itemExpand Upsert ad campaign group — request body — body ad Campaigns item audience geo Locations, target Audience geo Locations item
targetAudienceJSONOptionalTarget audience attribute selections
targetAudience (allOf 1)ModelAll variants applyExpand Upsert ad campaign group — request body — body ad Campaigns item audience geo Locations, target Audience target Audience exclude, include

Referenced models: Upsert ad campaign group — request body — body ad Campaigns item audience geo Locations, target Audience geo Locations item, Upsert ad campaign group — request body — body ad Campaigns item audience geo Locations, target Audience target Audience exclude, include

Create lead form — request body — body creation Locale country, language
FieldTypePresenceDescription and constraints
$objectRoot
countrystringRequired within parentCountry code
languagestringRequired within parentLanguage code
Upsert ad campaign group — request body — body ad Campaigns item ads item
FieldTypePresenceDescription and constraints
$objectRoot
adCampaignGroupIdstringOptionalParent campaign group identifier
adCampaignIdstringOptionalParent ad campaign identifier
adIdstringOptionalLinkedIn ad resource ID
callToActionLabelstringOptionalCall to action label
contentReferenceStringstringOptionalContent reference URN for boosted posts
descriptionstringOptionalAd description
destinationFormIdstringOptionalDestination lead-gen form ID
destinationUrlstringOptionalClick-through destination URL
headlinestringOptionalAd headline
idstringOptionalAd identifier
introductoryTextstringOptionalIntroductory ad copy shown above the creative
linkedInErrorstringOptionalLinkedIn API error message
mediaarrayOptionalAd creative media
media[]ModelEach itemExpand Upsert ad campaign group — request body — body ad Campaigns item ads item media item
metaobjectOptionalAdditional ad metadata
namestringOptionalAd name
publishingStatusstringOptionalAd publishing status
One of: DRAFT, SCHEDULED, PUBLISHED, PUBLISHING, FAILED, IN_REVIEW, PAUSED, ARCHIVED, WITH_ISSUES, REJECTED

Referenced models: Upsert ad campaign group — request body — body ad Campaigns item ads item media item

Upsert ad campaign group — request body — body ad Campaigns item unit Cost amount
FieldTypePresenceDescription and constraints
$objectRoot
amountnumberRequired within parentBid amount in currency minor units
Upsert ad campaign group — request body — body ad Campaigns item audience geo Locations, target Audience geo Locations item
FieldTypePresenceDescription and constraints
$objectRoot
facetUrnstringRequired within parentFacet URN
namestringRequired within parentLocation display name
selectionTypestringRequired within parentSelection type
One of: include, exclude
urnstringRequired within parentLocation URN
Upsert ad campaign group — request body — body ad Campaigns item ads item media item
FieldTypePresenceDescription and constraints
$objectRoot
destinationUrlstringOptionalClick-through destination URL
fileSizeBytesnumberOptionalFile size in bytes
framesarrayOptionalVideo frame URLs
frames[]stringEach item
headlinestringOptionalMedia headline
namestringOptionalMedia name
selectedPosternumberOptionalSelected poster frame index
srcstringOptionalMedia source URL
thumbnailUrlstringOptionalThumbnail URL
typestringOptionalMedia type
One of: video, image

SDK function policy ID: gohighlevel.li_upsert_campaign_group. Catalog operation: li-upsert-campaign-group. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Required provider scopes: ["adPublishing.write"]

Pinned headers: {"Version": "v3"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.