Learn · Setup guides

Connect Meta Ads API to Outloop

Last updated:

In short

Connecting Meta Ads to Outloop means generating one Meta System User access token with the approved Outloop Ads Access app, storing it once in the local Outloop app (macOS Keychain), and assigning Meta ad account IDs to each approved workspace.

Agents then read and manage only their workspace's assigned ad accounts — reporting, campaign and creative work, image and video uploads — without ever seeing the token. Wrong-client access is blocked before any call, and every request is audited with secret_exposed:false.

Summarize this setup guide with AI ChatGPTClaudePerplexity

What this connection enables

One Meta System User access token, stored once, working safely for every approved workspace:

One Meta System User access token
  → stored once locally in the macOS Keychain
  → shared securely through Outloop
  → assigned only to approved workspaces
  → one or more Meta ad account IDs pinned to each workspace
  → agents use approved Meta Marketing API capability
    without ever seeing the token

With Outloop's Full API access mode, agents can run the normal supported Marketing API operations on their workspace's assigned ad accounts: reads and reporting; campaign, ad set, ad, and creative creation; normal updates; pause and resume; image upload; video upload; and creative asset use. Delete and archive are separate destructive actions and stay disabled unless the operator explicitly enables them.

The token itself is never handed to an agent. The credential is used on the wire, host-side; the agent receives a redacted, audited result. Each workspace is limited to the Meta ad account IDs assigned to it — see wrong-client access in agent loops.

What you need before starting

If your team runs its own Meta app instead, Marketing API access is governed by the Meta Marketing API Access Tier (Limited access by default; Full access after App Review) — that separate path is covered in the Meta Marketing API App Review guide. This guide documents the approved-app flow.

Never paste access tokens, Authorization headers, or customer secrets into chat, screenshots, docs, .env files, project folders, agent prompts, or generated artifacts. The token's only destination is the local Outloop app in Step 7.

Step 1: Find your Business Portfolio ID

In Meta Business Settings (Meta Business Suite → Settings), open Business info. The Business Portfolio ID is shown below your portfolio name.

Meta Business Settings Business info page showing where the Business Portfolio ID appears, with identifiers redacted.
The Business Portfolio ID is optional, informational metadata in Outloop. It is not an access grant, and it does not replace the Meta ad account ID. Access is determined by the System User's assigned assets and the per-workspace ad account assignment in Step 9.

Step 2: Prepare the System User

Go to Business Settings → Users → System users. Select your dedicated System User, or create one for agent automation. Then confirm — under Assigned assets — that the ad accounts your workspaces will manage are assigned to this System User. A token can never reach an ad account its System User does not have.

Meta Business Settings System users page with a dedicated system user selected and the Generate token button highlighted.

Step 3: Click Generate token and select Outloop Ads Access

Click Generate token. In the app selector, choose Outloop Ads Access — the approved app you were given access to during onboarding. You do not need to create your own Meta app for this flow.

Don't see Outloop Ads Access in the list? Meta only shows apps connected to your business and this System User. That connection is set up during onboarding — stop here and contact support@outloop.co rather than creating a new app or picking a different one.
Meta Generate token dialog with the Outloop Ads Access app highlighted in the Select app list.

Step 4: Choose token expiration

For uninterrupted agency workflows, you may choose Never for a dedicated System User with tightly limited business assets. Choose a shorter expiration when required by your organization's security policy. Tokens can be revoked and rotated later at any time from the same System users screen.

Meta requires some businesses to use expiring tokens — if "Never" errors or is unavailable for your portfolio, choose the 60-day option and plan a rotation reminder. Rotating is quick: generate a new token, paste it into Outloop once, revoke the old one.
Meta token expiration step showing the 60 days and Never options for a System User access token.

Step 5: Select permissions

Select the permissions the token will carry. Meta's documentation calls ads_read and ads_management the primary Marketing API permissions — the core set for reading and managing ads:

ads_read              # reporting and read-only access
ads_management        # campaign / ad set / ad / creative work
business_management   # only when workflows manage business portfolio assets

The remaining permissions in the approved set are optional — only needed for workflows that touch those assets: pages_manage_ads, pages_read_engagement, and pages_show_list for ads that run from a Facebook Page, catalog_management for catalog / commerce ads, and threads_business_basic for Threads workflows. Select what your client work actually uses.

Meta assign permissions step showing ads_management, ads_read, business_management and optional page, catalog, and Threads permissions selected before generating the token.

Step 6: Generate and copy the token

Click Generate token. Meta displays the token once. Copy it and go directly to the local Outloop app — do not paste it into chat, documentation, project files, .env files, screenshots, or agent prompts.

Meta Token created dialog with the token value redacted and the Copy button visible — Meta shows a System User access token only once.

Step 7: Add Meta Ads access in Outloop

In the Outloop Mac app, add access for Meta Ads and paste the System User access token once. (If a button in an older build still says "Add API Key", the value you are pasting is your System User access token — Outloop stores it the same way.) Then:

Outloop add Meta Ads access form with the optional Business Portfolio ID field, Graph API version, shared global scope, macOS Keychain Always Allow note, and the pasted token shown only as dots.

Outloop stores the token in the macOS Keychain and never shows it again. Agents never receive it — the credential is used on the wire, host-side, and results come back redacted.

Step 8: Find the Meta ad account ID

Back in Meta: Business Settings → Accounts → Ad accounts. Select the client ad account a workspace should manage and copy its numeric ID from the details panel. The account must already be accessible to your System User (Step 2) — assigning an ID in Outloop cannot grant access the token does not have.

