Meta for Developers Integration Guide

Technology: meta-developers · Category: comms · Last reviewed: 2026-10-20

Source: https://tech-stack.codeamanilabs.org/guide/meta-developers

Insight:

Everything Meta lets you build — WhatsApp, Messenger, Instagram, Login, Marketing, Conversions API, and now the Ads MCP server — is one Graph API (graph.facebook.com/v26.0) wearing different hats. Learn the fundamentals once (nodes/edges, the token taxonomy, App Review + Business Verification, webhook HMAC over raw bytes) and every product is familiar. Meta's docs moved to developers.facebook.com/documentation/... with .md views — good for agent grounding. For codeAmani's US-first work the high-value surfaces are Login, Instagram, and Conversions API (with US state privacy flags); for Kenya-targeted projects it's WhatsApp + Flows paired with M-Pesa.

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

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.

Topic URL
Docs index https://developers.facebook.com/docs/
Graph API https://developers.facebook.com/docs/graph-api/
Graph + Marketing versions table https://developers.facebook.com/docs/graph-api/changelog/versions
v26.0 changelog https://developers.facebook.com/docs/graph-api/changelog/version26.0
Create an app (use cases) https://developers.facebook.com/documentation/development/create-an-app
Access tokens https://developers.facebook.com/docs/facebook-login/guides/access-tokens
Secure requests (appsecret_proof) https://developers.facebook.com/docs/graph-api/guides/secure-requests
Rate limiting https://developers.facebook.com/docs/graph-api/overview/rate-limiting/
Webhooks https://developers.facebook.com/docs/graph-api/webhooks/getting-started
App Review https://developers.facebook.com/docs/resp-plat-initiatives/individual-processes/app-review
Business Verification https://developers.facebook.com/docs/development/release/business-verification
Instagram Platform https://developers.facebook.com/docs/instagram-platform/overview
Marketing API versioning https://developers.facebook.com/documentation/ads-commerce/marketing-api/overview/versioning
Conversions API https://developers.facebook.com/documentation/ads-commerce/conversions-api/get-started
Ads MCP server https://developers.facebook.com/documentation/ads-commerce/ads-ai-connectors/ads-mcp-server/ads-mcp-server-get-started
WhatsApp Flows https://developers.facebook.com/docs/whatsapp/flows
Meta Business SDK (Node) https://github.com/facebook/facebook-nodejs-business-sdk

The platform map

Family Products
Core Graph API, App Dashboard, use cases, Webhooks
Identity Facebook Login, Facebook Login for Business, Business Login for Instagram
Social Pages API, Instagram Platform, Threads API, Sharing
Business Messaging WhatsApp Business Platform (→ whatsapp-business-api), WhatsApp Flows, Embedded Signup, Messenger, Instagram Messaging
Ads & Measurement Marketing API, Conversions API, Catalog, Ads MCP server + CLI ("ads AI connectors")
SDKs JS SDK, Android, iOS, Meta Business SDK (Node / Python / PHP / Java / Ruby)
AI models Moved off this site — see "Llama & Meta AI models" below

Versions & deprecation schedule

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

Graph API Released Expires
v26.0 (current) 2026-07-29 TBD
v25.0 2026-02-18 2028-07-29
v24.0 2025-10-08 2028-02-18
v23.0 2025-05-29 2027-10-08
v22.0 2025-01-21 2027-05-20
v21.0 2024-10-02 2027-01-21 (next to go)
v20.0 2024-05-21 expired 2026-09-24

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):
Setting Example Secret?
META_GRAPH_VERSION v26.0 No
META_APP_ID 123456789012345 No (public)
META_PIXEL_ID Pixel / dataset ID No
META_WEBHOOK_URL https://app.example.com/api/webhooks/meta No

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

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).

Token Lifetime Use
User (short-lived) ~1–2 h (web login) Client reads after login
User (long-lived) ~60 days Exchange server-side with the App Secret; mobile SDKs get these by default
Instagram User (Business Login for Instagram) 1 h short → 60 days long, refreshable graph.instagram.com calls
Page Derived from a user token (long-lived user → long-lived Page token) Act on a Page
App (client_credentials) Doesn't time-expire App settings, webhook subscriptions — server-only
Client token n/a (not secret) {app-id}|{client-token} for app-level calls from native apps
System user Expiry chosen at generation (can be non-expiring) Production server automation (Admin or Employee role)
Business integration token Long Per-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

Gate When
App Review Before 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 Verification Required 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 Checkup Annual, for apps live with a use case or with Advanced Access; an app admin certifies compliant data use to keep API access.
Data deletion Every 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.

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, …

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

Rate limits

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

Back off before any usage value reaches 100.

Instagram Platform — two configurations

Instagram Login Facebook Login
Host graph.instagram.com graph.facebook.com
Facebook Page Not required Required (IG account linked to a Page)
Permissions instagram_business_basic, _content_publish, _manage_comments, _manage_messages instagram_basic, instagram_content_publish, instagram_manage_comments, instagram_manage_insights, instagram_manage_messages, pages_show_list, pages_read_engagement
Hashtag search, product tagging, partnership ads No Yes

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).

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).

# 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)

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):

US privacy notes (codeAmani is US-first)

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

Official docs: