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.
Call through Alter
Section titled “Call through Alter”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 osfrom alter_sdk import Appfrom 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()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
body | Model | Required within parent | Expand Upsert ad campaign group — request body — body |
Referenced models: Upsert ad campaign group — request body — body
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root |
Schemas
Section titled “Schemas”2 more schemas are linked from the tables above, on the schema pages.
Upsert ad campaign group — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
adBudgetOptimization | string | Optional | Ad budget optimization mode One of: MAXIMUM_DELIVERY, COST_CAP |
adCampaignGroupId | string | Optional | LinkedIn campaign group resource ID |
adCampaigns | array | Optional | Child ad campaigns |
adCampaigns[] | Model | Each item | Expand Upsert ad campaign group — request body — body ad Campaigns item |
budget | JSON | Optional | Campaign group budget |
budget (allOf 1) | Model | All variants apply | Expand Upsert ad campaign group — request body — body / budget / budgetType: DAILY, LIFETIME |
id | string | Optional | Internal ID |
linkedInAdAccountId | string | Optional | LinkedIn ad account identifier |
linkedInError | string | Optional | LinkedIn API error message |
locationId | string | Required within parent | Location ID |
meta | object | Optional | Additional metadata |
name | string | Optional | Campaign group name |
objectiveType | string | Optional | Campaign group objective One of: LEAD_GENERATION, WEBSITE_VISIT |
publishingStatus | string | Optional | Publishing status One of: DRAFT, SCHEDULED, PUBLISHED, PUBLISHING, FAILED, IN_REVIEW, PAUSED, ARCHIVED, WITH_ISSUES, REJECTED |
unpublishedChanges | boolean | Optional | Whether 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
adCampaignGroupId | string | Optional | Parent campaign group identifier |
adCampaignId | string | Optional | LinkedIn campaign resource ID |
ads | array | Optional | Ads in the campaign |
ads[] | Model | Each item | Expand Upsert ad campaign group — request body — body ad Campaigns item ads item |
audience | JSON | Optional | Campaign audience targeting |
audience (allOf 1) | Model | All variants apply | Expand Upsert ad campaign group — request body — body ad Campaigns item audience geo Locations, target Audience |
campaignType | string | Optional | LinkedIn campaign type |
id | string | Optional | Internal campaign identifier |
linkedInError | string | Optional | LinkedIn API error message |
locale | JSON | Optional | Campaign locale |
locale (allOf 1) | Model | All variants apply | Expand Create lead form — request body — body creation Locale country, language |
mediaType | string | Optional | Creative media type for the campaign One of: STANDARD_UPDATE, SINGLE_VIDEO, CAROUSEL |
meta | object | Optional | Additional campaign metadata |
name | string | Optional | Campaign name |
publishingStatus | string | Optional | Publishing status One of: DRAFT, SCHEDULED, PUBLISHED, PUBLISHING, FAILED, IN_REVIEW, PAUSED, ARCHIVED, WITH_ISSUES, REJECTED |
unitCost | JSON | Optional | Bid unit cost |
unitCost (allOf 1) | Model | All variants apply | Expand 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
amount | number | Optional | Budget amount (currency minor units) |
budgetType | string | Optional | LinkedIn campaign budget type One of: DAILY, LIFETIME |
scheduleEndDate | string | Optional | Schedule end date (ISO 8601) |
scheduleStartDate | string | Optional | Schedule start date (ISO 8601) |
Upsert ad campaign group — request body — body ad Campaigns item audience geo Locations, target Audience
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
geoLocations | array | Optional | Geographic location targets |
geoLocations[] | Model | Each item | Expand Upsert ad campaign group — request body — body ad Campaigns item audience geo Locations, target Audience geo Locations item |
targetAudience | JSON | Optional | Target audience attribute selections |
targetAudience (allOf 1) | Model | All variants apply | Expand 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
country | string | Required within parent | Country code |
language | string | Required within parent | Language code |
Upsert ad campaign group — request body — body ad Campaigns item ads item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
adCampaignGroupId | string | Optional | Parent campaign group identifier |
adCampaignId | string | Optional | Parent ad campaign identifier |
adId | string | Optional | LinkedIn ad resource ID |
callToActionLabel | string | Optional | Call to action label |
contentReferenceString | string | Optional | Content reference URN for boosted posts |
description | string | Optional | Ad description |
destinationFormId | string | Optional | Destination lead-gen form ID |
destinationUrl | string | Optional | Click-through destination URL |
headline | string | Optional | Ad headline |
id | string | Optional | Ad identifier |
introductoryText | string | Optional | Introductory ad copy shown above the creative |
linkedInError | string | Optional | LinkedIn API error message |
media | array | Optional | Ad creative media |
media[] | Model | Each item | Expand Upsert ad campaign group — request body — body ad Campaigns item ads item media item |
meta | object | Optional | Additional ad metadata |
name | string | Optional | Ad name |
publishingStatus | string | Optional | Ad 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
amount | number | Required within parent | Bid amount in currency minor units |
Upsert ad campaign group — request body — body ad Campaigns item audience geo Locations, target Audience geo Locations item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
facetUrn | string | Required within parent | Facet URN |
name | string | Required within parent | Location display name |
selectionType | string | Required within parent | Selection type One of: include, exclude |
urn | string | Required within parent | Location URN |
Upsert ad campaign group — request body — body ad Campaigns item ads item media item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
destinationUrl | string | Optional | Click-through destination URL |
fileSizeBytes | number | Optional | File size in bytes |
frames | array | Optional | Video frame URLs |
frames[] | string | Each item | |
headline | string | Optional | Media headline |
name | string | Optional | Media name |
selectedPoster | number | Optional | Selected poster frame index |
src | string | Optional | Media source URL |
thumbnailUrl | string | Optional | Thumbnail URL |
type | string | Optional | Media type One of: video, image |
Policy, approvals and errors
Section titled “Policy, approvals and errors”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"}