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

# Accept a generated Google Ads asset

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

Puts one generated asset onto a live Performance Max campaign.

This is the step that reaches Google Ads. Up to here creative is only a preview, and this creates the asset on the app's own Google Ads account and links it to **every** asset group the campaign has, with the slot the asset was generated for. After this Google Ads is the source of truth for it.

You can accept an asset long after the generation that produced it. Base44 looks the asset up in the app's durable library first and only falls back to the live session, so an asset you read from `library` works even though its preview has expired. `session_id` is still required, because it is what the fallback needs.

Performance Max only. Other campaign types have no asset groups, so they are rejected with a 422.

A 409 covers four different situations and the message is what tells them apart, so read it rather than retrying blindly. Waiting is right for an image that is still processing, syncing is right for a campaign that has not reached Google Ads, and regenerating is right for an asset that is no longer usable.

<Warning>Accepting the same picture twice creates a second asset on the campaign. Google has no content check for images, so a retried or repeated accept leaves you with duplicate creative on the campaign. Copy is safe to repeat, because Google matches identical text and reuses the existing asset. Treat an image accept as a one-shot and read [List Google Ads generated assets](/api-reference/list-google-ads-generated-assets) to check `status` before retrying.</Warning>

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

<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 post /api/apps/{app_id}/google-ads/assets/{session_asset_id}/accept
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/assets/{session_asset_id}/accept:
    post:
      summary: Accept a generated Google Ads asset
      description: >-
        <Info>This API is in beta. Endpoints, fields, and behavior may still
        change, so avoid depending on it in production.</Info>


        Puts one generated asset onto a live Performance Max campaign.


        This is the step that reaches Google Ads. Up to here creative is only a
        preview, and this creates the asset on the app's own Google Ads account
        and links it to **every** asset group the campaign has, with the slot
        the asset was generated for. After this Google Ads is the source of
        truth for it.


        You can accept an asset long after the generation that produced it.
        Base44 looks the asset up in the app's durable library first and only
        falls back to the live session, so an asset you read from `library`
        works even though its preview has expired. `session_id` is still
        required, because it is what the fallback needs.


        Performance Max only. Other campaign types have no asset groups, so they
        are rejected with a 422.


        A 409 covers four different situations and the message is what tells
        them apart, so read it rather than retrying blindly. Waiting is right
        for an image that is still processing, syncing is right for a campaign
        that has not reached Google Ads, and regenerating is right for an asset
        that is no longer usable.


        <Warning>Accepting the same picture twice creates a second asset on the
        campaign. Google has no content check for images, so a retried or
        repeated accept leaves you with duplicate creative on the campaign. Copy
        is safe to repeat, because Google matches identical text and reuses the
        existing asset. Treat an image accept as a one-shot and read [List
        Google Ads generated
        assets](/api-reference/list-google-ads-generated-assets) to check
        `status` before retrying.</Warning>


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


        <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: >-
        accept_generated_asset_api_apps__app_id__google_ads_assets__session_asset_id__accept_post
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            description: >-
              ID of the app whose Google Ads creative you want to generate or
              read.
            title: App Id
          description: >-
            ID of the app whose Google Ads creative you want to generate or
            read.
          example: 6820f3a4e7b91d003c45a1f2
        - name: session_asset_id
          in: path
          required: true
          schema:
            type: string
            description: >-
              ID of the generated asset to attach, as returned in
              `session_asset_id` by [Generate Google Ads
              assets](/api-reference/generate-google-ads-assets) or [List Google
              Ads generated
              assets](/api-reference/list-google-ads-generated-assets).
            title: Session Asset Id
          description: >-
            ID of the generated asset to attach, as returned in
            `session_asset_id` by [Generate Google Ads
            assets](/api-reference/generate-google-ads-assets) or [List Google
            Ads generated
            assets](/api-reference/list-google-ads-generated-assets).
          example: b7f3a1c8-52d4-4a0e-9b31-2c6f0d8e4a19
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AcceptGeneratedAssetRequest'
            example:
              session_id: 9c1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f
              campaign_id: 68b1c0d4e7b91d003c45a1f2
      responses:
        '200':
          description: The asset was attached to the campaign.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AcceptAssetResult'
        '400':
          description: >-
            The asset could not be used as it stands: Base44 could not reload
            the generated image, the generated copy is empty, or Google Ads
            rejected the asset, for example copy that breaks its policies.
            Generate a replacement rather than retrying this one. A Google
            rejection carries its reason in the message.
        '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.
        '404':
          description: >-
            The app has no connected Google Ads account, or there is no campaign
            with this ID on it. It is also returned when there is no generated
            asset with this `session_asset_id`.
        '409':
          description: >-
            The accept cannot proceed yet, and the message says which of four
            reasons applies: the generated image is still processing, so wait
            and retry; the campaign has not reached Google Ads yet or has no
            asset groups, so sync it and retry; the asset is no longer usable,
            so generate a replacement; or the request to Google Ads timed out
            after being sent, in which case the asset may or may not have been
            attached and a retry can duplicate it. Read the message before
            choosing what to do.
        '422':
          description: >-
            The campaign is not a Performance Max campaign. Only Performance Max
            campaigns have the asset groups these endpoints work on.
        '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
        - WorkspaceApiKeyAuth:
            - full_access
        - WorkspaceApiKeyBearerAuth:
            - full_access
