> ## 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.

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:
  - ApiKeyAuth: []
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.


        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:
              title: UpdateCampaignRequest
              type: object
              required:
                - field
                - value
              properties:
                field:
                  type: string
                  enum:
                    - name
                    - budget
                    - details
                    - ad_copy
                    - targeting
                    - images
                    - asset
                  description: >-
                    Which part of the campaign to change. One section per
                    request.
                value:
                  description: >-
                    The new value, shaped by `field`. `name` takes a string.
                    `budget` takes the daily budget in micros, as a number.
                    `ad_copy` takes an object with any of `headlines`,
                    `descriptions`, `long_headlines`, and `business_name`.
                    `targeting`, `details`, `images`, and `asset` take an object
                    whose shape follows that section of the campaign.
            examples:
              rename:
                summary: Rename the campaign
                value:
                  field: name
                  value: Spring sale in Berlin
              budget:
                summary: Raise the daily budget to 15.00
                value:
                  field: budget
                  value: 15000000
              ad_copy:
                summary: Replace the headlines
                value:
                  field: ad_copy
                  value:
                    headlines:
                      - Spring sale
                      - Up to 40% off
      responses:
        '200':
          description: The campaign ID plus only the section that changed.
          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.
        '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.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Google Ads is rate limiting the account. Retry later.
components:
  schemas:
    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 ID, plus only the section that changed.


        Every field except ``id`` is optional because the handler returns one

        section per request, so a rename comes back as ``id`` +
        ``campaign_name``

        and a budget change as ``id`` + ``daily_budget_micros``.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: api_key
      description: Personal API key.

````