switch_primary_account

General (Account Management) Write

Activate ad accounts for a platform

Endpoint

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

Headers

Description

Activate ad accounts for a platform. Two modes: 1. `account_id` (singular) — ADDS this account to the active set. Other already-active accounts stay active. Safe to call multiple times to activate accounts one by one. 2. `account_ids` (plural, list) — REPLACES the full active set with this exact list. Any account NOT in the list becomes inactive. Use this only when the user explicitly wants to set a specific group of accounts as the complete active set (e.g., "only use accounts A, B, C"). Use this tool when: - User wants to activate a different ad account (use account_id — singular) - User wants to activate multiple specific accounts (use account_ids — plural) - User says "also use my other account" (use account_id — additive) - User says "only use accounts X, Y" (use account_ids — replace) Get account IDs from get_connections_status. IMPORTANT: Returns updated connections list after activation.

Request body

All tool arguments are wrapped in an arguments object.

FieldTypeDescription
platformstring requiredPlatform to switch primary account for: google_ads, tiktok_ads, meta_ads, or linkedin_ads
account_idstring optionalSingle account ID to activate (e.g., '1234567890' for Google Ads). This ADDS the account to the active set — other already-active accounts stay active. Use this OR account_ids, not both.
account_idsarray optionalEXPLICIT full list of account IDs that should be active. Any account NOT in this list is set to inactive. Use this ONLY when you want to replace the entire active-account set in one call. If you just want to activate one more account, use `account_id` (singular) instead — it adds without deactivating others. Get account IDs from get_connections_status.

Example request

{
  "arguments": {
    "platform": "string",
    "account_id": "string",
    "account_ids": [
      "string"
    ]
  }
}

Example responses

200 — Success

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

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

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