Docs

Everything to run your Meta ads with AI, in one place.

Connect any AI app in a minute. Reads and pauses happen at once; anything that spends money waits for your approval, inside limits our server enforces.

01

Quick start

  1. Create your account (free) and sign in.
  2. Open Meta connection, connect Facebook and pick an ad account.
  3. Paste https://ads.viral4all.com/mcp into your AI app and sign in when it asks (steps for every app below).
  4. Ask: “How did my ads do this week?” Then set your safety limits on Goals & limits.
Start free

Prefer a guided tour? Read How it works.

02

Connect your AI

Pick your app for the exact steps. Most apps just need the URL and a sign-in.

Chat apps

Coding agents

Automation

Claude

  1. Open Settings → Connectors and click Add custom connector.
  2. Name it Viral4All Ads, paste the URL below and click Add.
  3. Click Connect, sign in here and choose read-only or read-and-change.
  4. It works in Claude on the web, desktop and phone with the same account.
Server URL
https://ads.viral4all.com/mcp

Optional: add our ready-made workflows in Settings → Capabilities → Skills (upload each zip):

03

Approvals & limits

Approval links

Resuming ads, budgets, creative, targeting and archiving never run from the chat. Your AI gets a link; the change runs only when you open it, sign in and press Approve. Links last 30 minutes.

Hard limits

On Goals & limits, set the highest daily budget, the biggest raise per change, AI changes per day and protected campaigns. Our server blocks anything outside them, even approved requests.

Undo