components:
  schemas:
    AcceptGeneratedAssetRequest:
      properties:
        session_id:
          type: string
          title: Session Id
          description: >-
            The generation the asset came from, as returned in `session_id` by
            [Generate Google Ads
            assets](/api-reference/generate-google-ads-assets).
          example: 9c1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f
        campaign_id:
          type: string
          title: Campaign Id
          description: >-
            The Performance Max campaign to attach the asset to, as returned in
            `id` by [List campaigns](/api-reference/list-google-ads-campaigns).
          example: 68b1c0d4e7b91d003c45a1f2
      type: object
      required:
        - session_id
        - campaign_id
      title: AcceptGeneratedAssetRequest
      description: |-
        Request shape for `POST /assets/{session_asset_id}/accept`.

        `session_id` locates the transient preview in Redis; `campaign_id` is
        the live PMax campaign whose asset groups the generated asset is
        attached to. Both required — accept is the durable hand-off, so it
        always targets a concrete campaign.
    AcceptAssetResult:
      properties:
        accepted:
          type: boolean
          title: Accepted
          description: >-
            Always `true` on a success, so it carries no information beyond the
            status code. Read `asset_group_count` to see how far the attach
            reached.
          example: true
        session_asset_id:
          type: string
          title: Session Asset Id
          description: The asset that was attached, echoed from the path.
          example: b7f3a1c8-52d4-4a0e-9b31-2c6f0d8e4a19
        asset_field_type:
          type: string
          title: Asset Field Type
          description: >-
            Which slot on the ad this asset fills. Text assets are `HEADLINE`,
            `LONG_HEADLINE` or `DESCRIPTION`. Image assets are
            `MARKETING_IMAGE`, `SQUARE_MARKETING_IMAGE`,
            `PORTRAIT_MARKETING_IMAGE` or `TALL_PORTRAIT_MARKETING_IMAGE`.
          example: SQUARE_MARKETING_IMAGE
        kind:
          type: string
          title: Kind
          description: Whether the asset is copy (`text`) or a picture (`image`).
          example: image
        source:
          type: string
          title: Source
          description: >-
            Which engine wrote it. The value is `google` for Google's own asset
            generation and `inhouse` for the Base44 model that covers languages
            Google does not generate for, and that stands in when Google's call
            fails.
          example: google
        asset_group_count:
          type: integer
          title: Asset Group Count
          description: >-
            How many of the campaign's asset groups the asset was linked to. The
            asset goes on every asset group the campaign has, so this is that
            count.
          example: 2
        resource_name:
          type: string
          title: Resource Name
          description: >-
            Google Ads resource name of the asset that now holds this creative.
            Empty when Google's response carried no resource name, which does
            not mean the attach failed.
          example: customers/1234567890/assets/98765432
      type: object
      required:
        - accepted
        - session_asset_id
        - asset_field_type
        - kind
        - source
        - asset_group_count
        - resource_name
      title: AcceptAssetResult
      description: The outcome of attaching a generated asset to a campaign.
    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.
    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.