validate_and_prepare_meta_assets

Meta Ads Write

**META ADS ONLY

Endpoint

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

Headers

Description

**META ADS ONLY.** Validates and uploads images for Meta (Facebook/Instagram) campaigns. ⚠️ **WRONG TOOL FOR OTHER PLATFORMS.** Each ad platform has its own validator because image specs differ: • Meta Ads (this tool) → 1080×1080 carousel, 1200×628 feed, etc. • Google Ads → use `validate_and_prepare_assets` • LinkedIn Ads → use `validate_and_prepare_linkedin_assets` • TikTok Ads → use `validate_and_prepare_tiktok_assets` 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 required**REQUIRED.** List of public image URLs to validate and upload (max 10). Ask the user for the image URLs before calling this tool — do NOT call with an empty payload. Images will be validated and uploaded to Meta to get image hashes you can reference in campaign creation.
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