A single, opinionated plan to put every Meta API on tap from Claude Code, plug Kawader's existing AI tools (Sparkling, the WhatsApp bot, Gear Insights, Odoo) into the same nerve, and unlock attribution, automation, and content velocity that until now lived behind login walls.
Kawader already operates inside Meta every single day — the Facebook Page, Instagram Business account, WhatsApp customer chats, ad campaigns through Supernova, and a rental catalog that lives on kawader‑cine.com. None of that is reachable from code. Every dashboard reading, audience export, content publish, and conversion event is manual or opaque. This guide closes the gap.
facebook-business SDK matches it 1:1.ir.ui.view → website.layout. Pixel is a 18th module on the same rail.tools/meta/) that wraps Graph API v25, plug it into Claude's tool use, adopt the official Meta Ads MCP for ad operations, and route every Kawader AI tool's output through this layer. Meta's data becomes a readable, writeable surface — the same way Odoo and Notion already are.
Meta is not one API; it's a constellation. Everything routes through Graph API v25.0 at graph.facebook.com/v25.0/ (Threads has its own host). Below is every surface relevant to Kawader, with Kawader's current position on each.
fbq() events.ctwa_clid).page_impressions + page_fans retire 2026‑06‑15. Webhook mTLS CA cutover happens 2026‑03‑31. Build directly on v25 and pin the new CA, not legacy.
A snapshot scan of the workspace shows n8n already ships Meta nodes (idle), Baileys is live but isolated, Supernova drives ads externally, and not a single line of code touches Graph API. The injection pattern for Pixel and the data path for Catalog already exist — the rails are laid, the trains aren't running.
| Surface | What exists | Gap | Status |
|---|---|---|---|
| Meta Pixel | Nothing. No fbq on any page. |
Inject base snippet via website_configure.py as 18th JS module. |
Greenfield |
| Conversions API | Nothing. No server‑side event sender. | n8n webhook ⇄ Odoo automation rule on sale.order. |
Greenfield |
| Commerce Catalog | Catalog data exists — tools/odoo/export_catalog_for_bot.py already pulls products. Odoo_Rental_Products_Master is canonical. |
New script tools/meta/catalog_export.py emits Meta‑shaped CSV; serve via Cloudflare Pages scheduled feed. |
Data ready |
| FB Page (kawaderart) | Page is live and connected to BM. Footer link in website_configure.py. |
No System User token. No programmatic posting. | UI‑only |
| Instagram Business | Account is live, linked to FB Page. | No instagram_content_publish scope; needs App Review. |
UI‑only |
| Marketing API | Supernova/Naeem manages campaigns. outputs/meta_ad/ has 20+ creative batches built locally. |
Read‑only Insights pull is trivial; campaign CRUD stays with Supernova for now. | External vendor |
Baileys live on Hostinger VPS. wa-rental-bot PM2. Personal number. tools/whatsapp-bot/. |
Add Cloud API on a second business number for templates, catalog, CTWA, Flows. Keep Baileys for personal inbox. | Half‑live | |
| n8n nodes | Facebook Graph API, FB Lead Ads, WhatsApp Cloud nodes shipped — but unused. | Activate for Lead Ads webhook, CAPI relay, scheduled catalog refresh. | Idle |
| Supernova creatives | outputs/meta_ad/ — 20+ batch directories of static + animated creative. |
Push these into a Meta‑side ad_image library via Marketing API; tag campaigns by creative ID. |
Asset surplus |
| Threads | Unknown — needs human check whether @kawaderart exists on Threads. |
Provision Threads account if not present; container→publish flow. | Verify first |
Everything below this section is plumbing. This section is the keys to the building. Without a System User token issued by a Meta App attached to Kawader's Business Manager, nothing works. ~30 minutes in the Meta UI, one time, irreversible (you keep the BM forever).
| Scope | Powers | Review needed? |
|---|---|---|
pages_show_list | Discover Pages owned by the user. | Standard |
pages_read_engagement | Read Page Insights, posts, comments. | Standard |
pages_manage_posts | Publish to Page; schedule posts. | Advanced |
pages_manage_metadata | Subscribe Page to webhooks. | Advanced |
instagram_basic | Read IG account info. | Standard |
instagram_content_publish | Publish IG feed posts, Reels, Stories. | Advanced |
instagram_manage_insights | Pull post‑level + account‑level IG insights. | Advanced |
ads_management | Create/edit campaigns, ad sets, ads, creatives. | Advanced |
ads_read | Read Insights only — safer if we just want reporting. | Standard |
business_management | Manage assets in BM. | Advanced |
catalog_management | Read/write Commerce Catalog products. | Advanced |
whatsapp_business_messaging | Send/receive on WhatsApp Cloud API. | Advanced |
whatsapp_business_management | Manage WABA, templates, phone numbers. | Advanced |
leads_retrieval | Pull lead form submissions. | Advanced |
threads_basic + threads_content_publish | Read/publish on Threads. | Advanced |
security add-generic-password -s meta_kawasist -a system_user -w <TOKEN>From here through section 11, each pillar is a track of work. Priority tier is encoded in the badge: P1 ship first = highest leverage / lowest risk; P4 later = ship after foundations are stable.
Browser fbq events fire on the website; the same events also fire server‑side via Conversions API. Meta dedupes them on a shared event_id. Result: ad attribution that survives ATT, ad blockers, and cookieless browsers. Without this, every dollar Supernova spends is unattributed.
| Event | Where | JS Module | CAPI? |
|---|---|---|---|
ViewContent | Product page load | brand/js/product-detail.js (new) | Optional |
AddToCart | "Add to List" success | brand/js/rent-now-btn.js (extend) | Yes |
ViewCart | Cart drawer opens / cart page | brand/js/cart-float.js (extend) | No |
InitiateCheckout | /shop/checkout load | brand/js/checkout-pixel.js (new) | Yes |
Purchase | /shop/confirmation | brand/js/purchase-pixel.js (new) | Yes (priority) |
Lead | Contact form submit | brand/js/address-submit.js (extend) | Yes |
curl -X POST "https://graph.facebook.com/v25.0/$PIXEL_ID/events" \
-H "Content-Type: application/json" \
-d '{
"data":[{
"event_name":"Purchase",
"event_time": 1715000000,
"event_id":"ord_2026_05_08_8347",
"action_source":"website",
"event_source_url":"https://www.kawader-cine.com/shop/confirmation",
"user_data":{
"em":["<sha256(email)>"],
"ph":["<sha256(+970...)>"],
"fbc":"fb.1.<ts>.<fbclid>",
"fbp":"fb.1.<ts>.<random>",
"client_user_agent":"...",
"client_ip_address":"..."
},
"custom_data":{
"value": 450.00, "currency":"ILS",
"content_ids":["TEMPL_457"], "content_type":"product",
"order_id":"S00857"
}
}],
"test_event_code":"TEST12345"
}' \
-H "Authorization: Bearer $CAPI_TOKEN"
Push the 367 published, rentable Odoo products into a Meta Commerce Catalog. Once in, products tag in IG posts and Reels (Instagram Shopping), appear inside WhatsApp chats as carousels, and become eligible for Dynamic Product Ads — Meta auto‑generates ad creative per product based on user intent.
Meta polls a hosted CSV every N hours. Simplest model — error reports surface in Commerce Manager UI. Host on Cloudflare Pages at kawasist-internal.pages.dev/meta-catalog/feed.csv.
Push diffs in real time via POST /{CATALOG_ID}/items_batch. Better when rentals turn over fast. Defer to v2 unless we hit feed‑lag pain.
| Meta column | Required | Odoo source | Transform |
|---|---|---|---|
id | Yes | default_code ‖ template_<id> | Stable across feed runs |
title | Yes | name | UTF‑8, ≤150 chars |
description | Yes | description_sale | HTML strip → plain text |
availability | Yes | qty_available | >0 → "in stock" else "out of stock" |
condition | Yes | — | Constant "new" (rental gear) |
price | Yes | list_price | Format "450.00 ILS" |
link | Yes | Computed | https://www.kawader-cine.com/shop/{id} |
image_link | Yes | Odoo image API | https://www.kawader-cine.com/web/image/product.template/{id}/image_1024 |
brand | Yes | Constant | "Kawader" |
google_product_category | Recommended | categ_id.name | Map dict in script (Camera→1420, Audio→233, etc.) |
item_group_id | Optional | categ_id | Group product variants under one parent |
Pull only rent_ok=True AND website_published=True. This mirrors the existing filter in tools/odoo/export_catalog_for_bot.py — reuse that XML‑RPC connection helper rather than reimplementing.
Meta gives a uniform two‑step "container → publish" pattern across IG and Threads. Page posts are simpler (one POST). Once wired, every Sparkling Reel, Gear Insights digest, IBNS BTS clip, and Gear Talk teaser ships with a single Claude command.
media_type=REELS + share_to_feed=true for double exposure.children=[c1,c2,...].50 published posts per IG account per rolling 24h. Plenty for organic; keep ad‑creative pushes via Marketing API on the Ads track instead.
Threads runs at https://graph.threads.net/v1.0/ (NOT graph.facebook.com). Same container→publish dance. 250 posts per profile per 24h. Out of beta and publicly available since 2024. Useful for repurposing Gear Insights blurbs as text Threads, no extra creative cost.
Two halves: read (Insights — what's happening with Supernova's spend) and write (Custom Audiences — push Kawader's customer list back into Meta for retargeting + lookalikes). Insights is read‑only and trivial. Custom Audiences requires care because it's PII.
# 1. Submit
POST /v25.0/act_$AD_ACCOUNT_ID/insights
fields=campaign_name,spend,impressions,clicks,ctr,actions,cost_per_action_type
level=campaign
time_range={"since":"2026-04-22","until":"2026-05-08"}
# → returns {report_run_id}
# 2. Poll
GET /v25.0/$REPORT_RUN_ID
# → {async_status: "Job Completed"}
# 3. Fetch
GET /v25.0/$REPORT_RUN_ID/insights
Kawader has a customer list in Odoo (res.partner). Hash emails (lowercase, trim, SHA‑256) and phones (E.164, SHA‑256), then push:
POST /v25.0/$CUSTOM_AUDIENCE_ID/users
{
"schema": ["EMAIL_SHA256", "PHONE_SHA256"],
"data": [
["abc123...", "def456..."],
["xyz789...", "uvw012..."]
]
}
Then Lookalike from that audience: POST /act_$ID/customaudiences {subtype:"LOOKALIKE", lookalike_spec:{ratio:0.01,country:"PS"}}. 1% lookalike = closest match. Useful for Supernova's targeting brief.
Today Baileys handles Ameer's personal inbox brilliantly with Gemini 2.5 Pro for Arabic, Odoo catalog awareness, and a 30‑turn memory. What Baileys cannot do: send approved templates without ban risk, serve in‑chat catalog cards, receive Click‑to‑WhatsApp ad attribution, run Flows (multi‑screen forms inside chat). Cloud API does all four.
| Capability | Baileys (today) | Cloud API (to add) |
|---|---|---|
| Personal inbox triage with Gemini AI | Live | Not needed |
| Reply to incoming customer chats | Live | — |
| Send promotional templates (utility/marketing) | Ban risk | Designed for this |
| Push catalog as in‑chat carousel | Impossible | Native |
| Receive Click‑to‑WhatsApp ad attribution | No ctwa_clid | Full ad context |
| Run interactive Flows (booking, lead form) | Impossible | Server‑driven |
| 72‑hour free messaging post‑CTWA click | — | Yes |
| Quality rating / template approval | N/A | Built‑in |
How they coexist: register a second Kawader business number in WABA for Cloud API. Baileys keeps Ameer's personal number. They never share a number. Routing logic in tools/whatsapp-bot/index.js already namespaces by JID, so the bot can stay phone‑number‑agnostic.
POST https://graph.facebook.com/v25.0/$PHONE_NUMBER_ID/messages
{
"messaging_product": "whatsapp",
"to": "970599xxxxxxx",
"type": "template",
"template": {
"name": "rental_quote_ready",
"language": {"code": "ar"},
"components": [
{"type":"body","parameters":[
{"type":"text","text":"أمير"},
{"type":"text","text":"سوني FX3"},
{"type":"text","text":"٤٥٠ شيقل / يوم"}
]}
]
}
}
Flows are server‑driven multi‑screen forms inside the chat. Imagine: customer taps a CTWA ad → drops into chat → bot sends a Flow with screens for "Pick your rental dates · Choose kit · Confirm address". Customer fills it out without ever leaving WhatsApp. No website redirect. Submission lands as a structured webhook payload Kawader can route into Odoo as a quote draft.
Flow templates Kawader should ship in v1:
sale.order draft.Supernova runs Lead Ads (in‑Meta forms users fill without leaving the app). Today those leads arrive in Naeem's inbox, get forwarded, and drop. With the API: webhook fires → Kawader fetches full lead → routes to Odoo as a res.partner + a Notion task for follow‑up + adds them to a "Recent Leads" Custom Audience for retargeting + triggers a WhatsApp template within 1 hour.
Meta's Ad Library is fully public — every active and historical ad globally, queryable by API. Free.
For Kawader: weekly cron via Claude that pulls ads from competing rental houses (Cinerent, Camera House, Stash, etc.) + competing production companies, summarizes hooks/offers/creative trends, and posts a digest into Notion. Same script could compare Supernova's creative posture against the field.
GET /v25.0/ads_archive
?search_terms=cinema+rental
&ad_reached_countries=['PS','JO','EG']
&ad_active_status=ALL
&fields=ad_creative_bodies,ad_creative_link_titles,page_name,ad_delivery_start_time,ad_snapshot_url
The thing that changed the calculus this year: Meta shipped an official Ads MCP server on April 29 2026. It's hosted at mcp.facebook.com/ads, OAuth, 29 tools, no infrastructure to run. For ad operations we adopt it directly. For everything else (Page posts, IG, WhatsApp, Catalog, CAPI), we build a thin local Python tool layer wrapping facebook-business==25.0.1, exposed to Claude via tool‑use. Custom MCP only if the wrapper grows beyond ~10 commands.
| Layer | What it covers | Why this choice |
|---|---|---|
Official Meta Ads MCPmcp.facebook.com/ads |
Campaigns, ad sets, ads, creatives, audiences, ad insights, account/page diagnostics. 29 tools. | Maintained by Meta. OAuth UX. Read‑only / read‑write / financial scope tiers. Free. |
Local tools/meta/Python + facebook-business 25.0.1 |
Pixel/CAPI events, IG/Page/Threads publishing, Catalog feed export, Lead Ads retrieval, WA Cloud send. | What the official MCP does NOT cover. Same auth (system user token). Exposed to Claude as tool‑use schemas. |
| n8n workflows (idle nodes already shipped) |
Cron jobs (catalog refresh), webhook receivers (Lead Ads, CAPI relay, Page subscriptions). | Visual ops surface for things that should run unattended. Not for interactive Claude work. |
| Community MCPs (optional) | WhatsApp Cloud (networkerman/whatsapp-cloud-api-mcp-server), IG (mcpware/instagram-mcp), FB Pages (HagaiHen/facebook-mcp-server). |
Adopt only if our wrapper is duplicating their work. Vet license + maintainer activity each time. |
tools/meta/ layer looks liketools/meta/
__init__.py
auth.py ← Keychain → System User token (single source)
graph.py ← thin Graph client (handles rate limits, retries)
pixel.py ← CAPI sender + dedup helper
catalog.py ← Odoo → Meta Commerce CSV exporter
post_fb.py ← FB Page posts: text/photo/video/scheduled
post_ig.py ← IG container→publish (feed/Reels/carousel)
post_threads.py ← Threads container→publish
whatsapp.py ← WA Cloud: templates, catalog cards, Flows trigger
insights.py ← Async insights report → markdown digest
audiences.py ← Custom Audience hashed upload + Lookalike create
leads.py ← Lead Ads webhook receiver + retrieval
ad_library.py ← Ad Library competitor crawler
whoami.py ← Token health check (debug_token)
Each module exposes a CLI (so Claude can call them via Bash) and a Python def main(**kwargs) that's wrapped as a Claude tool‑use schema in tools/meta/claude_tools.py. Same pattern as tools/odoo/.
Kawader already has an AI surface — Sparkling Haven, the WhatsApp bot, Gear Insights, the IBNS production stack, Sale automations. Each one is a producer or consumer of content/data that Meta APIs can plug directly into. This is where the integration compounds.
| Existing tool | What it produces / does | Meta API it plugs into | Outcome |
|---|---|---|---|
Sparkling Havenapp/sparkling/ |
Vizard‑class short‑form videos with bilingual captions (libass+HarfBuzz), 28s mp4 outputs. | IG Graph Reels publish · Threads video publish · FB Page video. | One‑command "publish to all three" after Sparkling renders. No manual upload. |
WhatsApp bottools/whatsapp-bot/ |
Conversational replies, 30‑turn memory, Odoo catalog awareness, image & voice handling. | WhatsApp Cloud API (second number) for templates + catalog + Flows. Baileys stays for personal inbox. | Quotes, receipts, "rental confirmed" all go via approved templates — no ban risk. Catalog cards in‑chat. |
Gear Insights newslettertools/gear-insights/ |
Daily 3‑variant industry digest (Wire/Dispatch/Brief). Already published to Cloudflare Pages. | Threads (text repost), IG carousel (5‑slide auto‑graphics), FB Page link post. | Free top‑of‑funnel audience growth — same content, four channels, zero extra effort. |
Odoo Sale Order automationstools/odoo/ |
Quote → confirmation → invoice state machine. Already has automation rules. | CAPI Purchase event on confirmation. WhatsApp Cloud "rental_confirmed" template. Custom Audience add. |
Closed‑loop attribution. Instant customer notification. Retargeting list grows automatically. |
Lead Generatortools/lead_gen/ |
Generates leads via various channels (web scrape, contact discovery). | Custom Audiences upload (hashed). Lookalike Audience seeding. | Outbound prospects become Meta retargeting + lookalike base. |
IBNS productiontools/ibns/ + episode‑notes |
Episode transcripts, BTS clips, marker notes, press kits. | FB Page scheduled posts (episode launches), IG Reels (BTS), Threads (text quotes). | Each episode auto‑publishes a 5‑post drop. No manual scheduling. |
| Gear Talk pipeline (Notion DB, AM Studios shoots) |
Equipment‑focused video content. 25 episode pipeline live. | IG Reels publish, Threads, FB Page. Catalog product tags on the gear featured in each Reel. | Each Gear Talk Reel becomes a tagged shoppable post. Watcher → catalog → rental quote. |
Meta Ad creative pipelineoutputs/meta_ad/ |
Already produces 20+ creative batches for Supernova. | Marketing API ad_creative upload + library tagging. |
Naeem stops manually uploading; creative is in‑library and version‑pinned. |
| Notion (Kawader HQ) | Source of truth for tasks, content pipelines, episode tracking. | Lead Ads → Notion task. Insights digest → Notion DB. Comment/mention webhooks → Notion task. | Meta surface becomes part of the Notion operating system. |
tools/meta/ calls inserted into existing pipelines. The leverage is multiplicative because every Kawader AI tool starts writing to Meta and reading from Meta as a normal step.
Five layers, one data flow. Existing components in green, partial in gold, new in purple. The whole thing fits on a napkin.
Five phases, ~3 weeks total if App Review goes smoothly. Each phase ends with a verifiable checkpoint, not "and then we keep going". The earlier phases unblock the later ones — don't skip ahead.
| Phase | Scope | Effort | Output | Verification |
|---|---|---|---|---|
| P0 30 min |
Provisioning — Meta App, System User, asset assignments, token to Keychain. | Meta UI work, no code. | memory/project_meta-integration.md with all IDs. |
tools/meta/whoami.py returns valid scopes. |
| P1 2–3 days |
Pixel base + browser fbq events on 6 surfaces. Adopt official Meta Ads MCP for read‑only insights smoke test. |
1 new ir.ui.view module + 5 JS file edits + MCP setup. | Live Pixel + first Insights pulled via MCP. | Pixel Helper shows events; MCP returns last 7d Supernova data. |
| P2 3–4 days |
Server‑side CAPI: n8n bridge + Odoo automation rule. Catalog feed export + Cloudflare hosting + Commerce Manager wire‑up. | tools/meta/pixel.py, tools/meta/catalog.py, n8n flow JSON, Odoo automation. |
Deduped events in Events Manager. 367 products live in Catalog. | EMQ ≥6/10 after 24h. IG product tagging works. |
| P3 2 weeks |
Submit App Review for publishing scopes (pages_manage_posts, instagram_content_publish, whatsapp_business_messaging). Build Custom Audience sync from Odoo. Build Lead Ads webhook receiver. |
App Review screencast + business verification + tools/meta/audiences.py + tools/meta/leads.py. |
Approved app. Audiences syncing nightly. Leads landing in Notion. | Test lead end‑to‑end. Audience refreshed in Audience Manager UI. |
| P4 2 days |
Organic posting tools: post_fb.py, post_ig.py, post_threads.py. Wire Sparkling output → IG Reels publish. |
Three publishing CLIs + Sparkling integration hook. | Claude can publish to FB/IG/Threads with one command. | Live test post on each surface. Sparkling auto‑publishes a Reel. |
| P5 3–5 days |
WhatsApp Cloud API on second number. Three Flow templates (Quote/Inquiry/Casting). Click‑to‑WhatsApp ad attribution wiring. | WABA registration + tools/meta/whatsapp.py + Flow JSON definitions + Odoo intake routing. |
CTWA ads route into Cloud API; Flows submit to Odoo. | Test CTWA click → Flow submit → Odoo quote draft created. |
Three categories of risk: token compromise (operational), Meta policy violation (account safety), and silent breakage (depending on deprecated APIs). Each gets a control.
tools/meta/whoami.py runs weekly via launchd; alerts via WA bot if expired..env.meta is regenerated at boot, never committed.Required artifacts for the publishing scopes:
Community reports: 2 days–3 weeks turnaround, average 1 week. Plan accordingly.
A non‑technical readout of what changes for Kawader after each pillar lands.
Every claim above traceable to a canonical Meta doc or a vetted public source. Pulled fresh 2026‑05‑08.