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

While Google is still learning a campaign (its first 7 days of learning, or while Google reports a learning bidding status), a raise would restart that learning, so the call is rejected with a 409. Changing the budget yourself is still allowed.

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


        While Google is still learning a campaign (its first 7 days of learning,
        or while Google reports a learning bidding status), a raise would
        restart that learning, so the call is rejected with a 409. Changing the
        budget yourself is still allowed.


        <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. 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 recommendation does not apply to this campaign, its amount
            changed since you read it, it covers campaigns not managed here,
            Google is still learning a campaign it covers (`error.code`
            `campaign_learning`), 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'
        '429':
          description: >-
            `rate_limited`: The base limit is 300 requests in a minute from your
            account, shared across every Google Ads write that doesn't name its
            own limit. Some workspaces have a higher limit. `X-RateLimit-Limit`
            reports the enforced limit. Retry after `Retry-After` seconds. The
            `X-RateLimit-*` headers report the budget left.
          content:
            application/json:
              examples:
                rate_limited:
                  summary: rate_limited
                  value:
                    error:
                      code: rate_limited
                      message: Rate limit exceeded.
                      details: {}
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
        '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:
    _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
    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.
    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
  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.