Every applied change keeps what it replaced. Press Undo on its approval page to put it back (archiving can't be undone).

Activity log

Every AI and API action is recorded with who asked, what and when. Alerts email you when spend jumps or results drop.

Pauses run at once (they only stop spend). New campaigns and copies always start paused.

04

Tools

The same tools are in every AI app, the REST API and the CLI. This list comes from the live server. Money is in minor units: 2500 is $25.00.

ToolWhat it doesRuns
meta_list_adsList Meta ads. List every Meta ad on the connected account with status, budget, spend, impressions, reach, interactions and destination link, plus the owner's goals and the hard limits every change request must stay inside.Reads
meta_pause_adsPause Meta ads. Pause one or many live Meta ads, ad sets or campaigns by id.Runs at once
meta_resume_adsResume Meta ads. Ask to restart paused Meta ads, ad sets or campaigns by id.Needs your OK
meta_set_budgetChange a Meta budget. Ask to set the daily or lifetime budget of an ad set or campaign, in minor units (cents).Needs your OK
meta_update_creativeUpdate a Meta ad's link or creative. Ask to change an ad's destination (website URL or WhatsApp number), copy, call to action, image URL or video id.Needs your OK
meta_confirm_actionCheck a pending Meta change. Check what happened to a change prepared by meta_resume_ads, meta_set_budget, meta_update_creative, meta_update_adset or meta_archive: waiting_for_approval, done (with the result read back from Meta), undone, failed or rejected, plus any note the owner left.Reads
meta_upload_mediaUpload media to Meta from a URL. Download an image or video from a public https URL, store it, and register it with Meta so it can be used in an ad.Runs at once
meta_create_adCreate a Meta campaign. Create a full paused Meta campaign: campaign, ad set with budget and targeting, creative and ad.Runs at once
meta_sync_nowRefresh Meta data. Pull the latest spend, results and creative details from Meta and report what changed since the last sync.Runs at once
meta_get_insightsMeta ads report. Performance report at account, campaign, ad set or ad level: spend, impressions, reach, frequency, clicks, CTR, CPC, CPM, results, cost per result, ROAS and every action count.Reads
meta_list_campaignsList Meta campaigns, ad sets and ads. The full structure: campaigns with their ad sets (budget, schedule, optimization goal) and ads (headline, link), each with spend, clicks, results and cost per result.Reads
meta_list_accountsList connected ad accounts. Every connected Meta ad account with currency, time zone and whether it can deliver, and which one the tools act on.Reads
meta_switch_accountSwitch the active ad account. Make another connected ad account the one every tool and the dashboard act on.Runs at once
meta_search_targetingSearch Meta targeting. Find interests (with audience size) or locations (countries, regions, cities) to target.Reads
meta_list_audiencesList custom audiences. Custom and lookalike audiences on the ad account with type, approximate size and whether they're ready to use.Reads
meta_activity_logWhat changed recently. Recent change requests (waiting, approved, rejected, failed, undone, with the owner's notes) and the ad changes the sync detected, newest first.Reads
meta_connection_statusMeta connection status. Whether Meta is connected, the active ad account, when the login expires and the last sync.Reads
meta_duplicateDuplicate a campaign, ad set or ad. Make a PAUSED copy (campaigns and ad sets copy what's inside them).Runs at once
meta_update_adsetEdit an ad set's targeting, schedule or bid. Ask to change an ad set: countries (replace the location targeting), ages, genders, interests (from meta_search_targeting; replaces detailed targeting, [] clears it), name, end time (ISO 8601) or bid cap in minor units.Needs your OK
meta_archiveArchive campaigns, ad sets or ads. Ask to archive by id: they stop for good and leave the active lists.Needs your OK
list_campaignsList workspace campaign notes. List campaign plans saved in the Viral4All Ads workspace (local notes, not live Meta campaigns; use meta_list_campaigns for those), optionally filtered by status or platform.Workspace note
create_campaignSave a workspace campaign note. Save a campaign plan in the Viral4All Ads workspace.Workspace note
update_campaign_statusUpdate a workspace campaign note. Change the status label of a campaign plan in the Viral4All Ads workspace.Workspace note
list_postsList workspace post drafts. List social post drafts saved in the Viral4All Ads workspace (local notes, nothing is published), optionally filtered by status or platform.Workspace note
create_postSave a workspace post draft. Save a social post draft in the Viral4All Ads workspace.Workspace note
performance_summaryWorkspace notes summary. Totals across the campaign plans saved in the Viral4All Ads workspace.Workspace note

05

REST API

Every tool is also a plain HTTP endpoint, for scripts, Zapier, Make, n8n and ChatGPT GPT Actions. Make a key on the API keys page and send it as Authorization: Bearer sk_meta_…. Import the OpenAPI schema to get every endpoint at once.

Run a tool
curl -X POST https://ads.viral4all.com/api/public/v1/tools/meta_get_insights \
  -H "Authorization: Bearer sk_meta_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"level":"campaign","datePreset":"last_7d","breakdowns":["age"]}'

GET /api/public/v1/tools lists the tools your key may use, with their input schemas. Changes that spend money answer with an approval link instead of running:

A change waiting for approval
{
  "status": "approval_required",
  "approve_url": "https://ads.viral4all.com/approve/…",
  "confirm_token": "cfm_…",
  "expires_in_seconds": 1800,
  "summary": { "object": { "name": "Spring sale" }, "budget": "daily", "from": "$20.00", "to": "$25.00" }
}

Then call meta_confirm_action with the confirm_token to read the outcome: waiting, done, rejected (with your note), failed or undone.

401The key is missing, wrong or revoked.
403The key lacks the permission this tool needs; the error names it.
404No tool by that name.
400Invalid input, or the tool refused (for example “Blocked by your limits: …”).

Key permissions

  • ads:read Read ads: List ads with impressions, spend, budget and status.
  • ads:create Create ads: Launch new campaigns, ad sets and ads.
  • ads:status Pause / resume: Stop and restart ads, single or in bulk.
  • ads:creative Update creative: Swap destination links, copy, images and videos.
  • ads:budget Set budget: Change daily or lifetime budgets.
  • ads:edit Edit ad sets: Change targeting, schedule and bid caps. Each change waits for your approval.
  • media:write Upload media: Import an image or video from a URL into Meta.
  • sync:write Trigger sync: Force a fresh pull of metrics from Meta.

06

CLI

Sign in once in your browser, then any terminal, script or coding agent can use every tool. Needs Node.js 18 or newer. Add --json for machine output.

Terminal
npx -y viral4all-ads login              # browser sign-in
npx -y viral4all-ads login --key sk_meta_…  # or an API key
npx -y viral4all-ads ads
npx -y viral4all-ads insights --level campaign --breakdowns age
npx -y viral4all-ads budget 1234567890 2500     # asks for your approval
npx -y viral4all-ads tools                      # everything you can run

Tip: alias v4a="npx -y viral4all-ads". npm blocked? Use npx -y https://ads.viral4all.com/cli/viral4all-ads.tgz instead. Exit codes: 0 ok, 1 tool error, 2 usage error, 3 not signed in. VIRAL4ALL_API_KEY overrides the saved sign-in.

07

Webhooks

Get told when something happens. Add an https URL on the Webhooks page and pick events. Slack and Discord webhook URLs get a plain message; anything else gets signed JSON.

  • approval.requested Your AI asked for a change that waits for your approval.
  • approval.approved An AI change was approved and applied.
  • approval.rejected An AI change was rejected. Nothing changed.
  • approval.failed An approved change didn't go through on Meta.
  • change.undone A change was put back the way it was.
  • alert.created The daily account check found something, like a spend jump.
  • request.blocked An AI request went over one of your limits and was stopped.
Payload
{
  "id": "6f1c…",
  "type": "approval.requested",
  "created_at": "2026-10-22T09:30:00.000Z",
  "data": { "approval_id": "…", "action": "budget", "headline": "Spring sale: daily budget $20.00 → $25.00", "approve_url": "https://ads.viral4all.com/approve/…" },
  "text": "Approval needed: Spring sale: daily budget $20.00 → $25.00. Approve or reject: https://ads.viral4all.com/approve/…"
}

Headers: X-Viral4All-Event, X-Viral4All-Delivery and X-Viral4All-Signature: t=…,v1=…, an HMAC-SHA256 of t.body with the secret shown when you added the webhook. Check it before trusting a message:

Verify (Node.js)
import { createHmac, timingSafeEqual } from "node:crypto";

export function verify(rawBody, header, secret) {
  const { t, v1 } = Object.fromEntries(header.split(",").map((p) => p.split("=")));
  if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return false; // older than 5 minutes
  const expected = createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
  return v1?.length === expected.length && timingSafeEqual(Buffer.from(v1), Buffer.from(expected));
}

Each event is sent once, with a 5-second timeout; any 2xx answer counts. A webhook that fails 20 times in a row is paused; resume it on the Webhooks page.

08

Plugin & skills

The Claude Code plugin adds the connector plus five ready-made workflows: weekly check, what changed, find wasted spend, launch a campaign and safe budget change.

Inside Claude Code
/plugin marketplace add https://ads.viral4all.com/claude/marketplace.json
/plugin install viral4all-ads@viral4all

Also on GitHub: /plugin marketplace add black12-ag/viral4all-ads. The skills work in Claude on the web too: upload them in Settings → Capabilities → Skills (zips are in the Claude steps under Connect your AI).

09

MCP details

  • Server: https://ads.viral4all.com/mcp (Streamable HTTP). Listed in the official MCP Registry as com.viral4all.ads/mcp.
  • Sign-in: OAuth 2.1 with dynamic client registration and PKCE. Discovery at /.well-known/oauth-authorization-server. Scopes: mcp:read (reports only) or mcp:write (everything, with approvals).
  • Apps without sign-in: send an API key as Authorization: Bearer sk_meta_….
  • AI agents can read /llms.txt to learn how to connect by themselves.

10

Troubleshooting

The sign-in window loops or closes

Desktop and terminal apps open your default browser, so sign in there. Allow pop-ups for your AI app and for ads.viral4all.com, and avoid private windows or strict tracking protection: they can drop your sign-in. Finish by clicking Allow. Still looping? Sign in at ads.viral4all.com in the same browser first, then click Connect in your AI app again.

“Tool … not found”, or a missing permission

Your AI app only sees the tools its sign-in or API key allows. Signed in read-only? The tools that make changes are hidden. Disconnect the app under Connected AI apps on the API keys page, connect again and tick Make changes. Using an API key? Switch the missing permission on for that key on the same page. The REST API's error names the permission it needs.

“Blocked by your limits: …”

The change would break a limit you set: the highest daily budget, the biggest raise, AI changes per day, or a protected campaign. Your AI can't change your limits. If you do want the change, adjust them on Goals & limits and ask again.

The approval link expired

Approval links last 30 minutes. Nothing changes when one expires. Ask your AI app for the change again and approve the new link.

“No Meta account connected”

Your AI app is signed in, but your Viral4All Ads account has no Meta login. Connect one on the Meta connection page, pick an ad account, then ask again.

“… isn't synced yet”

You have protected campaigns, and your AI asked to change something we haven't copied from Meta yet, so we can't check it against them. Click Sync now on the Overview page, then ask again.

Disconnect an AI app or revoke an API key

Open the API keys page. Under Connected AI apps, click Disconnect next to the app. Under Your keys, click Revoke. Either one stops working at once.

Company networks and proxies

Claude and ChatGPT reach us from their own servers, so on a company network only the sign-in page has to open. Coding agents, the CLI and scripts connect from your computer, so your proxy or firewall must allow HTTPS to ads.viral4all.com. If it inspects HTTPS, Node.js tools such as our CLI and mcp-remote also need your company's root certificate in NODE_EXTRA_CA_CERTS. A script that gets Cloudflare error 1010 should send a User-Agent header.

11

Support

Email [email protected]. Include your account email and the approval link or the time it happened; never send passwords or API keys. More on Support, Privacy and Terms.