get_linkedin_organizations

LinkedIn Ads Read

Fetch the LinkedIn Organizations (Company Pages) AND Ad Accounts the user can manage

Endpoint

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

Headers

Description

Fetch the LinkedIn Organizations (Company Pages) AND Ad Accounts the user can manage. IMPORTANT: Call this tool during campaign creation discovery phase to get both organization_id AND account_id. What this tool does: - Queries LinkedIn for all Company Pages the user has admin access to - Queries LinkedIn for all Ad Accounts the user can access - Returns organization IDs, names, AND ad account IDs - No parameters required - uses connected LinkedIn account Returns: - List of organizations with ID, name, and LinkedIn URL - List of ad accounts with ID, name, status, and linked organization - Both IDs needed for different operations Use this tool to: - Get the organization_id automatically (no need to ask user!) - Get the account_id for asset discovery (required for finding images/videos!) - Verify user has access to a Company Page - Find which page to use for Sponsored Content After getting organizations & accounts: - Use the `account_id` in `discover_linkedin_assets` to find existing images/videos - Use the `organization_id` in whichever campaign creation tool the user selected: - `create_linkedin_image_campaign` (Single Image) - `create_linkedin_video_campaign` (Video) - `create_linkedin_carousel_campaign` (Carousel) - `create_linkedin_text_campaign` (Text Ad) - Assets are tied to ad accounts, not organizations - that's why account_id is needed Execution time: 2-3 seconds

Request body

All tool arguments are wrapped in an arguments object.

FieldTypeDescription
account_idstring optionalLinkedIn Ad Account ID (required for multi-account users, used for authentication). Get from list_connected_accounts.

Example request

{
  "arguments": {
    "account_id": "string"
  }
}

Example responses

200 — Success

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

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

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