Meta Business Settings Ad accounts page showing where the numeric Meta ad account ID appears in the account details panel, with account names redacted.

Step 9: Assign the ad account to the Outloop workspace

On the workspace's Meta Ads access row, open Meta ad account ID(s), enter the ID as digits only — comma-separate multiple IDs — and save. Outloop adds the act_ prefix internally.

Outloop workspace Meta Ads row with the Meta ad account ID field where digits-only account IDs are entered and saved.

This assignment is the tenant-safety boundary. Until at least one approved ad account is assigned, the workspace can prove identity (/me) but account-scoped calls stay blocked (CUSTOMER_RESOURCE_PIN_REQUIRED). Each workspace can manage different ad accounts under the same shared agency token.

Outloop Meta Ads access row showing Runtime verified with API bridge, Full API access, file and media upload enabled, destructive actions disabled, and the per-workspace Meta ad account ID field.

Step 10: Run the first proof

Click Copy workspace run prompt on the Meta Ads row and give it to the workspace's agent. The safe first proof is read-only:

GET /me                          # verify the System User identity
GET /act_<AD_ACCOUNT_ID>         # read the assigned ad account
GET /act_<AD_ACCOUNT_ID>/campaigns?limit=5   # bounded campaign list

Success criteria:

decision: allow
HTTP 200
secret_exposed: false
correct ad account only
audit entry exists
Outloop proof verdict showing allow decisions, HTTP 200, service meta_ads, secret_exposed false, and a bounded campaign list returned as all PAUSED, with account identifiers redacted.

A successful end state on the access row reads: Runtime verified · API bridge, Full API access, file / media upload enabled, your assigned Meta ad account ID(s), and secret_exposed: false on every audit entry.

Optional: prove uploads and a PAUSED creative

Not required for the initial connection. When you want to confirm full capability on your own client account, run the same safe sequence used to runtime-verify this connector — it spends nothing and delivers nothing:

All of this works with destructive actions disabled — creating, updating, uploading, and pausing are normal operations.

Optional: enable delete and archive

Normal create / update / pause / upload operations do not require this. Enable destructive actions only when you intentionally want agents to permanently delete or archive Meta entities (campaigns, ad sets, ads, creatives) on the workspace's assigned accounts.

Outloop Meta Ads row showing destructive actions disabled by default with the optional Enable destructive actions button and a saved workspace ad account assignment.

Outloop asks for explicit confirmation and spells out the consequences before enabling:

Outloop confirmation dialog explaining that enabling destructive actions allows agents to delete or archive Meta entities, deletion is permanent, requests stay bounded to assigned accounts and audited.

What is verified vs what we don't claim

The one thing we still don't claim: delete and archive. They are not part of the verified default surface — they stay disabled until the operator explicitly enables destructive actions per workspace, and enabling them is an intentional decision, not a setup step.

Marketing API through Outloop vs the Meta ads MCP

Meta launched an official ads MCP server (mcp.facebook.com/ads) in open beta in April 2026, alongside an ads CLI. It is a real option for interactive ad work — but it is a different access model, and it is not connected or verified in this workspace.

API bridge: Live now Verified in this guide Audited Secret-safe Workspace-scoped
MCP: Official MCP exists Open beta Not connected here Not verified in this guide
For this workspace, the Meta Marketing API through Outloop is the only Meta Ads path that is live and verified right now.
Dimension Marketing API through OutloopMeta ads MCP (official)
Status here Runtime verified Read and write chain runtime-verified: allow, HTTP success, secret_exposed:false, audited. Not connected here Open beta since April 2026; Meta notes not every account has access yet.
Credential handling Token never seen System User access token stays in the macOS Keychain; used on the wire host-side. Meta-hosted auth You authenticate the AI client to Meta; access follows your Meta login/session.
Per-client scoping Workspace-pinned Each workspace is limited to its assigned Meta ad account IDs; wrong-client calls are blocked. Account-wide Scoped to what your Meta user can reach — no per-workspace ad account pinning.
Capabilities Full API access Reads, creation, updates, pause/resume, image and video upload; delete/archive off by default. Broad toolset Meta lists reporting, ad creation/management, catalog tools — not verified in this workspace.
Audit trail Local audit log Every request audited locally with decision, HTTP status, and secret_exposed:false. Platform-side Activity visible through Meta’s own surfaces; no local per-workspace audit.
Important: this comparison is intentionally conservative. The official Meta ads MCP may expose a broad toolset, but it is not connected in this workspace, so this guide does not mark MCP capabilities as verified. The Marketing API through the Outloop bridge is what is live and verified here.

Common mistakes

The Outloop value

Meta gives the agency API access. Outloop makes that access tenant-safe:

One agency token may reach many ad accounts.
But each agent workspace only reaches the ad accounts assigned to it.

Related: AI agent API key management · Outloop for AI agencies · Meta Marketing API App Review guide · Google Ads API setup · WhatsApp Cloud API setup.

Outloop is available with guided onboarding for agency teams. Outloop is an independent tool and is not affiliated with or endorsed by Meta. See the security model.

Summarize this setup guide with AI ChatGPTClaudePerplexity

Run Meta Ads agents without handing over tokens.

Outloop is available with guided onboarding for AI agencies, operators, and dev shops.

Frequently Asked Questions

Meta Ads API + Outloop — FAQ