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

# Ask the Google Ads assistant

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

Answers a plain-language question about the app's Google Ads campaigns.

The answer is prose written for a person, three to five sentences with no markdown, so read it or show it to someone rather than parsing it. The assistant is a language model with no access to the account's numbers, so it gives general advice shaped by your question rather than findings from your data. Read the reporting endpoints such as [Get Google Ads performance dashboard](/api-reference/get-google-ads-performance-dashboard) for the actual figures.

Pass earlier turns in `history` to ask a follow-up. Only the last ten turns reach the model, and anything before that is dropped with nothing in the response saying so, so keep a long conversation summarized on your side.

<Warning>An empty `reply` means the model returned nothing, and it comes back under a 200 exactly like a real answer. There is no field that distinguishes the two, so check for an empty string and retry rather than treating it as the assistant having nothing to say.</Warning>

This endpoint is limited to 20 requests a minute per app, shared with the other Google Ads endpoints that run a language model.

<Note>This endpoint accepts a personal API key or a workspace API key. A workspace API key acts as the workspace owner.</Note>



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json post /api/apps/{app_id}/google-ads/troubleshoot/ask
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/troubleshoot/ask:
    post:
      summary: Ask the Google Ads assistant
      description: >-
        <Info>This API is in beta. Endpoints, fields, and behavior may still
        change, so avoid depending on it in production.</Info>


        Answers a plain-language question about the app's Google Ads campaigns.


        The answer is prose written for a person, three to five sentences with
        no markdown, so read it or show it to someone rather than parsing it.
        The assistant is a language model with no access to the account's
        numbers, so it gives general advice shaped by your question rather than
        findings from your data. Read the reporting endpoints such as [Get
        Google Ads performance
        dashboard](/api-reference/get-google-ads-performance-dashboard) for the
        actual figures.


        Pass earlier turns in `history` to ask a follow-up. Only the last ten
        turns reach the model, and anything before that is dropped with nothing
        in the response saying so, so keep a long conversation summarized on
        your side.


        <Warning>An empty `reply` means the model returned nothing, and it comes
        back under a 200 exactly like a real answer. There is no field that
        distinguishes the two, so check for an empty string and retry rather
        than treating it as the assistant having nothing to say.</Warning>


        This endpoint is limited to 20 requests a minute per app, shared with
        the other Google Ads endpoints that run a language model.


        <Note>This endpoint accepts a personal API key or a workspace API key. A
        workspace API key acts as the workspace owner.</Note>
      operationId: troubleshoot_ask_api_apps__app_id__google_ads_troubleshoot_ask_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
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TroubleshootAskRequest'
            example:
              question: >-
                Why is my Performance Max campaign spending its budget without
                converting?
              campaign_id: 68b1c0d4e7b91d003c45a1f2
      responses:
        '200':
          description: The assistant's answer.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TroubleshootReply'
        '401':
          description: Missing or invalid credentials.
        '403':
          description: >-
            You don't have access to this app or the app does not exist. 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.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: >-
            The app has used up its 20 language-model requests a minute. 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
        - WorkspaceApiKeyAuth:
            - full_access
        - WorkspaceApiKeyBearerAuth:
            - full_access
components:
  schemas:
    TroubleshootAskRequest:
      properties:
        question:
          type: string
          title: Question
          description: >-
            What you want to ask about the app's Google Ads campaigns, in plain
            language.
          example: >-
            Why is my Performance Max campaign spending its budget without
            converting?
        campaign_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Campaign Id
          description: >-
            A campaign ID to mention in the question. It is passed to the model
            as text for context only, so the assistant does not read the
            campaign's data from it.
          example: 68b1c0d4e7b91d003c45a1f2
        history:
          items:
            $ref: '#/components/schemas/TroubleshootChatTurn'
          type: array
          title: History
          description: >-
            Earlier turns of the conversation, oldest first. Only the last ten
            are used.
          example:
            - content: Which campaign is spending the most?
              role: user
      type: object
      required:
        - question
      title: TroubleshootAskRequest
    TroubleshootReply:
      properties:
        reply:
          type: string
          title: Reply
          description: >-
            The answer, as three to five sentences of plain prose with no
            markdown and no code blocks. It is written for a person to read, so
            do not parse it. An empty string means the model returned nothing,
            which you cannot tell apart from a genuinely empty answer, so treat
            it as a failed call and retry.
          example: >-
            Your campaign is spending its full daily budget but converting below
            the account average, which usually points at the landing page rather
            than the targeting. Check that the page loads quickly on mobile and
            that the offer matches the ad copy. Narrowing the geo targets to
            your best-performing region would also concentrate the budget.
      type: object
      required:
        - reply
      title: TroubleshootReply
      description: The assistant's answer.
    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.
    TroubleshootChatTurn:
      properties:
        role:
          type: string
          title: Role
          description: >-
            Who said it. Use `user` for your own turns and `assistant` for the
            replies. Any value other than `user` is treated as the assistant.
          example: user
        content:
          type: string
          title: Content
          description: What was said in that turn.
          example: Which campaign is spending the most?
      type: object
      required:
        - role
        - content
      title: TroubleshootChatTurn
    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`.
    WorkspaceApiKeyAuth:
      type: apiKey
      in: header
      name: api_key
      description: >-
        Workspace API key, sent as `api_key: <key>`. Each operation that accepts
        one lists what the key needs: a permission, `read_only` or
        `full_access`, like a personal access token, or a scope. A key without
        the scope gets 403 `workspace_api_key_scope_required`.
    WorkspaceApiKeyBearerAuth:
      type: http
      scheme: bearer
      description: >-
        Workspace API key, sent as `Authorization: Bearer <key>`. Accepted
        wherever `api_key` is, with the same permission.

````

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