# Publish ad

POST https://services.leadconnectorhq.com/ad-publishing/google/ads/{adId}/publish

Publish a Google ad and push it live

## Authentication

Send `Authorization: Bearer <token>` using:

- **Sub-Account token: OAuth access token or Private Integration Token.** Scopes: `adPublishing.write`

## Parameters

### Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Version` | string | Yes | API Version |

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `adId` | string | Yes | Ad identifier |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "HighLevel API",
    "version": "2021-07-28"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/ad-publishing/google/ads/{adId}/publish": {
      "post": {
        "summary": "Publish ad",
        "operationId": "publishAd",
        "description": "Publish a Google ad and push it live",
        "parameters": [
          {
            "name": "Version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "2021-07-28"
              ]
            }
          },
          {
            "name": "adId",
            "required": true,
            "in": "path",
            "description": "Ad identifier",
            "schema": {
              "example": "507f1f77bcf86cd799439011",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LocationIdBodyDTO"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The campaign moved to PUBLISHING. Returns the raw document, so the id is `_id` and `adGroups` are not populated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GooglePublishCampaignResponseDTO"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestDTO"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedDTO"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnprocessableDTO"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerErrorDTO"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [
              "adPublishing.write"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account.",
        "type": "http"
      },
      "Agency-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency (OR) Private Integration Token of Agency.",
        "type": "http"
      },
      "Agency-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency.",
        "type": "http"
      }
    },
    "schemas": {
      "LocationIdBodyDTO": {
        "type": "object",
        "properties": {
          "locationId": {
            "type": "string",
            "description": "Location identifier",
            "example": "HChooFuiyPpVYzeJ4HMe"
          }
        },
        "required": [
          "locationId"
        ],
        "title": "LocationIdBodyDTO"
      },
      "GooglePublishCampaignResponseDTO": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Campaign identifier, as `_id` rather than `id`",
            "example": "6a8438b2b112242a53b1ea6a"
          },
          "__v": {
            "type": "number",
            "description": "Mongoose internal version key",
            "example": 6
          },
          "name": {
            "type": "string",
            "description": "Campaign name",
            "example": "Spring promotion"
          },
          "locationId": {
            "type": "string",
            "description": "Location identifier",
            "example": "fRMewNQIxSyZ5R4nQyit"
          },
          "googleAdAccountId": {
            "type": "string",
            "description": "Google Ads customer id",
            "example": "6776452901"
          },
          "advertisingChannelType": {
            "type": "string",
            "description": "Advertising channel",
            "enum": [
              "SEARCH",
              "DEMAND_GEN"
            ],
            "example": "SEARCH"
          },
          "publishingStatus": {
            "type": "string",
            "description": "Status after the publish request, normally `PUBLISHING`",
            "enum": [
              "DRAFT",
              "SCHEDULED",
              "PUBLISHED",
              "PUBLISHING",
              "FAILED",
              "IN_REVIEW",
              "PAUSED",
              "ARCHIVED",
              "WITH_ISSUES",
              "REJECTED"
            ],
            "example": "PUBLISHING"
          },
          "source": {
            "type": "string",
            "description": "Where the campaign was created from",
            "example": "AD_MANAGER"
          },
          "budget": {
            "description": "Budget configuration",
            "example": {
              "budgetType": "DAILY",
              "amount": 50,
              "scheduleStartDate": "2026-08-18T00:00:00.000Z",
              "scheduleEndDate": "2026-09-18T00:00:00.000Z"
            },
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "budgetType": {
                    "type": "string",
                    "description": "Budget cadence",
                    "example": "DAILY"
                  },
                  "amount": {
                    "type": "number",
                    "description": "Budget amount in account currency",
                    "example": 50
                  },
                  "scheduleStartDate": {
                    "type": "string",
                    "description": "Schedule start",
                    "example": "2026-08-18T00:00:00.000Z"
                  },
                  "scheduleEndDate": {
                    "type": "string",
                    "description": "Schedule end",
                    "example": "2026-09-18T00:00:00.000Z"
                  }
                },
                "required": [
                  "budgetType",
                  "amount"
                ],
                "title": "GoogleCampaignBudgetDTO"
              }
            ]
          },
          "networkSettings": {
            "description": "Network placement settings",
            "example": {
              "targetSearchNetwork": true,
              "targetContentNetwork": false
            },
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "targetSearchNetwork": {
                    "type": "boolean",
                    "description": "Serve on the Search network",
                    "example": true
                  },
                  "targetContentNetwork": {
                    "type": "boolean",
                    "description": "Serve on the Display/content network",
                    "example": false
                  }
                },
                "required": [
                  "targetSearchNetwork",
                  "targetContentNetwork"
                ],
                "title": "GoogleNetworkSettingsDTO"
              }
            ]
          },
          "biddingStrategy": {
            "description": "Bidding configuration. `value` is omitted for strategies that do not take a target.",
            "example": {
              "type": "MAXIMIZE_CONVERSIONS",
              "value": 0
            },
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Bidding strategy",
                    "example": "MAXIMIZE_CONVERSIONS"
                  },
                  "value": {
                    "type": "number",
                    "description": "Target value for the strategy, 0 when unset",
                    "example": 0
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "title": "GoogleBiddingStrategyResponseDTO"
              }
            ]
          },
          "assets": {
            "type": "object",
            "description": "Attached assets by kind",
            "additionalProperties": true,
            "example": {
              "calls": [
                "customers/6776452901/assets/112233445"
              ],
              "sitelinks": [
                "customers/6776452901/assets/112233446"
              ],
              "leadForm": "customers/6776452901/assets/112233447",
              "images": [
                "customers/6776452901/assets/112233448"
              ]
            }
          },
          "audience": {
            "description": "Campaign level targeting",
            "example": {
              "locales": [
                {
                  "name": "English",
                  "key": "1000",
                  "id": "1000",
                  "resourceName": "languageConstants/1000"
                }
              ],
              "geoLocations": [
                {
                  "key": "geoTargetConstants/2840",
                  "id": "ChIJOwg_06VPwokRYv534QaPC8g",
                  "name": "New York",
                  "countryName": "United States",
                  "type": "city",
                  "radius": 25,
                  "radiusUnit": "mi",
                  "selectionType": "include",
                  "resourceName": "customers/123/geoTargetConstants/2840",
                  "placeId": "ChIJOwg_06VPwokRYv534QaPC8g",
                  "formattedAddress": "New York, NY, USA",
                  "geometry": {
                    "location": {
                      "lat": 40.7128,
                      "lng": -74.006
                    },
                    "locationType": "APPROXIMATE"
                  },
                  "addressComponents": [
                    {
                      "longName": "New York",
                      "shortName": "NY",
                      "types": [
                        "locality",
                        "political"
                      ]
                    }
                  ]
                }
              ],
              "gender": [
                {
                  "enum": "MALE",
                  "negative": false
                }
              ],
              "ageRange": [
                {
                  "enum": "AGE_RANGE_25_34",
                  "negative": false
                }
              ],
              "segments": [
                "customers/6776452901/userLists/9215680180"
              ],
              "targetInterests": {
                "affinity": [
                  "customers/6776452901/userInterests/80351"
                ],
                "inMarket": [
                  "customers/6776452901/userInterests/80148"
                ]
              }
            },
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "locales": {
                    "description": "Language targeting",
                    "example": [
                      {
                        "name": "English",
                        "key": "1000",
                        "id": "1000",
                        "resourceName": "languageConstants/1000"
                      }
                    ],
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "description": "Language display name",
                          "example": "English"
                        },
                        "key": {
                          "type": "string",
                          "description": "Language key",
                          "example": "1000"
                        },
                        "id": {
                          "type": "string",
                          "description": "Language identifier",
                          "example": "1000"
                        },
                        "resourceName": {
                          "type": "string",
                          "description": "Language resource name",
                          "example": "languageConstants/1000"
                        }
                      },
                      "title": "GoogleLocaleDTO"
                    }
                  },
                  "geoLocations": {
                    "description": "Geographic targeting",
                    "example": [
                      {
                        "key": "geoTargetConstants/2840",
                        "id": "ChIJOwg_06VPwokRYv534QaPC8g",
                        "name": "New York",
                        "countryName": "United States",
                        "type": "city",
                        "radius": 25,
                        "radiusUnit": "mi",
                        "selectionType": "include",
                        "resourceName": "customers/123/geoTargetConstants/2840",
                        "placeId": "ChIJOwg_06VPwokRYv534QaPC8g",
                        "formattedAddress": "New York, NY, USA",
                        "geometry": {
                          "location": {
                            "lat": 40.7128,
                            "lng": -74.006
                          },
                          "locationType": "APPROXIMATE"
                        },
                        "addressComponents": [
                          {
                            "longName": "New York",
                            "shortName": "NY",
                            "types": [
                              "locality",
                              "political"
                            ]
                          }
                        ]
                      }
                    ],
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string",
                          "description": "Geo target constant resource name",
                          "example": "geoTargetConstants/2840"
                        },
                        "id": {
                          "type": "string",
                          "description": "Location identifier (place_id)",
                          "example": "ChIJOwg_06VPwokRYv534QaPC8g"
                        },
                        "name": {
                          "type": "string",
                          "description": "Location display name",
                          "example": "New York"
                        },
                        "countryName": {
                          "type": "string",
                          "description": "Country name",
                          "example": "United States"
                        },
                        "type": {
                          "type": "string",
                          "description": "Location type (city, region, country, address, etc.)",
                          "example": "city"
                        },
                        "radius": {
                          "type": "number",
                          "description": "Radius for proximity targeting",
                          "example": 25
                        },
                        "radiusUnit": {
                          "type": "string",
                          "description": "Radius unit",
                          "enum": [
                            "km",
                            "mi"
                          ],
                          "example": "mi"
                        },
                        "selectionType": {
                          "type": "string",
                          "description": "Include or exclude this location",
                          "enum": [
                            "include",
                            "exclude"
                          ],
                          "example": "include"
                        },
                        "resourceName": {
                          "type": "string",
                          "description": "Google Ads resource name",
                          "example": "customers/123/geoTargetConstants/2840"
                        },
                        "placeId": {
                          "type": "string",
                          "description": "Google place ID",
                          "example": "ChIJOwg_06VPwokRYv534QaPC8g"
                        },
                        "formattedAddress": {
                          "type": "string",
                          "description": "Full formatted address string",
                          "example": "New York, NY, USA"
                        },
                        "geometry": {
                          "description": "Geometry data from Google Geocoding API",
                          "example": {
                            "location": {
                              "lat": 40.7128,
                              "lng": -74.006
                            },
                            "locationType": "APPROXIMATE"
                          },
                          "allOf": [
                            {
                              "type": "object",
                              "properties": {
                                "location": {
                                  "description": "Location coordinates",
                                  "example": {
                                    "lat": 40.7128,
                                    "lng": -74.006
                                  },
                                  "allOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "lat": {
                                          "type": "number",
                                          "description": "Latitude",
                                          "example": 40.7128
                                        },
                                        "lng": {
                                          "type": "number",
                                          "description": "Longitude",
                                          "example": -74.006
                                        }
                                      },
                                      "title": "GeoLatLngDTO"
                                    }
                                  ]
                                },
                                "locationType": {
                                  "type": "string",
                                  "description": "Location type (e.g. APPROXIMATE)",
                                  "example": "APPROXIMATE"
                                },
                                "viewport": {
                                  "description": "Viewport bounding box",
                                  "example": {
                                    "northeast": {
                                      "lat": 40.8,
                                      "lng": -73.9
                                    },
                                    "southwest": {
                                      "lat": 40.6,
                                      "lng": -74.1
                                    }
                                  },
                                  "allOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "northeast": {
                                          "description": "Northeast corner of the viewport",
                                          "example": {
                                            "lat": 40.8,
                                            "lng": -73.9
                                          },
                                          "allOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "lat": {
                                                  "type": "number",
                                                  "description": "Latitude",
                                                  "example": 40.7128
                                                },
                                                "lng": {
                                                  "type": "number",
                                                  "description": "Longitude",
                                                  "example": -74.006
                                                }
                                              },
                                              "title": "GeoLatLngDTO"
                                            }
                                          ]
                                        },
                                        "southwest": {
                                          "description": "Southwest corner of the viewport",
                                          "example": {
                                            "lat": 40.6,
                                            "lng": -74.1
                                          },
                                          "allOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "lat": {
                                                  "type": "number",
                                                  "description": "Latitude",
                                                  "example": 40.7128
                                                },
                                                "lng": {
                                                  "type": "number",
                                                  "description": "Longitude",
                                                  "example": -74.006
                                                }
                                              },
                                              "title": "GeoLatLngDTO"
                                            }
                                          ]
                                        }
                                      },
                                      "title": "GeoViewportDTO"
                                    }
                                  ]
                                }
                              },
                              "title": "GeoGeometryDTO"
                            }
                          ]
                        },
                        "addressComponents": {
                          "description": "Address components from Google Geocoding API",
                          "example": [
                            {
                              "longName": "New York",
                              "shortName": "NY",
                              "types": [
                                "locality",
                                "political"
                              ]
                            }
                          ],
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "longName": {
                                "type": "string",
                                "description": "Full name of the address component",
                                "example": "New York"
                              },
                              "shortName": {
                                "type": "string",
                                "description": "Abbreviated name of the address component",
                                "example": "NY"
                              },
                              "types": {
                                "description": "Address component types",
                                "example": [
                                  "locality",
                                  "political"
                                ],
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "title": "GeoAddressComponentDTO"
                          }
                        }
                      },
                      "title": "GoogleGeoLocationDTO"
                    }
                  },
                  "gender": {
                    "description": "Gender targeting",
                    "example": [
                      {
                        "enum": "MALE",
                        "negative": false
                      }
                    ],
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "enum": {
                          "type": "string",
                          "description": "Gender to target",
                          "example": "MALE",
                          "enum": [
                            "MALE",
                            "FEMALE",
                            "UNDETERMINED"
                          ]
                        },
                        "negative": {
                          "type": "boolean",
                          "description": "Whether this is a negative target",
                          "example": false
                        }
                      },
                      "required": [
                        "enum",
                        "negative"
                      ],
                      "title": "GoogleGenderTargetDTO"
                    }
                  },
                  "ageRange": {
                    "description": "Age range targeting",
                    "example": [
                      {
                        "enum": "AGE_RANGE_25_34",
                        "negative": false
                      }
                    ],
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "enum": {
                          "type": "string",
                          "description": "Age bucket to target",
                          "example": "AGE_RANGE_25_34",
                          "enum": [
                            "AGE_RANGE_18_24",
                            "AGE_RANGE_25_34",
                            "AGE_RANGE_35_44",
                            "AGE_RANGE_45_54",
                            "AGE_RANGE_55_64",
                            "AGE_RANGE_65_UP",
                            "AGE_RANGE_UNDETERMINED"
                          ]
                        },
                        "negative": {
                          "type": "boolean",
                          "description": "Whether this is a negative target",
                          "example": false
                        }
                      },
                      "required": [
                        "enum",
                        "negative"
                      ],
                      "title": "GoogleAgeRangeTargetDTO"
                    }
                  },
                  "segments": {
                    "description": "Audience segment resource names",
                    "example": [
                      "customers/6776452901/userLists/9215680180"
                    ],
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "targetInterests": {
                    "description": "Affinity and in-market interests",
                    "example": {
                      "affinity": [
                        "customers/6776452901/userInterests/80351"
                      ],
                      "inMarket": [
                        "customers/6776452901/userInterests/80148"
                      ]
                    },
                    "allOf": [
                      {
                        "type": "object",
                        "properties": {
                          "affinity": {
                            "description": "Affinity audience resource names",
                            "example": [
                              "customers/6776452901/userInterests/80351"
                            ],
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "inMarket": {
                            "description": "In-market audience resource names",
                            "example": [
                              "customers/6776452901/userInterests/80148"
                            ],
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "required": [
                          "affinity",
                          "inMarket"
                        ],
                        "title": "GoogleTargetInterestsDTO"
                      }
                    ]
                  }
                },
                "required": [
                  "locales",
                  "geoLocations"
                ],
                "title": "GoogleCampaignAudienceDTO"
              }
            ]
          },
          "adSchedule": {
            "description": "Ad scheduling windows",
            "example": [
              {
                "dayOfWeek": "ALL_DAYS",
                "from": "09_00",
                "to": "17_30",
                "_id": "6a855ca9867e604d24f4b8fa"
              }
            ],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "dayOfWeek": {
                  "type": "string",
                  "description": "Day or day-group the window applies to",
                  "enum": [
                    "FRIDAY",
                    "MONDAY",
                    "SATURDAY",
                    "SUNDAY",
                    "THURSDAY",
                    "TUESDAY",
                    "UNKNOWN",
                    "UNSPECIFIED",
                    "WEDNESDAY",
                    "ALL_DAYS",
                    "MONDAY_TO_FRIDAY",
                    "SATURDAY_AND_SUNDAY"
                  ],
                  "example": "ALL_DAYS"
                },
                "from": {
                  "type": "string",
                  "description": "Window start as `HH_MM` with an underscore separator, not a colon",
                  "example": "09_00"
                },
                "to": {
                  "type": "string",
                  "description": "Window end as `HH_MM` with an underscore separator",
                  "example": "17_30"
                },
                "_id": {
                  "type": "string",
                  "description": "Mongo subdocument id. Note this is `_id`, not `id` — the id transform applies to the top-level document only.",
                  "example": "6a855ca9867e604d24f4b8fa"
                }
              },
              "required": [
                "dayOfWeek",
                "from",
                "to"
              ],
              "title": "GoogleAdScheduleEntryDTO"
            }
          },
          "meta": {
            "description": "Ancillary campaign metadata",
            "example": {
              "evaluate": "{\"opportunityScore\":18,\"confidence\":\"High\",\"band\":\"Low\",\"categories\":[],\"fixItems\":[]}"
            },
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "evaluate": {
                    "type": "string",
                    "description": "Opportunity-score result, stored as a JSON **string** rather than an object — parse before use. Present only after the campaign has been evaluated.",
                    "example": "{\"opportunityScore\":18,\"confidence\":\"High\",\"band\":\"Low\",\"categories\":[],\"fixItems\":[]}"
                  }
                },
                "title": "GoogleCampaignMetaDTO"
              }
            ]
          },
          "googleError": {
            "type": "string",
            "description": "Publish error from Google, null when the request was accepted",
            "example": null,
            "nullable": true
          },
          "isEuPoliticalAds": {
            "type": "boolean",
            "description": "Whether the campaign is declared as EU political advertising",
            "example": false
          },
          "createdBy": {
            "type": "string",
            "description": "User who created the campaign",
            "example": "uPy3hdVIuuNlbWOpBYGw"
          },
          "updatedBy": {
            "type": "string",
            "description": "User who last updated the campaign",
            "example": "hzN33mfYO5c1LHqsExRC"
          },
          "createdAt": {
            "type": "string",
            "description": "Created at",
            "example": "2026-08-18T10:49:22.412Z"
          },
          "updatedAt": {
            "type": "string",
            "description": "Updated at",
            "example": "2026-08-19T08:10:33.333Z"
          }
        },
        "required": [
          "_id",
          "__v",
          "name",
          "locationId",
          "googleAdAccountId",
          "advertisingChannelType",
          "publishingStatus",
          "source",
          "budget",
          "networkSettings",
          "biddingStrategy",
          "assets",
          "audience",
          "adSchedule",
          "isEuPoliticalAds",
          "createdBy",
          "updatedBy",
          "createdAt",
          "updatedAt"
        ],
        "title": "GooglePublishCampaignResponseDTO"
      },
      "BadRequestDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 400
          },
          "message": {
            "type": "string",
            "example": "Bad Request"
          }
        },
        "title": "BadRequestDTO"
      },
      "UnauthorizedDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 401
          },
          "message": {
            "type": "string",
            "example": "Invalid token: access token is invalid"
          },
          "error": {
            "type": "string",
            "example": "Unauthorized"
          }
        },
        "title": "UnauthorizedDTO"
      },
      "UnprocessableDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 422
          },
          "message": {
            "example": [
              "Unprocessable Entity"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "error": {
            "type": "string",
            "example": "Unprocessable Entity"
          }
        },
        "title": "UnprocessableDTO"
      },
      "InternalServerErrorDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "description": "HTTP status code for an unexpected server error",
            "example": 500
          },
          "message": {
            "type": "string",
            "description": "Error message describing the server failure",
            "example": "Internal Server Error"
          }
        },
        "title": "InternalServerErrorDTO"
      }
    }
  }
}
```

## Code Examples

**cURL**

```bash
curl -L -X POST 'https://services.leadconnectorhq.com/ad-publishing/google/ads/<adId>/publish' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: 2021-07-28' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "locationId": "HChooFuiyPpVYzeJ4HMe"
}'
```

**Node.js**

```javascript
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: '2021-07-28',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
      "locationId": "HChooFuiyPpVYzeJ4HMe"
  })
};

