add_pmax_asset_group_image

Google Ads Write

๐Ÿšจ **IF THIS TOOL RETURNS A QUOTA ERROR:** - The error message will include a clickable upgrade link - Show the FULL error message to the user (it contains the upgrade link) - DO NOT attempt to work ar

Endpoint

POST https://api.adspirer.ai/api/v1/tools/add_pmax_asset_group_image/execute

Headers

Description

๐Ÿšจ **IF THIS TOOL RETURNS A QUOTA ERROR:** - The error message will include a clickable upgrade link - Show the FULL error message to the user (it contains the upgrade link) - DO NOT attempt to work around the error or use alternative data - DO NOT create campaigns or perform actions without valid tool data - STOP and direct the user to upgrade via the provided link Upload a new image and link it to a PMax asset group. Accepts http(s) URLs OR base64 data URIs (`data:image/...;base64,...`). Per-group caps are enforced BEFORE upload: 20 marketing images per group (across MARKETING_IMAGE / SQUARE_MARKETING_IMAGE / PORTRAIT_MARKETING_IMAGE / TALL_PORTRAIT_MARKETING_IMAGE), 5 of each logo type (LOGO / LANDSCAPE_LOGO / BUSINESS_LOGO). If the campaign has exactly one asset group, `asset_group_id` is optional โ€” otherwise it is required. Image bytes are uploaded only after cap validation passes, so a doomed call doesn't burn bandwidth. **Parameters:** - campaign_id: The PMax campaign ID - image_url: http(s) URL or `data:image/...;base64,...` URI - field_type: which PMax image slot to fill (see list of accepted values) - asset_group_id: required for multi-group campaigns - asset_name: optional display name in the Asset Library **Execution time:** 3-8 seconds (image fetch + Google Ads mutate)

Request body

All tool arguments are wrapped in an arguments object.

FieldTypeDescription
campaign_idstring requiredThe PMax campaign ID (numeric). Example: '21854471508'
image_urlstring requiredImage to upload. Either a public http(s) URL OR a base64 data URI (`data:image/png;base64,...`). Plain base64 without the data-URI prefix is NOT accepted โ€” wrap it as `data:image/...;base64,...`.
field_typestring requiredPMax image slot. One of: MARKETING_IMAGE, SQUARE_MARKETING_IMAGE, PORTRAIT_MARKETING_IMAGE, TALL_PORTRAIT_MARKETING_IMAGE, LOGO, LANDSCAPE_LOGO, BUSINESS_LOGO. Per-group caps: 20 marketing images total (across the 4 marketing types), 5 of each logo type.
asset_group_idstring optionalRequired when the campaign has more than one asset group. Auto-resolved when there is exactly one.
asset_namestring optionalOptional display name for the new asset in the Google Ads Asset Library.
customer_idstring optionalGoogle Ads customer ID. Required for multi-account users. Get from get_connections_status.

Example request

{
  "arguments": {
    "campaign_id": "<campaign_id>",
    "image_url": "https://example.com",
    "field_type": "string",
    "asset_group_id": "string",
    "asset_name": "string",
    "customer_id": "string"
  }
}

Example responses

200 โ€” Success

{
  "success": true,
  "data": {
    "text": "(tool-specific textual output for add_pmax_asset_group_image)",
    "quota": {
      "used": 42,
      "limit": 150,
      "tier": "plus",
      "period_end": "2026-05-01"
    }
  },
  "tool": "add_pmax_asset_group_image"
}

400 โ€” Tool-level error (bad arguments / multi-account selection)

{
  "success": false,
  "error": "You have 25 meta_ads accounts connected. Please specify which account to use by passing the ad_account_id parameter:\n  - Acme Holdings (ad_account_id=\"act_123456789\")\n  - Acme EU (ad_account_id=\"act_987654321\")",
  "is_error": true,
  "tool": "add_pmax_asset_group_image"
}

402 โ€” Quota exhausted

{
  "success": false,
  "error": "\ud83d\udea8 Monthly limit reached (150/150 tool calls on Plus tier).\nUpgrade to Pro at https://adspirer.ai to keep building.",
  "is_error": true,
  "tool": "add_pmax_asset_group_image",
  "quota": {
    "used": 150,
    "limit": 150,
    "tier": "plus",
    "period_end": "2026-05-01",
    "upgrade_url": "https://adspirer.ai"
  }
}

Try it live


Adspirer REST API โ€” get an API key at adspirer.ai/keys ยท adspirer.ai