Blog

Direct messaging API: read and send DMs across Instagram, Messenger, WhatsApp, LinkedIn (2026)

Erwan Prost

Erwan Prost

· 14 min read · Updated

A direct messaging API is a programmable interface that lets your application read inbound DMs and send outbound messages on behalf of an authenticated business account. In 2026, every major social platform exposes one (with the exception of TikTok, Threads, and YouTube, which do not offer a public DM API), and each one enforces its own 24-hour customer-service window, rate limits, message templates, and authentication model. SocialAPI.ai unifies Instagram, Facebook Messenger, LinkedIn, and X/Twitter DMs behind a single REST endpoint plus an MCP server, with WhatsApp routed through the same conversation model. The article below maps the official DM API for each platform, the rules that gate sending, and where a unified API saves engineering time.

What is a direct messaging API?

A direct messaging API exposes three core capabilities to a developer: list conversations on a connected business account, list messages inside a conversation, and send a new message into that conversation. Every platform layers extra rules on top (24-hour reply windows, template requirements, automation caps), but the data model is consistent across Instagram, Messenger, WhatsApp, LinkedIn, and X. As of Q2 2025, 94.1% of internet users worldwide accessed online chatting or messaging apps monthly (Statista, 2025), which is why every product team that handles inbound customer messages eventually needs a DM API.

The business case is straightforward. 73.3% of consumers across 22 markets prefer messaging when communicating with a business (Meta / Kantar study of 11,000+ consumers, August 2025), and 73% of social media users will buy from a competitor if a brand fails to respond on social (Sprout Social 2025 Index). A DM API is what lets an application read those inbound messages and reply programmatically (manually through an inbox UI, or automatically through an AI agent or chatbot) at the speed customers now expect.

Which platforms have a direct messaging API in 2026?

Five major platforms expose a public direct messaging API: Instagram, Facebook Messenger, WhatsApp Business Platform, X/Twitter, and (with partner approval) LinkedIn. TikTok, Threads, and YouTube do not. The capability matrix below summarises what each platform allows.

PlatformDM readDM sendAccess requirementReply window
InstagramYesYesBusiness/Creator + IG Messaging API24h standard, 7d with Human Agent tag
Facebook MessengerYesYesPage + Messenger Platform app review24h standard, 7d with Human Agent tag
WhatsApp Business PlatformYesYesCloud API or BSP, phone number verification24h service window (per-message pricing outside)
X / TwitterYesYesX API Pro or Enterprise tierNo window (rate limits apply)
LinkedInYesYesPages Messaging API, partner approval requiredNo window (CRM-style use only)
TikTokNoNoNot available via APIn/a
ThreadsNoNoNot available via APIn/a
YouTubeNoNoNot available via APIn/a

