> ## Documentation Index
> Fetch the complete documentation index at: https://docs.base44.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Google Ads campaign

> <Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Changes one section of a campaign and pushes it to Google.

Send the section in `field` and its new value in `value`. One section per request. To change a name and a budget, send two requests. Every list in `value` is the COMPLETE set the campaign should end up with, so an item you leave out is removed unless the field says otherwise, and a key you don't send leaves that setting as it is. An unknown key or a value of the wrong type returns a 422.

Changing `ad_copy` sends the new text back through Google's policy review, so the campaign can return to a reviewing state and stop serving until it clears. Changing `budget` takes effect for the rest of the current day.

Google validates the change, so text that breaks its policies or a budget below the currency's floor comes back as a 400 with Google's reason and the campaign is left as it was. To change the budget on several campaigns at once, use [Update campaign budgets in bulk](/api-reference/bulk-update-google-ads-campaign-budgets).

<Note>The response carries `id` plus only the section you changed, not the whole campaign. Read the campaign back with [Get campaign](/api-reference/get-google-ads-campaign) when you need its full state.</Note>

<Note>This endpoint accepts a personal API key. Workspace API keys are not authorized for it and are rejected with a 403.</Note>

<Warning>A 409 means the change may or may not have been applied. The request to Google Ads timed out after it was sent. Read the campaign back with [Get campaign](/api-reference/get-google-ads-campaign) before retrying, or you can end up applying it twice.</Warning>

<Warning>The response includes fields beyond the ones documented here. Don't rely on undocumented response fields, as they can change at any time. Send only the fields documented here. Other request fields are not supported and their behavior can change.</Warning>



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json patch /api/apps/{app_id}/google-ads/campaigns/{campaign_id}
openapi: 3.1.0
info:
  title: Base44 App Management API
  version: 1.0.0
servers:
  - url: https://app.base44.com
security:
  - PersonalAccessTokenAuth: []