try {
  const response = await fetch('https://services.leadconnectorhq.com/ad-publishing/google/ads/<adId>/publish', options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**Python**

```python
import requests

url = "https://services.leadconnectorhq.com/ad-publishing/google/ads/{adId}/publish"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "2021-07-28"
}

payload = {
    "locationId": "HChooFuiyPpVYzeJ4HMe"
}

response = requests.post(url, json=payload, headers=headers)
print(response.json())
```

**PHP**

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://services.leadconnectorhq.com/ad-publishing/google/ads/<adId>/publish',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: 2021-07-28',
    'Content-Type: application/json',
  ],
  CURLOPT_POSTFIELDS => '{
  "locationId": "HChooFuiyPpVYzeJ4HMe"
}',
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

**Java**

```java
HttpResponse<String> response = Unirest
  .post("https://services.leadconnectorhq.com/ad-publishing/google/ads/<adId>/publish")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "2021-07-28")
  .header("Content-Type", "application/json")
  .body("{\"locationId\":\"HChooFuiyPpVYzeJ4HMe\"}")
  .asString();
```

**Go**

```go
package main

import (
  "fmt"
  "net/http"
  "io"
  "strings"
)

func main() {
  url := "https://services.leadconnectorhq.com/ad-publishing/google/ads/<adId>/publish"
  payload := strings.NewReader(`{
  "locationId": "HChooFuiyPpVYzeJ4HMe"
}`)
  req, _ := http.NewRequest("POST", url, payload)
  req.Header.Add("Authorization", "Bearer <TOKEN>")
  req.Header.Add("Version", "2021-07-28")

  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

**Ruby**

```ruby
require 'uri'
require 'net/http'

url = URI("https://services.leadconnectorhq.com/ad-publishing/google/ads/<adId>/publish")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer <TOKEN>"
request["Version"] = "2021-07-28"
request["Content-Type"] = "application/json"
request.body = '{
  "locationId": "HChooFuiyPpVYzeJ4HMe"
}'

response = http.request(request)
puts response.read_body
```

**PowerShell**

```powershell
$headers = @{
  "Authorization" = "Bearer <TOKEN>"
  "Version" = "2021-07-28"
}

$body = '{
  "locationId": "HChooFuiyPpVYzeJ4HMe"
}'

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/ad-publishing/google/ads/<adId>/publish' -Method 'POST' -Headers $headers -Body $body -ContentType 'application/json'
$response | ConvertTo-Json
```
