Skip to content

WhatsApp

Jina Connect supports WhatsApp Business API through two BSP (Business Solution Provider) adapters:

BSPAdapterAPI
Meta DirectMetaDirectAdapterMeta Graph API v18+
GupshupGupshupAdapterGupshup Enterprise API
  1. Configure BSP credentials

    Set environment variables based on your BSP:

    WHATSAPP_ENABLED=True
    META_PERM_TOKEN=your-permanent-access-token
    META_APP_SECRET=your-app-secret
    META_WEBHOOK_VERIFY_TOKEN=your-verify-token
  2. Create a WhatsApp App via API or admin

    Terminal window
    curl -X POST http://localhost:8000/wa/v2/apps/ \
    -H "Authorization: Bearer <token>" \
    -H "Content-Type: application/json" \
    -d '{
    "name": "My WhatsApp App",
    "bsp": "META",
    "phone_number": "+1234567890",
    "waba_id": "your-waba-id"
    }'
  3. Register webhook URL with your BSP

    BSPWebhook URL
    Metahttps://your-domain.com/wa/v2/webhooks/meta/
    Gupshuphttps://your-domain.com/wa/v2/webhooks/gupshup/

WhatsApp requires pre-approved message templates for business-initiated conversations.

DRAFT → PENDING → APPROVED → (PAUSED/DISABLED)
→ REJECTED
→ FAILED
TypeDescription
TEXTPlain text message
IMAGEImage with optional caption
VIDEOVideo with optional caption
DOCUMENTDocument attachment
CAROUSELMulti-card carousel
CATALOGProduct catalog
PRODUCTSingle product
CategoryDescription
AUTHENTICATIONOTPs and verification codes
MARKETINGPromotional messages
UTILITYTransactional updates (order confirmations, shipping)
MethodEndpointDescription
GET/wa/v2/templates/List all templates
POST/wa/v2/templates/Create a new template
GET/wa/v2/templates/{id}/Get template details
PUT/wa/v2/templates/{id}/Update template
DELETE/wa/v2/templates/{id}/Delete template
Terminal window
# Send a template message
curl -X POST http://localhost:8000/wa/v2/messages/ \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"phone": "+1234567890",
"template_name": "order_update",
"template_params": {"1": "ORD-123", "2": "shipped"}
}'
PENDING → SENT → DELIVERED → READ
→ FAILED

Inbound messages and status updates arrive via webhooks:

Event TypeDescription
messageIncoming message from user
statusDelivery status update (sent, delivered, read, failed)
template_statusTemplate approval status change

Subscribe to webhook events programmatically:

Terminal window
curl -X POST http://localhost:8000/wa/v2/subscriptions/ \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "Order Status Webhook",
"webhook_url": "https://your-app.com/webhooks/wa",
"events": ["message", "status"]
}'