paths:
  /api/apps/{app_id}/google-ads/campaigns/{campaign_id}:
    patch:
      summary: Update Google Ads campaign
      description: >-
        <Info>This API is in beta. Endpoints, fields, and behavior may still
        change, so avoid depending on it in production.</Info>


        Changes one section of a campaign and pushes it to Google.


        Send the section in `field` and its new value in `value`. One section
        per request. To change a name and a budget, send two requests. Every
        list in `value` is the COMPLETE set the campaign should end up with, so
        an item you leave out is removed unless the field says otherwise, and a
        key you don't send leaves that setting as it is. An unknown key or a
        value of the wrong type returns a 422.


        Changing `ad_copy` sends the new text back through Google's policy
        review, so the campaign can return to a reviewing state and stop serving
        until it clears. Changing `budget` takes effect for the rest of the
        current day.


        Google validates the change, so text that breaks its policies or a
        budget below the currency's floor comes back as a 400 with Google's
        reason and the campaign is left as it was. To change the budget on
        several campaigns at once, use [Update campaign budgets in
        bulk](/api-reference/bulk-update-google-ads-campaign-budgets).


        <Note>The response carries `id` plus only the section you changed, not
        the whole campaign. Read the campaign back with [Get
        campaign](/api-reference/get-google-ads-campaign) when you need its full
        state.</Note>


        <Note>This endpoint accepts a personal API key. Workspace API keys are
        not authorized for it and are rejected with a 403.</Note>


        <Warning>A 409 means the change may or may not have been applied. The
        request to Google Ads timed out after it was sent. Read the campaign
        back with [Get campaign](/api-reference/get-google-ads-campaign) before
        retrying, or you can end up applying it twice.</Warning>


        <Warning>The response includes fields beyond the ones documented here.
        Don't rely on undocumented response fields, as they can change at any
        time. Send only the fields documented here. Other request fields are not
        supported and their behavior can change.</Warning>
      operationId: >-
        update_campaign_api_apps__app_id__google_ads_campaigns__campaign_id__patch
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            description: ID of the app whose Google Ads campaigns to manage.
            title: App Id
          description: ID of the app whose Google Ads campaigns to manage.
          example: 6820f3a4e7b91d003c45a1f2
        - name: campaign_id
          in: path
          required: true
          schema:
            type: string
            description: >-
              Base44's ID for the campaign, as returned in `id` by [List
              campaigns](/api-reference/list-google-ads-campaigns). This is not
              the Google Ads campaign ID, which is reported separately as
              `google_campaign_id`.
            title: Campaign Id
          description: >-
            Base44's ID for the campaign, as returned in `id` by [List
            campaigns](/api-reference/list-google-ads-campaigns). This is not
            the Google Ads campaign ID, which is reported separately as
            `google_campaign_id`.
          example: 68b1c0d4e7b91d003c45a1f2
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/UpdateCampaignName'
                - $ref: '#/components/schemas/UpdateCampaignBudget'
                - $ref: '#/components/schemas/UpdateCampaignAdCopy'
                - $ref: '#/components/schemas/UpdateCampaignDetails'
                - $ref: '#/components/schemas/UpdateCampaignTargeting'
                - $ref: '#/components/schemas/UpdateCampaignImages'
                - $ref: '#/components/schemas/UpdateCampaignAsset'
                - $ref: '#/components/schemas/UpdateCampaignAddVideo'
                - $ref: '#/components/schemas/UpdateCampaignVideos'
              discriminator:
                propertyName: field
                mapping:
                  name: '#/components/schemas/UpdateCampaignName'
                  budget: '#/components/schemas/UpdateCampaignBudget'
                  ad_copy: '#/components/schemas/UpdateCampaignAdCopy'
                  details: '#/components/schemas/UpdateCampaignDetails'
                  targeting: '#/components/schemas/UpdateCampaignTargeting'
                  images: '#/components/schemas/UpdateCampaignImages'
                  asset: '#/components/schemas/UpdateCampaignAsset'
                  add_video: '#/components/schemas/UpdateCampaignAddVideo'
                  videos: '#/components/schemas/UpdateCampaignVideos'
              title: Payload
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignPatchResult'
        '400':
          description: >-
            Google Ads rejected the request, for example ad text that breaks its
            policies or a budget below the currency's minimum. The response
            message carries Google's reason.
        '401':
          description: Missing or invalid credentials.
        '402':
          description: Google Ads reported a billing problem on the account.
        '403':
          description: >-
            You don't have access to this app, the app does not exist, or you
            used a workspace API key. A missing app and an app you cannot reach
            are deliberately the same answer. Marketing setup, campaign edits,
            generation and resuming also return `app_marketing_not_allowed` when
            the app's owning workspace has the FERPA designation. Historical
            reads, pausing, deletion and financial settlement remain available.
        '404':
          description: >-
            The app has no connected Google Ads account, or there is no campaign
            with this ID.
        '409':
          description: >-
            The request to Google Ads timed out after being sent, so the change
            may or may not have been applied. Read the campaign back before
            retrying. For `images`, it can also mean the campaign had images in
            Google that Base44 hadn't synced: Base44 has synced them now and
            nothing changed. Read the campaign back and rebuild each slot's
            list, keeping the newly synced images unless you mean to remove
            them. Replaying the same request removes them.
        '422':
          description: >-
            An unknown `field`, a key `value` doesn't take for that field, or a
            value of the wrong type. Nothing changed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Google Ads is rate limiting the account. Retry later.
        '503':
          description: >-
            Database temporarily unavailable (`database_unavailable`): the data
            cluster did not answer in time. Retry after the `Retry-After`
            seconds.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
              examples:
                database_unavailable:
                  summary: database_unavailable
                  value:
                    error:
                      code: database_unavailable
                      message: Database temporarily unavailable, please retry
                      details: {}
      security:
        - PersonalAccessTokenAuth:
            - full_access