The official documentation for each DM API is linked in the sources block at the bottom of this article. The pattern that shows up across platforms: read endpoints are usually open to any approved app, but send endpoints require additional review (Meta's app review for Instagram and Messenger, LinkedIn's partner program, X's paid API tier). Budget at least one to two weeks for app review on Meta platforms if you are starting from scratch.

Customer response-time expectations driving DM API adoption (2025)
Expect reply <24h (Sprout)73%
Prefer messaging brands (Meta)73%
Expect faster than last year (Zendesk)88%
Will buy from competitor if ignored (Sprout)73%

Three independent 2025 studies converge on the same conclusion: customers expect fast, conversational responses from businesses. Sources: Sprout Social 2025 Index, Meta/Kantar 2025, Zendesk CX Trends 2025.

How does the Instagram DM API work?

The Instagram Messaging API is part of the Meta Graph API and is available to Instagram Business and Creator accounts (Meta developer docs). After OAuth login with the instagram_business_manage_messages permission, your app receives webhooks for inbound DMs and can call POST endpoints to send replies. Send-message access requires Meta App Review (Advanced Access on the messaging permission), which typically takes 5 to 10 business days. Automated message volume is capped at 200 messages per hour per account, and only one automated message per user per trigger event is allowed.

The 24-hour standard messaging window is the rule that catches most teams. Once an Instagram user sends your business account a DM, you have 24 hours to reply without restrictions. After 24 hours, a regular reply will be rejected by the API. The Human Agent tag extends that window to 7 days, but only for cases that require a human (the tag is audited by Meta and can be revoked if misused). Outside both windows, the only way to re-engage is a Sponsored Message ad. Build your reply scheduling around the inbound timestamp, not your business hours.

How does the Messenger Send API work?

Facebook Messenger uses the Send API on the Messenger Platform, attached to a Facebook Page and approved via Meta App Review (Messenger Platform Policy Overview). The data model is identical to Instagram (conversations contain messages, messages have an author and a payload), and the 24-hour window plus Human Agent tag rules apply the same way. The one capability Messenger adds that Instagram does not: message tags. CONFIRMED_EVENT_UPDATE, POST_PURCHASE_UPDATE, and ACCOUNT_UPDATE let a business send non-promotional 1:1 updates outside the 24-hour window without paying for an ad.

Practically, this means an e-commerce app can confirm an order or send a shipping update over Messenger to a customer who messaged the brand three weeks ago. Marketing messages (a promo blast, a re-engagement campaign) still require the user to opt in inside an active 24-hour window. Facebook Messenger reaches 942 million users in advertising audiences worldwide (Statista, 2025), so for B2C apps in North America, Europe, and Southeast Asia it remains a primary support channel alongside Instagram.

How does the WhatsApp Business Platform API work?

WhatsApp Business Platform is Meta's transactional messaging API for businesses, separate from the consumer WhatsApp app (Meta docs). It runs in two flavors: the Cloud API, hosted by Meta, and the on-premises Business API hosted by the business or a BSP (Business Solution Provider). WhatsApp now reaches 3 billion monthly active users (Statista, October 2025), which makes it the default messaging channel in India, Brazil, Indonesia, Mexico, and most of Europe. Access requires a verified Meta Business account, a dedicated phone number, and (for production volume) graduation through Meta's messaging tier system.

Pricing changed materially on July 1, 2025: Meta moved from Conversation-Based Pricing to Per-Message Pricing for business-initiated template messages, with four categories (Marketing, Utility, Authentication, Authentication-International). Utility messages are free when sent inside an open 24-hour service window, and conversations initiated via Click-to-WhatsApp ads or Facebook Page CTA buttons get a 72-hour free window including template messages (Meta WhatsApp pricing docs). Rates vary by country and change frequently, so always link to Meta's pricing page rather than hard-coding numbers in a quote.

Why use a unified direct messaging API instead of four native APIs?

If your product needs DMs on a single platform, the native API is the right call. The economics flip once you need two or more, which is the common case for customer-support tools, agency dashboards, AI agents, and CRMs. A unified direct messaging API (part of a broader unified social inbox API) replaces four OAuth implementations, four webhook handlers, four sets of rate-limit logic, four message-window timers, and four schemas with one. That is roughly two to four engineer-weeks of integration work per platform on the native path, plus ongoing maintenance every time Meta or X ships a breaking change.

The global messaging application API market was USD 46.75 billion in 2024 and is projected to grow at 18.9% CAGR through 2030 (Grand View Research, 2025), which is why a handful of unified inbox APIs (SocialAPI.ai, Sendbird, Unipile, Trengo, and a few others) exist. The trade-off is real: unified APIs lag native APIs on bleeding-edge features by weeks or months, and they cost more per seat than the underlying platform fees. For most B2B SaaS products, the time saved on integration and maintenance pays for the markup within the first quarter.

How SocialAPI.ai handles direct messages across platforms

SocialAPI.ai exposes a unified direct messaging API under /v1/inbox/conversations, with the same response shape across Instagram, Facebook Messenger, LinkedIn, and X. Every conversation has a stable ID prefixed with sapi_dm_, every message inside a conversation has a sender, a payload, and a platform-native timestamp. Send a message with POST /v1/inbox/conversations/:id/messages, list conversations with GET /v1/inbox/conversations, fetch a conversation's message history with GET /v1/inbox/conversations/:id/messages. The full inbox guide documents every endpoint and the per-platform capability matrix.

bash
# List DM conversations across all connected accounts
curl https://api.social-api.ai/v1/inbox/conversations \
  -H "Authorization: Bearer $SOCAPI_KEY"

# Send a DM in a conversation (works for Instagram, Messenger, LinkedIn, X)
curl -X POST https://api.social-api.ai/v1/inbox/conversations/sapi_dm_aW5zdGE.../messages \
  -H "Authorization: Bearer $SOCAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "text": "Your order has shipped!" }'

SocialAPI.ai never stores DM content in its database. Every inbox call proxies live data from the underlying platform API, so the conversation state you read is always current. OAuth tokens for connected accounts are encrypted at rest (AES-256-GCM), and the API enforces each platform's 24-hour window automatically: if you try to send a regular reply outside Instagram's or Messenger's window, the call fails fast with a structured error code rather than a cryptic Meta response. Webhooks (HMAC-verified) fire on every new inbound DM, so an AI agent or autoresponder can react within seconds rather than poll.

For AI-agent use cases, SocialAPI.ai's MCP server exposes the DM endpoints as native MCP tools (send_dm, list_conversations, get_conversation, mark_conversation_read). 85% of customer service leaders said they would explore or pilot customer-facing conversational generative AI in 2025 (Gartner, December 2024), and Gartner predicts agentic AI will autonomously resolve 80% of common customer service issues by 2029 (Gartner, March 2025). The MCP layer is what lets that agent act on social DMs without per-platform OAuth glue.

How much does a direct messaging API cost?

Platform-native APIs are mostly free at the application layer, with platform-specific costs layered on top. Instagram and Messenger have no API access fee; you pay only for ads if you want to reach users outside the 24-hour window. WhatsApp Business Platform charges per template message (Marketing, Utility, Authentication, Authentication-International) on a country-by-country basis, with utility messages free inside an open service window since July 2025. X requires a paid Pro or Enterprise tier to access the DM API. LinkedIn's Pages Messaging API is partner-only with negotiated pricing.

Unified DM APIs charge a subscription on top of those platform costs. SocialAPI.ai's free tier includes 2 brands, 10 posts per month, 50 interactions per month, and full MCP access, which is enough for a developer to wire up and test a DM integration end-to-end. Paid tiers price by brand (starter at 10 brands, pro at 50 brands, business at 200 brands, enterprise unlimited) with unlimited posts and interactions, so you scale by adding social accounts rather than per-message. See plans and pricing for the full breakdown. Compared to running four native integrations, the cost of a unified API is typically less than one engineer-day per month at the starter tier.

What are the main limits and gotchas of DM APIs?

  • 24-hour window enforcement is silent until it bites. Instagram and Messenger return a generic error after 24 hours; build a window timer on inbound timestamps so your UI can grey out the reply button or warn the user before they hit send.
  • Human Agent tag is audited. The 7-day extension on Instagram and Messenger is a privilege, not a right. Meta logs every use of the tag and can revoke it if your app uses it for promotions or automated replies. Reserve it for cases that genuinely need a human.
  • WhatsApp template approval is slow. New marketing or utility templates go through Meta review (24 to 72 hours, sometimes longer). Pre-approve templates for every customer flow you ship; don't wait until you need them.
  • LinkedIn DM access is gated. The Pages Messaging API is partner-only. Plan a 4 to 12 week onboarding with LinkedIn's partner team if you need it, and have a fallback for prospects who only respond on LinkedIn.
  • X DM API costs scale fast. X API Pro at $200/mo gives limited DM volume; Enterprise pricing starts in the low five figures per month. If X DMs are not core to your product, treat it as a nice-to-have.
  • TikTok, Threads, YouTube have no DM API. If your customers expect to message you there, the only options are (a) the platform's native inbox UI, (b) a comments-based workaround, or (c) waiting for the platform to ship one. Threads launched in-app DMs in July 2025 (Meta) but has not added an API endpoint as of May 2026.

Frequently asked questions

Is there a direct messaging API for Instagram?
Yes. The Instagram Messaging API is part of the Meta Graph API and is available to Instagram Business and Creator accounts. After OAuth login with the instagram_business_manage_messages permission and Meta App Review, you can list conversations, send replies inside a 24-hour standard window, and use the Human Agent tag for up to 7 days. Automated message volume is capped at 200 per hour per account. SocialAPI.ai wraps this API so you don't have to manage the Meta OAuth and app review flow yourself.
Can I send WhatsApp messages through an API?
Yes, through the WhatsApp Business Platform (Cloud API or on-premises Business API). You need a verified Meta Business account, a dedicated phone number, and Meta-approved message templates for outbound business-initiated messages. Pricing moved to Per-Message Pricing in July 2025 across four categories (Marketing, Utility, Authentication, Authentication-International), with utility messages free inside an open 24-hour service window. Conversations from Click-to-WhatsApp ads get a 72-hour free window.
Does LinkedIn have a direct messaging API?
Yes, but access is restricted. LinkedIn's Pages Messaging API is partner-only and requires approval through LinkedIn's partner program. There is no public DM API for personal accounts; the messaging endpoints are intended for CRM and customer-engagement use cases tied to LinkedIn Pages. Onboarding through the partner program typically takes 4 to 12 weeks. SocialAPI.ai handles LinkedIn DMs for approved partners under the same unified inbox endpoint as Instagram and Messenger.
What is the 24-hour messaging window?
On Instagram and Facebook Messenger, a business has 24 hours to reply to a user after the user's last inbound message. Each new inbound message resets the timer. Outside the window, regular replies are rejected by the API. The Human Agent tag extends the window to 7 days for cases that require a human, and Messenger-only message tags (CONFIRMED_EVENT_UPDATE, POST_PURCHASE_UPDATE, ACCOUNT_UPDATE) allow non-promotional updates outside the window. WhatsApp has a similar 24-hour service window with its own pricing rules.
Can AI agents send and read DMs?
Yes, through the same APIs a human inbox would use, provided the developer has approval from each platform. SocialAPI.ai exposes DM endpoints as native MCP tools so AI agents on Claude, GPT, or any MCP-compatible client can list conversations, read messages, and send replies through one server. Gartner predicts agentic AI will autonomously resolve 80% of common customer service issues by 2029, and 85% of customer service leaders said they would explore or pilot conversational GenAI in 2025.
Is there a free direct messaging API?
Yes, at multiple levels. Instagram, Messenger, and LinkedIn DM APIs have no per-message platform fee (you pay only for app review time and any ads). WhatsApp Business Platform offers free service-window and utility messages plus free conversations from Click-to-WhatsApp ads. SocialAPI.ai's free tier includes 2 brands, 10 posts per month, 50 interactions per month, and full MCP access, which covers a developer's prototyping and a small-volume production use case at zero cost.

Ready to build on a unified direct messaging API? Read the unified inbox guide, see the API reference, or sign up free and get an API key with MCP access and DM endpoints included.

Get started today

Ready to unify your social interactions?

Free tier available · No credit card required · Ships with MCP server