← Back to dashboard
meta-developerscommsfreshReader view (for NotebookLM)

Meta for Developers Integration Guide

What is Meta for Developers?

The real model

Pin v26.0, run on system-user tokens + appsecret_proof, verify HMAC webhooks, respect US privacy flags.

v26.0 shipped 2026-07-29; v21.0 dies 2027-01-21, and on 2026-10-27 v26's protocol cleanup (no pretty/debug/date_format/?ids=/ETag) and the Commerce Order Management removal hit every version. Unversioned Graph calls fall back to the oldest version; unversioned Marketing API calls fail. Server automation runs on a system user token with appsecret_proof (Require App Secret on). Webhooks: HMAC-SHA256 of raw bytes in X-Hub-Signature-256, constant-time compare, ACK 200, process async — Meta retries for 36 h, so dedupe. Conversions API: ≤1,000 events/request, ≤7 days old, SHA-256 the PII (never IP/UA/fbc/fbp), event_id for dedup, LDU for opted-out US users. New: Meta's official Ads MCP server at mcp.facebook.com/ads.

Six Meta platform primitives

The Graph underneath; apps, tokens, and review to authorize; webhooks, Conversions API, and the Ads MCP server to ship.

Text
███╗   ███╗███████╗████████╗ █████╗     ██████╗ ███████╗██╗   ██╗
████╗ ████║██╔════╝╚══██╔══╝██╔══██╗    ██╔══██╗██╔════╝██║   ██║
██╔████╔██║█████╗     ██║   ███████║    ██║  ██║█████╗  ██║   ██║
██║╚██╔╝██║██╔══╝     ██║   ██╔══██║    ██║  ██║██╔══╝  ╚██╗ ██╔╝
██║ ╚═╝ ██║███████╗   ██║   ██║  ██║    ██████╔╝███████╗ ╚████╔╝
╚═╝     ╚═╝╚══════╝   ╚═╝   ╚═╝  ╚═╝    ╚═════╝ ╚══════╝  ╚═══╝

Meta for Developers Integration Guide

Focus — the whole Meta developer surface as one platform: Graph API fundamentals and versioning, app creation, the token/permission model, App Review + Business Verification, webhooks, Login, Instagram, Marketing API, Conversions API, the official Ads MCP server, and WhatsApp Flows / Embedded Signup — capped with a catalog of build ideas for the Kenyan community. WhatsApp messaging itself (sends, templates, pricing, messaging limits, Twilio-vs-Meta) lives in the focused whatsapp-business-api guide — this one only points there.

Overview

Meta for Developers is one platform behind one base URL — https://graph.facebook.com/{version}/{node-or-edge} (Instagram API with Instagram Login is the exception: graph.instagram.com). Six things to internalize before you write code:

  1. Everything is the Graph API. Nodes/edges/fields, versioning, error codes, and rate-limit headers — learn once, reuse for every product.
  2. Pin v26.0 (current, released 2026-07-29). Graph versions live ~2 years. Marketing API versions are different — 90-day grace, and unversioned Marketing API calls fail.
  3. Use cases are permanent. The modern app-creation flow attaches use cases; once added they cannot be removed. Pick carefully or create a second app.
  4. Tokens are a taxonomy. User tokens: 1–2 h (short) / ~60 days (long). System user tokens are the production credential for server automation. The App Secret never ships to a client.
  5. Webhook HMAC is the perimeter. X-Hub-Signature-256: sha256=<HMAC-SHA256(raw body, App Secret)>. Verify over raw bytes, constant-time; Meta retries failures for up to 36 hours, so dedupe.
  6. Going public = App Review + Business Verification. Anyone without a role on your app (or its business) needs approved permissions; Advanced Access requires Business Verification.

Official Documentation

Meta migrated most docs to developers.facebook.com/documentation/... (old /docs/... URLs redirect). Most pages have a View as Markdown link — append .md to the /documentation/ URL.

TopicURL
Docs indexhttps://developers.facebook.com/docs/
Graph APIhttps://developers.facebook.com/docs/graph-api/
Graph + Marketing versions tablehttps://developers.facebook.com/docs/graph-api/changelog/versions
v26.0 changeloghttps://developers.facebook.com/docs/graph-api/changelog/version26.0
Create an app (use cases)https://developers.facebook.com/documentation/development/create-an-app
Access tokenshttps://developers.facebook.com/docs/facebook-login/guides/access-tokens
Secure requests (appsecret_proof)https://developers.facebook.com/docs/graph-api/guides/secure-requests
Rate limitinghttps://developers.facebook.com/docs/graph-api/overview/rate-limiting/
Webhookshttps://developers.facebook.com/docs/graph-api/webhooks/getting-started
App Reviewhttps://developers.facebook.com/docs/resp-plat-initiatives/individual-processes/app-review
Business Verificationhttps://developers.facebook.com/docs/development/release/business-verification
Instagram Platformhttps://developers.facebook.com/docs/instagram-platform/overview
Marketing API versioninghttps://developers.facebook.com/documentation/ads-commerce/marketing-api/overview/versioning
Conversions APIhttps://developers.facebook.com/documentation/ads-commerce/conversions-api/get-started
Ads MCP serverhttps://developers.facebook.com/documentation/ads-commerce/ads-ai-connectors/ads-mcp-server/ads-mcp-server-get-started
WhatsApp Flowshttps://developers.facebook.com/docs/whatsapp/flows
Meta Business SDK (Node)https://github.com/facebook/facebook-nodejs-business-sdk

The platform map

FamilyProducts
CoreGraph API, App Dashboard, use cases, Webhooks
IdentityFacebook Login, Facebook Login for Business, Business Login for Instagram
SocialPages API, Instagram Platform, Threads API, Sharing
Business MessagingWhatsApp Business Platform (→ whatsapp-business-api), WhatsApp Flows, Embedded Signup, Messenger, Instagram Messaging
Ads & MeasurementMarketing API, Conversions API, Catalog, Ads MCP server + CLI ("ads AI connectors")
SDKsJS SDK, Android, iOS, Meta Business SDK (Node / Python / PHP / Java / Ruby)
AI modelsMoved off this site — see "Llama & Meta AI models" below

Versions & deprecation schedule

Source: versions table (checked 2026-10-20).

Graph APIReleasedExpires
v26.0 (current)2026-07-29TBD
v25.02026-02-182028-07-29
v24.02025-10-082028-02-18
v23.02025-05-292027-10-08
v22.02025-01-212027-05-20
v21.02024-10-022027-01-21 (next to go)
v20.02024-05-21expired 2026-09-24
  • Unversioned Graph calls resolve to the oldest version your app can use — a silent footgun. Always pin.
  • Marketing API: 90-day grace after each new version; deprecated-version calls are auto-upgraded only for endpoints the next version didn't change (watch the X-Ad-Api-Version-Warning header). Unversioned calls fail.
  • v26.0 breaking changes worth knowing (most also apply to all versions on 2026-10-27): Commerce Order Management API (47 endpoints) removed with no replacement; legacy protocol features gone (pretty/debug ignored, date_format errors, GET /?ids= errors, ETag/If-None-Match/304 removed); New-Pages-Experience Page fields current_location, genre, network, parking, start_info removed; Marketing API drops Instagram Explore placement, poll ads, and Messenger Stories placement, and HEC-F (housing/employment/credit & financial) ad sets must set an explicit targeting_automation.advantage_audience.