components:
  schemas:
    UpdateCampaignName:
      properties:
        field:
          type: string
          const: name
          title: Field
          description: Which part of the campaign to change. One section per request.
        value:
          type: string
          title: Value
          description: The new name.
          example: Spring sale in Berlin
      additionalProperties: false
      type: object
      required:
        - field
        - value
      title: UpdateCampaignName
    UpdateCampaignBudget:
      properties:
        field:
          type: string
          const: budget
          title: Field
          description: Which part of the campaign to change. One section per request.
        value:
          type: number
          title: Value
          description: >-
            The daily budget in micros of the account currency, so `15000000` is
            15.00.
          example: 15000000
      additionalProperties: false
      type: object
      required:
        - field
        - value
      title: UpdateCampaignBudget
    UpdateCampaignAdCopy:
      properties:
        field:
          type: string
          const: ad_copy
          title: Field
          description: Which part of the campaign to change. One section per request.
        value:
          $ref: '#/components/schemas/CampaignAdCopyEdit'
          description: >-
            The ad copy to change. Changing it sends the text back through
            Google's policy review.
      additionalProperties: false
      type: object
      required:
        - field
        - value
      title: UpdateCampaignAdCopy
    UpdateCampaignDetails:
      properties:
        field:
          type: string
          const: details
          title: Field
          description: Which part of the campaign to change. One section per request.
        value:
          $ref: '#/components/schemas/CampaignDetailsEdit'
          description: The landing page and phone number to change.
      additionalProperties: false
      type: object
      required:
        - field
        - value
      title: UpdateCampaignDetails
    UpdateCampaignTargeting:
      properties:
        field:
          type: string
          const: targeting
          title: Field
          description: Which part of the campaign to change. One section per request.
        value:
          $ref: '#/components/schemas/CampaignTargetingEdit'
          description: >-
            The targeting to change. [Get campaign
            targeting](/api-reference/get-google-ads-campaign-targeting) returns
            the current values to start from.
      additionalProperties: false
      type: object
      required:
        - field
        - value
      title: UpdateCampaignTargeting
    UpdateCampaignImages:
      properties:
        field:
          type: string
          const: images
          title: Field
          description: Which part of the campaign to change. One section per request.
        value:
          additionalProperties:
            anyOf:
              - items:
                  type: string
                type: array
              - type: string
          propertyNames:
            enum:
              - MARKETING_IMAGE
              - SQUARE_MARKETING_IMAGE
              - PORTRAIT_MARKETING_IMAGE
              - TALL_PORTRAIT_MARKETING_IMAGE
              - LOGO
          type: object
          title: Value
          description: >-
            Performance Max only. Each image slot holds the list of `https`
            image URLs it should keep, and a slot you leave out is untouched. To
            remove one image, send its slot with only the others.
            `MARKETING_IMAGE`, `SQUARE_MARKETING_IMAGE` and `LOGO` must keep at
            least one image, and `LOGO` takes exactly one. New URLs follow the
            same hosting rules as `images[].url` on Create campaign, and a URL
            Base44 can't fetch fails the request. Changing a slot sends its
            images back through Google's review.
          example:
            MARKETING_IMAGE:
              - https://storage.base44.com/gads-assets/b7f3a1c8-landscape.png
      additionalProperties: false
      type: object
      required:
        - field
        - value
      title: UpdateCampaignImages
    UpdateCampaignAsset:
      properties:
        field:
          type: string
          const: asset
          title: Field
          description: Which part of the campaign to change. One section per request.
        value:
          $ref: '#/components/schemas/CampaignAssetEdit'
          description: >-
            Performance Max only. Replaces one asset with one that matches its
            type: `text` for a text asset, `image_url` for an image or logo, or
            `youtube_video` for a video.
      additionalProperties: false
      type: object
      required:
        - field
        - value
      title: UpdateCampaignAsset
    UpdateCampaignAddVideo:
      properties:
        field:
          type: string
          const: add_video
          title: Field
          description: Which part of the campaign to change. One section per request.
        value:
          $ref: '#/components/schemas/CampaignAddVideoEdit'
          description: Links a new video, where `asset` replaces an existing one.
      additionalProperties: false
      type: object
      required:
        - field
        - value
      title: UpdateCampaignAddVideo
    UpdateCampaignVideos:
      properties:
        field:
          type: string
          const: videos
          title: Field
          description: Which part of the campaign to change. One section per request.
        value:
          $ref: '#/components/schemas/CampaignVideosEdit'
          description: The campaign's complete set of videos.
      additionalProperties: false
      type: object
      required:
        - field
        - value
      title: UpdateCampaignVideos
    CampaignPatchResult:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: >-
            Base44's ID for the campaign. Absent when you changed `images`,
            which reports `updated_field_types` instead.
          example: 68b1c0d4e7b91d003c45a1f2
        campaign_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Campaign Name
          description: Present when you changed `name`.
          example: Spring sale in Berlin
        daily_budget_micros:
          anyOf:
            - type: integer
            - type: 'null'
          title: Daily Budget Micros
          description: Present when you changed `budget`.
          example: 15000000
      type: object
      title: CampaignPatchResult
      description: >-
        What an update returns, the campaign ID plus only the section that
        changed.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    StandardErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/StandardError'
          description: What went wrong.
      type: object
      required:
        - error
      title: StandardErrorEnvelope
      description: The error body returned in the standard envelope.
    CampaignAdCopyEdit:
      properties:
        headlines:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Headlines
          description: The campaign's headlines.
          example:
            - Spring sale
            - Up to 40% off
        descriptions:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Descriptions
          description: The campaign's description lines.
          example:
            - Solid oak, built to order.
        long_headlines:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Long Headlines
          description: The campaign's long headlines. Performance Max only.
          example:
            - Handmade oak tables, delivered free across Germany
        business_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Business Name
          description: Business name shown in the ads.
          example: Nordwind Furniture
        contains_eu_political_advertising:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Contains Eu Political Advertising
          description: >-
            Declares whether the campaign carries EU political advertising. When
            a change reaches the EU or changes content Base44 declared on your
            behalf, the request returns a 400 asking for it, so send the same
            change again with it set.
          example: false
      additionalProperties: false
      type: object
      title: CampaignAdCopyEdit
    CampaignDetailsEdit:
      properties:
        landing_page:
          anyOf:
            - type: string
            - type: 'null'
          title: Landing Page
          description: The URL the ads send clicks to. It can't be empty.
          example: https://example.com/spring
        phone_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone Number
          description: >-
            The number for the campaign's call asset, with its country code. An
            empty string removes the number.
          example: '+14155550123'
        landing_domain:
          anyOf:
            - type: string
            - type: 'null'
          title: Landing Domain
          description: >-
            The domain `landing_page` was built from. Stored with `landing_page`
            for display, ignored without it, and it doesn't change what Google
            serves.
          example: example.com
        landing_page_path:
          anyOf:
            - type: string
            - type: 'null'
          title: Landing Page Path
          description: >-
            The path `landing_page` was built from. Stored with `landing_page`
            for display, ignored without it, and it doesn't change what Google
            serves.
          example: /spring
        contains_eu_political_advertising:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Contains Eu Political Advertising
          description: >-
            Declares whether the campaign carries EU political advertising. When
            a change reaches the EU or changes content Base44 declared on your
            behalf, the request returns a 400 asking for it, so send the same
            change again with it set.
          example: false
      additionalProperties: false
      type: object
      title: CampaignDetailsEdit
    CampaignTargetingEdit:
      properties:
        geo_targets:
          anyOf:
            - items:
                anyOf:
                  - type: string
                  - $ref: '#/components/schemas/CampaignLocationInput'
              type: array
            - type: 'null'
          title: Geo Targets
          description: >-
            The locations to target, as geo target constant IDs or as location
            objects. An empty list removes every targeted location.
          example:
            - geoTargetConstants/1014221
        targeted_locations:
          anyOf:
            - items:
                $ref: '#/components/schemas/CampaignLocationInput'
              type: array
            - type: 'null'
          title: Targeted Locations
          description: >-
            The same locations as `geo_targets`, with their names, so Base44 can
            show them. Read only together with `geo_targets`.
          example:
            - name: San Francisco
              resourceName: geoTargetConstants/1014221
        excluded_locations:
          anyOf:
            - items:
                $ref: '#/components/schemas/CampaignLocationInput'
              type: array
            - type: 'null'
          title: Excluded Locations
          description: >-
            The locations to exclude. A location can't be both targeted and
            excluded.
          example:
            - name: Oakland
              resourceName: geoTargetConstants/1014044
        keyword_themes:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Keyword Themes
          description: The themes the campaign matches on.
          example:
            - handmade oak furniture
        excluded_terms:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Excluded Terms
          description: The search terms the campaign must not match.
          example:
            - free
            - repair
        excluded_terms_add:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Excluded Terms Add
          description: >-
            Terms to add to the live excluded terms. Unlike `excluded_terms`,
            this removes nothing, and a term that is already excluded is
            skipped.
          example:
            - cheap
        language_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Language Code
          description: >-
            Two-letter code of the language the campaign advertises in, from
            [List advertising
            languages](/api-reference/list-google-ads-advertising-languages).
          example: de
        sitelinks:
          anyOf:
            - items:
                $ref: '#/components/schemas/CampaignSitelinkInput'
              type: array
            - type: 'null'
          title: Sitelinks
          description: >-
            The campaign's sitelinks, up to 20. Only sitelinks Base44 has on
            record are removed when left out. A new sitelink's `url` must be on
            the campaign's landing-page domain.
          example:
            - text: Visit our showroom
              url: https://example.com/showroom
        contains_eu_political_advertising:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Contains Eu Political Advertising
          description: >-
            Declares whether the campaign carries EU political advertising. When
            a change reaches the EU or changes content Base44 declared on your
            behalf, the request returns a 400 asking for it, so send the same
            change again with it set.
          example: false
      additionalProperties: false
      type: object
      title: CampaignTargetingEdit
    CampaignAssetEdit:
      properties:
        resource_name:
          type: string
          title: Resource Name
          description: >-
            The asset's `resource_name` from [List asset
            performance](/api-reference/list-google-ads-asset-performance).
          example: customers/1234567890/assetGroupAssets/2145881234~9988776655~HEADLINE
        text:
          anyOf:
            - type: string
            - type: 'null'
          title: Text
          description: >-
            Replacement for a text asset. Text over the limit for its type is
            cut at a word boundary.
          example: Spring sale on now
        image_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Image Url
          description: Replacement for an image or logo asset.
          example: https://storage.base44.com/gads-assets/b7f3a1c8-landscape.png
        youtube_video:
          anyOf:
            - type: string
            - type: 'null'
          title: Youtube Video
          description: Replacement for a video asset, as a YouTube link or video ID.
          example: dQw4w9WgXcQ
      additionalProperties: false
      type: object
      required:
        - resource_name
      title: CampaignAssetEdit
    CampaignAddVideoEdit:
      properties:
        youtube_video:
          type: string
          title: Youtube Video
          description: The video to link, as a YouTube link or video ID.
          example: dQw4w9WgXcQ
      additionalProperties: false
      type: object
      required:
        - youtube_video
      title: CampaignAddVideoEdit
    CampaignVideosEdit:
      properties:
        youtube_videos:
          items:
            type: string
          type: array
          title: Youtube Videos
          description: >-
            The campaign's videos, as YouTube links or video IDs. A video you
            leave out is removed.
          example:
            - dQw4w9WgXcQ
      additionalProperties: false
      type: object
      required:
        - youtube_videos
      title: CampaignVideosEdit
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    StandardError:
      properties:
        code:
          type: string
          title: Code
          description: >-
            Stable machine-readable cause of the failure. Match on this, not on
            `message`.
          example: not_found
        message:
          type: string
          title: Message
          description: Human-readable explanation. It isn't a stable contract.
          example: App not found
        details:
          additionalProperties: true
          type: object
          title: Details
          description: >-
            Structured context for the failure, or an empty object when there's
            none.
          example: {}
      type: object
      required:
        - code
        - message
      title: StandardError
    CampaignLocationInput:
      properties:
        resourceName:
          type: string
          title: Resourcename
          description: >-
            The location's geo target constant, such as
            `geoTargetConstants/1014221`. `resource_name` is also accepted.
          example: geoTargetConstants/1014221
        name:
          type: string
          title: Name
          description: The location's display name.
          default: ''
          example: San Francisco
        secondary:
          anyOf:
            - type: string
            - type: 'null'
          title: Secondary
          description: Extra context shown under the name, such as the region.
          example: California, United States
      type: object
      required:
        - resourceName
      title: CampaignLocationInput
    CampaignSitelinkInput:
      properties:
        text:
          type: string
          title: Text
          description: Link text. Longer text is cut to 25 characters.
          default: ''
          example: Visit our showroom
        url:
          type: string
          title: Url
          description: >-
            Where the link goes, as an `http` or `https` address with a full
            domain.
          default: ''
          example: https://example.com/showroom
      additionalProperties: false
      type: object
      title: CampaignSitelinkInput
  securitySchemes:
    PersonalAccessTokenAuth:
      type: http
      scheme: bearer
      description: >-
        Personal access token, sent as `Authorization: Bearer <token>`. Each
        operation lists the permission it needs: `read_only` or `full_access`. A
        full-access token can call every operation. A read-only token can call
        only the operations that list `read_only`; anything else returns 403
        `read_only_credential_route_not_allowed`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.