validate_and_prepare_meta_assets

Meta Ads Write

User wants to upload NEW images for Meta campaigns

Endpoint

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

Headers

Description

User wants to upload NEW images for Meta campaigns. This tool validates images and uploads them to Meta to get image hashes. This tool validates image URLs against Meta's specifications and uploads them to get image hashes needed for campaign creation. It stores validated assets in a temporary bundle (60-minute TTL). Returns: - Validation results (pass/fail per image) - Image hashes for successfully uploaded images - Asset bundle ID for use in campaign creation - Placement compatibility information When to use this tool: - "Upload this image for my Meta campaign" - "Validate my product images for Facebook ads" - "Prepare images for Instagram ads" - User provides image URLs and wants to create a campaign Parameters: - image_urls: List of public URLs to validate and upload (1-10 images) - placement: Target placement - 'feed' (default), 'stories_reels', or 'carousel' - ad_account_id: Required for multi-account users. Get from list_connected_accounts Execution time: 5-15 seconds (depends on image count and size) Data source: Meta Ad Image Upload API Image Requirements: | Placement | Aspect Ratio | Min Dimensions | Max Size | |-----------|-------------|----------------|----------| | Feed | 1:1 or 4:5 | 600x600 | 30MB | | Stories/Reels | 9:16 | 500x888 | 30MB | | Carousel | 1:1 | 1080x1080 | 30MB | Workflow: 1. Use `validate_and_prepare_meta_assets` with image URLs 2. If successful, receive an `asset_bundle_id` 3. Use that bundle_id with `create_meta_image_campaign`

Request body

All tool arguments are wrapped in an arguments object.

FieldTypeDescription
image_urlsarray requiredList of public image URLs to validate and upload (max 10). Images will be validated and uploaded to Meta to get image hashes.
placementstring optionalTarget placement: 'feed' (default), 'stories_reels', or 'carousel' default: "feed"
ad_account_idstring optionalMeta Ad Account ID (optional)

Example request

{
  "arguments": {
    "image_urls": [
      "string"
    ],
    "placement": "feed",
    "ad_account_id": "string"
  }
}

Example responses

200 — Success

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

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": "validate_and_prepare_meta_assets"
}

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": "validate_and_prepare_meta_assets",
  "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