Setup — register, create an app, pick use cases

  1. Register at developers.facebook.com and open the App Dashboard.
  2. Create App → name + contact email → select use cases (incompatible ones grey out; use cases cannot be removed later, though compatible ones can be added). Legacy app types live under Other.
  3. Connect a business portfolio (required when the app accesses data you don't own/manage; you can do it any time during development).
  4. Note the App ID (public) and App Secret (server-only). In Settings → Advanced → Security turn on Require App Secret so every server call must carry appsecret_proof.
  5. Non-secret configuration (keep in config, not the vault):
SettingExampleSecret?
META_GRAPH_VERSIONv26.0No
META_APP_ID123456789012345No (public)
META_PIXEL_IDPixel / dataset IDNo
META_WEBHOOK_URLhttps://app.example.com/api/webhooks/metaNo

Real secrets (.env.local / Vercel env / Hazina only):

Bash
META_APP_SECRET=your-app-secret
META_SYSTEM_USER_TOKEN=EAAG...
META_VERIFY_TOKEN=random-long-string-you-choose
META_CAPI_ACCESS_TOKEN=EAAG...

Tokens & expiry

Source: Access Tokens for Meta Technologies (updated 2025-11-25). Meta warns lifetimes "may change without warning or expire early" — always handle error 190 (invalid/expired token).

TokenLifetimeUse
User (short-lived)~1–2 h (web login)Client reads after login
User (long-lived)~60 daysExchange server-side with the App Secret; mobile SDKs get these by default
Instagram User (Business Login for Instagram)1 h short → 60 days long, refreshablegraph.instagram.com calls
PageDerived from a user token (long-lived user → long-lived Page token)Act on a Page
App (client_credentials)Doesn't time-expireApp settings, webhook subscriptions — server-only
Client tokenn/a (not secret){app-id}|{client-token} for app-level calls from native apps
System userExpiry chosen at generation (can be non-expiring)Production server automation (Admin or Employee role)
Business integration tokenLongPer-customer token from Embedded Signup / Login for Business

Apps with Marketing API access and system users get long-lived tokens that don't time-expire but can still be invalidated (password change, permission revoke). Store tokens in a variable-length column — token length changes.

App Review, Business Verification, Data Use Checkup

GateWhen
App ReviewBefore anyone without a role on the app (or its business) can grant a permission / use a feature. Reviewers must be able to test every requested permission.
Business VerificationRequired for Advanced Access and for apps that let other businesses access their own data (since 2023-02-01). Done by a Business admin in Business Manager.
Data Use CheckupAnnual, for apps live with a use case or with Advanced Access; an app admin certifies compliant data use to keep API access.
Data deletionEvery app must provide a data-deletion callback URL or instructions URL (Settings → Basic).

Marketing API tier names changed in 2026: "Standard Access" → Limited Access, "Advanced Access" → Full Access; Full Access needs 500 calls in 15 days (was 1,500). Permission identifiers are unchanged.

Quickstart — a hardened Graph call (raw fetch, Node 20+)

The Graph API is plain HTTPS; fetch + appsecret_proof + a pinned version + the error envelope is all you need. Full file: examples/graph-api-call.ts.

TypeScript
import { createHmac } from "node:crypto";

const proof = createHmac("sha256", process.env.META_APP_SECRET!)
  .update(process.env.META_SYSTEM_USER_TOKEN!)
  .digest("hex");

const url = new URL("https://graph.facebook.com/v26.0/me");
url.searchParams.set("fields", "id,name");
url.searchParams.set("appsecret_proof", proof);

const res = await fetch(url, {
  headers: { Authorization: `Bearer ${process.env.META_SYSTEM_USER_TOKEN}` },
});

Meta Business SDK. Python facebook_business is at 26.0.2. The npm facebook-nodejs-business-sdk is still 24.0.1 (2025-11-21) even though the GitHub repo is tagged v26.0.2 — use it for typed Marketing API objects, raw fetch for everything else. The whatsapp npm SDK (0.0.5-Alpha, repo archived) is no longer recommended — call the Cloud API with fetch as in the whatsapp-business-api guide.

Key patterns

Webhooks — the universal push channel

One contract for Pages, Instagram, Messenger, WhatsApp, Leads, Ad Accounts, …

  • GET verification: echo hub.challenge iff hub.mode=subscribe and hub.verify_token matches.
  • POST delivery: verify X-Hub-Signature-256 over the raw bytes keyed by the App Secret with timingSafeEqual; ACK 200 fast, process async.
  • Batching & retries: up to 1,000 updates per batch (not guaranteed). Failed deliveries retry "immediately, then a few more times with decreasing frequency over the next 36 hours", then are dropped. Dedupe on event/message id.
  • Payloads are arrays — walk every entry[].changes[] (or entry[].messaging[] for Messenger/IG); [0]-only silently drops events.
  • Optional mTLS: trust meta-outbound-api-ca-2025-12.pem and check CN client.webhooks.fbclientcerts.com. The older DigiCert-signed cert expired 2026-04-15.

Typed Next.js App Router receiver: examples/webhook-router.ts.

Rate limits

Header / codeMeaning
X-App-Usagecall_count, total_time, total_cputime as % of the platform limit (200 × daily active users per rolling hour)
X-Business-Use-Case-UsagePer-BUC usage + estimated_time_to_regain_access (minutes) for Pages, IG, Ads, WhatsApp mgmt, …
4 / 17 / 32 / 613App / user / Pages / custom rate limit
80000–80014BUC throttles (80002 Instagram, 80004 Ads Management, 80006 Messenger, 80008 WhatsApp Business Management)
190Invalid / expired access token

Back off before any usage value reaches 100.

Instagram Platform — two configurations

Instagram LoginFacebook Login
Hostgraph.instagram.comgraph.facebook.com
Facebook PageNot requiredRequired (IG account linked to a Page)
Permissionsinstagram_business_basic, _content_publish, _manage_comments, _manage_messagesinstagram_basic, instagram_content_publish, instagram_manage_comments, instagram_manage_insights, instagram_manage_messages, pages_show_list, pages_read_engagement
Hashtag search, product tagging, partnership adsNoYes

Both require an Instagram professional (business/creator) account — the legacy Instagram Basic Display API is gone; don't build on it. Auth code valid 1 h; short-lived token 1 h; long-lived token 60 days (refresh before expiry). DM replies must fall inside the 24 h standard window (or the 7-day Human Agent window via the human_agent tag).

Conversions API (server-side events)

POST https://graph.facebook.com/v26.0/{PIXEL_ID}/events with a data array (≤ 1,000 events).

  • event_time is Unix seconds, ≤ 7 days old — one stale event fails the whole request (offline/store events: 62 days).
  • Send event_id on every event; a matching browser Pixel event with the same event_id + event_name is deduplicated (first copy wins).
  • Hash em, ph, fn, ln, db, ge, ct, st, zp, country with SHA-256 after normalizing (email: trim + lowercase; phone: digits with country code, no leading zeros). external_id hashing is recommended. Never hash client_ip_address, client_user_agent, fbc, fbp.
  • Token: Events Manager → Settings → Generate access token (no App Review needed).
  • test_event_code only while testing — remove in production.
  • US state privacy → Limited Data Use (below). Example: examples/conversions-api-event.ts.

Ads MCP server (official, beta)

Meta hosts an MCP server at https://mcp.facebook.com/ads ("ads AI connectors", alongside a CLI). Auth: OAuth via Facebook Login for Business (no app needed for the end-user path), a user access token, or an Employee-role system user token (Admin-role system user tokens are rejected). Minimum permissions: ads_mcp_management + ads_read (or ads_management).

Bash
# Claude Code, with your own Meta app (add the "Create & manage ads with ads MCP server" use case)
claude mcp add --transport http --client-id <META_APP_ID> meta-ads https://mcp.facebook.com/ads

Set a matching redirect URL in your app's Login for Business settings. Treat write scopes (ads_management) as spend authority — grant read-only for analysis agents.

WhatsApp Flows & Embedded Signup (owned here)

  • Flows render multi-screen native forms inside a WhatsApp chat. Static Flows post collected data to your webhook on complete; dynamic Flows add an encrypted data endpoint. Published Flows can only be deprecated. See examples/booking-flow.json (Flow JSON 7.3).
  • Embedded Signup — a Meta-hosted popup (Facebook Login for Business) that creates/links a customer's portfolio + WABA + number and returns a code your server exchanges for a per-customer business token.

For sending messages, templates, pricing, and messaging limits → whatsapp-business-api.

Llama & Meta AI models

Meta's model developer surface has moved off developers.facebook.com: llama.com/docs now redirects to dev.meta.ai, which lists the Meta Model API ("OpenAI SDK compatible") for the proprietary Muse model family (Muse Spark, etc.) and Muse Code — and no Llama API product and no public pricing. Third-party reports say Meta's hosted Llama API was retired in mid-2026; no Meta announcement was found, so treat that as unverified (see NOTES.md).

codeAmani stance (per AI_WORKFLOWS.md, Claude primary):

  • Open Llama weights (Llama 4 Scout/Maverick, Llama 3.x) remain available — use them via Hugging Face or a third-party host (see ../hugging-face/).
  • Don't build on the hosted Llama API (llama-api-client npm 0.3.0, last published 2025-10) — its future is unclear.
  • Muse / Meta Model API: out of scope until Meta publishes stable docs + pricing.

US privacy notes (codeAmani is US-first)

  • Conversions API / Pixel Limited Data Use (LDU). Send data_processing_options: ["LDU"] with country/state 0 (Meta geolocates) or explicit codes (California = country 1, state 1000). Send [] for users who haven't opted out. Wire it to your "Do Not Sell/Share" (CCPA/CPRA) state.
  • No sensitive data in events. Never put health, financial-account, or children's data into Pixel/CAPI events, URL params, or custom data (FTC Health Breach Notification Rule territory; HIPAA for covered entities — see the DoseVault rules in memory). Hash PII exactly as specified; hashing is not anonymization.
  • Special Ad Categories (HEC-F) — housing, employment, credit/financial ads have restricted targeting; v26.0 requires an explicit advantage_audience flag.
  • Platform obligations: privacy policy URL, data-deletion callback/instructions URL, annual Data Use Checkup, honor deletion requests; bot disclosure for automated chat is required by law in California (Instagram/Messenger policy).
  • Minimize retention. Webhook payloads can't be re-queried — store only what you need, encrypted at rest, with a deletion path keyed by user id / PSID / IGSID.

Build ideas for Kenyan businesses (Kenya-targeted projects only)

WhatsApp is the default channel in East Africa, so the highest-leverage builds pair a WhatsApp/Flows surface with M-Pesa (see MPESA_PATTERNS.md / daraja-api). Full catalog in reference/build-ideas-kenya.md:

  1. Duka order bot — catalog Flow → cart → M-Pesa STK Push → utility confirmation.
  2. Boda / delivery dispatch — inbound location → rider assignment → status templates.
  3. Clinic / salon booking — booking Flow → Neon → reminder templates.
  4. Sacco / chama assistant — balances, authentication-template OTPs, document statements.
  5. School fees & comms — fee-balance templates + paybill link + opt-out broadcasts.
  6. Agri price & advisory — daily price templates + a produce-listing Flow.

codeAmani notes

  • Secrets server-side only. App Secret, system user tokens, CAPI tokens, and Flow private keys never reach a client. .env.local / Vercel env / Hazina (see ENV_MASTER.md). Run gitleaks before any push.
  • Webhook verification is non-negotiable — HMAC-SHA256 over the raw body with timingSafeEqual, same discipline as Stripe/Clerk webhooks (SECURITY.md).
  • Always send appsecret_proof and enable Require App Secret — a leaked bare token is then useless.
  • Version hygiene. One config constant pinned to v26.0. v21.0 dies 2027-01-21; the protocol cleanup hits every version 2026-10-27 — grep for pretty, ids=, date_format, ETag usage.
  • Phone format. WhatsApp to and CAPI ph both use digits with country code, no + (254712345678, 15551234567). Daraja uses the same 254… shape; Twilio wants whatsapp:+… — normalize per API.
  • AI routing. The reply brain (Claude primary, AI_WORKFLOWS.md) runs in the async webhook worker, never in the 200-ACK path. Meta-hosted models are not a codeAmani routing target (see "Llama & Meta AI models").
  • Payments. US-first → Stripe (default rail). Meta's own on-platform checkout (Commerce Order Management) is gone as of v26. Kenya-targeted WhatsApp commerce → M-Pesa/Daraja.
  • Ads MCP for agents: read-only (ads_read) by default; spend authority (ads_management) only with explicit human approval.