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

# Apply a Google Ads budget recommendation

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

Applies a Google Ads budget recommendation to a campaign, raising what it can spend per day.

Take `recommendation_resource_name`, `recommended_daily_budget_micros` and `recommendation_type` from a suggestion returned by [List campaign optimization suggestions](/api-reference/list-google-ads-campaign-optimization-suggestions) whose `recommendation_type` is `CAMPAIGN_BUDGET`.

You do not choose the amount. Base44 re-reads the recommendation from Google and applies Google's current figure. `recommended_daily_budget_micros` is the amount you are confirming, not a value to set: if Google's figure has changed since you read the suggestion, the call is rejected with a 409 so nobody raises a budget to a number they never saw. Read the suggestions again and resend.

This changes real spend. Applying the same recommendation twice is safe: the second call changes nothing and returns `already_applied` set to `true`.

Some recommendations cover a budget shared by several campaigns. Applying one raises the budget for all of them, so Base44 rejects it with a 409 unless every campaign it touches is one you manage here.

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

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



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json post /api/apps/{app_id}/google-ads/campaigns/{campaign_id}/recommendations/apply-budget
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}/recommendations/apply-budget:
    post:
      summary: Apply a Google Ads budget recommendation
      description: >-
        <Info>This API is in beta. Endpoints, fields, and behavior may still
        change, so avoid depending on it in production.</Info>


        Applies a Google Ads budget recommendation to a campaign, raising what
        it can spend per day.


        Take `recommendation_resource_name`, `recommended_daily_budget_micros`
        and `recommendation_type` from a suggestion returned by [List campaign
        optimization
        suggestions](/api-reference/list-google-ads-campaign-optimization-suggestions)
        whose `recommendation_type` is `CAMPAIGN_BUDGET`.


        You do not choose the amount. Base44 re-reads the recommendation from
        Google and applies Google's current figure.
        `recommended_daily_budget_micros` is the amount you are confirming, not
        a value to set: if Google's figure has changed since you read the
        suggestion, the call is rejected with a 409 so nobody raises a budget to
        a number they never saw. Read the suggestions again and resend.


        This changes real spend. Applying the same recommendation twice is safe:
        the second call changes nothing and returns `already_applied` set to
        `true`.


        Some recommendations cover a budget shared by several campaigns.
        Applying one raises the budget for all of them, so Base44 rejects it
        with a 409 unless every campaign it touches is one you manage here.


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


        <Note>This endpoint accepts a personal API key. Workspace API keys are
        not authorized for it and are rejected with a 403.</Note>
      operationId: >-
        apply_budget_recommendation_api_apps__app_id__google_ads_campaigns__campaign_id__recommendations_apply_budget_post
      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:
              $ref: '#/components/schemas/_ApplyBudgetRecommendationRequest'
      responses:
        '200':
          description: The campaign's budget after the change.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleAdsAppliedBudgetRecommendation'
        '401':
          description: Missing or invalid credentials.
        '402':
          description: >-
            The account has no usable payment method, so its budget cannot be
            raised.
        '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 recommendation does not apply to this campaign, its amount
            changed since you read it, it covers campaigns not managed here, or
            the change to Google Ads timed out and may already have been
            applied.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    _ApplyBudgetRecommendationRequest:
      properties:
        recommendation_resource_name:
          type: string
          minLength: 1
          title: Recommendation Resource Name
          description: >-
            Google's identifier for the recommendation, taken from
            `action_payload` on the suggestion you are applying.
          example: customers/1234567890/recommendations/AbC123
        recommended_daily_budget_micros:
          type: integer
          exclusiveMinimum: 0
          title: Recommended Daily Budget Micros
          description: >-
            The daily budget the suggestion showed, in micros. This confirms
            what you saw rather than choosing an amount: if Google's current
            figure differs, the call is rejected with a 409 and nothing changes.
          example: 45000000
        recommendation_type:
          type: string
          title: Recommendation Type
          description: The suggestion's `recommendation_type`, recorded for auditing.
          default: ''
          example: CAMPAIGN_BUDGET
      type: object
      required:
        - recommendation_resource_name
        - recommended_daily_budget_micros
      title: ApplyBudgetRecommendation
      description: >-
        Request shape for the user-approved budget-recommendation apply.


        `recommendation_resource_name` is Google's
        `customers/.../recommendations/...`

        id (used for idempotency + server-side re-resolution). The route
        re-fetches

        the recommendation from Google and applies Google's own recommended
        amount

        for the recommendation's target campaign, so the request body amount is

        advisory only (what the user saw) and a tampered value can't change what
        is

        applied. It is still bounds-checked by update_campaign_budget.
    GoogleAdsAppliedBudgetRecommendation:
      properties:
        id:
          type: string
          title: Id
          description: Base44's ID for the campaign whose budget changed.
          example: 68b1c0d4e7b91d003c45a1f2
        daily_budget_micros:
          type: integer
          title: Daily Budget Micros
          description: The campaign's daily budget after the change, in micros.
          example: 45000000
        already_applied:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Already Applied
          description: >-
            `true` when this recommendation had already been applied and nothing
            changed on this call, so a retry is safe. Absent when the call
            applied the change.
          example: true
      type: object
      required:
        - id
        - daily_budget_micros
      title: GoogleAdsAppliedBudgetRecommendation
      description: The campaign's budget after applying Google's recommendation.
    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.

````