Messaging Overview

Core messaging endpoint, text messages, formatting, delivery statuses, and common errors.

The Cloud API /messages endpoint as you use it through Dualhook's runtime: the request shape for text messages, formatting and URL-preview rules, the sent → delivered → read status lifecycle, read receipts and typing indicators, and the error codes you will meet first. Message-path webhooks reach your server directly through Webhook Override, so this page pairs with the messaging webhook reference.

Core Endpoint

The main Cloud API messaging endpoint is:

POST https://api.dualhook.com/v25.0/<PHONE_NUMBER_ID>/messages

Use this endpoint for text messages, template messages, media messages, and interactive messages.

For the broader concept of free-form messages sent inside an open customer service window — types, CSW gating, contextual replies, media caching, TTL — see Service Messages.

Text Messages

Text messages are the default type for free-form conversation replies.

{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "+12015550123",
  "type": "text",
  "text": {
    "preview_url": false,
    "body": "Hello, world"
  }
}

Response:

{
  "messaging_product": "whatsapp",
  "contacts": [
    { "input": "12015550123", "wa_id": "12015550123" }
  ],
  "messages": [
    { "id": "wamid.HBgLMTIwMTU1NTAxMjMVAgARGBI..." }
  ]
}

Text Formatting

Text messages support basic formatting:

  • Bold: *text*
  • Italic: _text_
  • Strikethrough: ~text~
  • Monospace: triple backticks

Message body maximum length: 4096 characters.

URL Preview Behavior

URL previews are controlled using text.preview_url:

  • false (default) — no URL preview
  • true — preview can be generated for eligible links

The preview is generated for the first URL in the text. The URL must start with http:// or https://. Links to media files usually do not render rich previews.

WhatsApp builds the preview from the linked page's Open Graph tags, fetched with an HTTP GET whose User-Agent starts with WhatsApp/2.. The <head> must sit within the first 300 KB of the HTML, with non-empty og:title, og:description, and og:url tags. For a large preview, og:image should be under 600 KB, at least 300 px wide, and no wider than 4:1. Otherwise WhatsApp may fall back to a small preview or show none.

Delivery Status Lifecycle

Common outbound status progression:

  1. sent — message accepted by Meta
  2. delivered — message delivered to recipient device
  3. read — read receipt confirmed (if applicable)

Meta can skip delivered when a message is read straight away. A message that can't be sent or delivered gets failed with an errors array instead, and a voice message adds played the first time the recipient plays it.

These statuses arrive asynchronously through webhook callbacks to your endpoint.

Mark Message as Read

{
  "messaging_product": "whatsapp",
  "status": "read",
  "message_id": "wamid.HBgLMTIwMTU1NTAxMjMVAgARGBI..."
}
  • Use the id of a received message from the messages webhook. A successful request returns { "success": true }.
  • Mark a message as read within 30 days of receipt. Meta documents 131009 for an invalid message_id; a read receipt for an older message has also been seen to fail with a bare 100.
  • In a 1:1 chat, marking a message as read also marks earlier messages in that conversation as read. In a group, mark each message individually.

Typing Indicator

Show a typing indicator while preparing a response:

{
  "messaging_product": "whatsapp",
  "status": "read",
  "message_id": "wamid.HBgLMTIwMTU1NTAxMjMVAgARGBI...",
  "typing_indicator": {
    "type": "text"
  }
}
  • Requires a valid incoming message_id from the user.
  • The same request also marks that message as read.
  • Only works on the most recent incoming user message.
  • Indicator is dismissed when you reply or after 25 seconds, whichever comes first. Only show it if you are going to respond.
  • If preconditions are not met, the request may be ignored without an explicit API error.

Bulk Messaging

For bulk operations, use approved templates and strict opt-in hygiene. Large-volume sends should include rate control, retries, quality monitoring, and suppression for opt-outs and non-responsive users.

Common Messaging Errors

HTTPCodeMeaningRecommended action
400—Bad requestValidate JSON schema and required fields
401—UnauthorizedReplace or rotate the dh_live_... key, or contact support to restore the connection if Meta's underlying authorization expired
402—Payment requiredCheck Meta billing setup
470—Re-engagement neededSend approved template instead
4292001Rate limit hitThrottle sends and retry later
500—Internal errorRetry with backoff

Authenticate with the connection's dh_live_... key. For a full error reference, see Meta API Error Reference. Outbound payloads transit Dualhook without persistence; inbound message events still route via Webhook Override directly from Meta to your endpoint.

Dualhook Boundary

The Runtime API /messages route accepts text sends, read receipts, and typing indicators and passes them to Meta unchanged, with recipient_type: "individual" only. All three share the connection's limit of 80 requests per second (see Rate Limits). Dualhook does not generate link previews; WhatsApp builds them from your page's tags. There is no inbox or composer in the dashboard: send from your own backend, or reply in the WhatsApp Business app on a Coexistence number. Status webhooks go from Meta straight to your endpoint, and Dualhook does not read them.

Related

  • Service MessagesFree-form messages inside an open customer service window: types, replies, TTL, and October 2026 pricing with 1,000 free messages per number each month.
  • Messaging WebhookReal-time webhook events for inbound messages, delivery statuses, and errors.
  • Sending Template MessagesHow to send template messages via Cloud API with variables, media headers, and URL buttons.
  • Media MessagesSending and receiving images, video, audio, documents, and stickers via Cloud API.
Browse more docsStart Free Trial