Messaging service

WhatsApp

The WhatsApp integration connects a WhatsApp Business number via the Meta Cloud API — send text and template messages, receive inbound messages forwarded to your own webhook, and expose delivery-quality and messaging-limit metrics.

WhatsApp is one of the Messaging service integrations. It has a Dreambase webhook and an inbound route:

POST/whatsapp/webhook
Dreambase lifecycle — challenge, deployment, health, metrics, functions
POST/whatsapp/incoming
Inbound messages from Meta (with a GET verify handshake)

What it does

On DEPLOYMENT_CREATEDthe service verifies the credentials against the number's Graph API endpoint and publishes the connection details — accessToken, phoneNumberId, apiUrl, forwardUrl, and an incomingWebhookUrl — back to Dreambase as outputs. Register the incomingWebhookUrl as the Cloud API webhook callback (with your verify token) to receive inbound messages.

Inputs

FieldRequiredDescription
accessTokenyesCloud API access token. Supports {{env.MY_SECRET}}.
phoneNumberIdyesThe WhatsApp Business phone number ID.
forwardUrlyesWhere inbound messages are forwarded.
verifyTokennoToken to verify the inbound webhook with Meta (set the same value in Meta).
graphVersionnoMeta Graph API version (default v21.0).
forwardSecretnoBearer token sent on forwarded requests so your endpoint can verify the source.

Outputs

  • accessToken, phoneNumberId, apiUrl — for other services to send with.
  • forwardUrl, verifyToken — the inbound configuration.
  • incomingWebhookUrl — register this as the WhatsApp webhook callback in Meta.

Functions

  • sendMessage — send a text message (to, text).
  • sendTemplate — send a pre-approved template (to, template, optional language, components). Required to initiate conversations outside the 24-hour window.
  • markRead — mark an inbound message read (messageId).

Metrics

On METRIC_UPDATE the service reports quality_rating (GREEN=2, YELLOW=1, RED=0) and messaging_limit (business-initiated conversations per day), read from the number. Health checks probe GET /{phoneNumberId}.

Templates outside the 24-hour window

WhatsApp only allows free-form messages within 24 hours of the user's last message. To start a conversation, use sendTemplate with a pre-approved template.

Events it handles

  • WEBHOOK_CHALLENGE — verify the webhook endpoint.
  • HEALTH_CHECK — probe the number's Graph API endpoint.
  • METRIC_UPDATE — report quality and messaging-limit metrics.
  • DEPLOYMENT_CREATED — verify credentials and publish outputs.
  • DEPLOYMENT_DELETED — stop tracking the connection.
  • FUNCTION_CALL — run a named function.