Whats91
Developers

Webhook management requests, responses, and event payload samples for common Whats91 webhook flows.

Webhook Samples

Summary

Webhook management requests, responses, and event payload samples for common Whats91 webhook flows.

Prerequisites

  • A Whats91 account
  • A generated public API token

Use these samples when wiring the management API and building receivers for Whats91 event deliveries.

List Webhooks

Endpoint: GET /api/v2/webhooks. Optional query parameters are senderId, status, event, page, and limit.

List active webhooks
curl -X GET "https://graph.whats91.com/api/v2/webhooks?senderId=916268662275&status=ACTIVE&event=message.inbound.text" \
  -H "Authorization: Bearer w91_public_token_here"
List response
{
  "success": true,
  "message": "Webhooks retrieved",
  "data": [
    {
      "webhookUid": "wh_abc",
      "name": "CRM delivery hook",
      "endpointUrl": "https://crm.example.com/webhooks/whats91",
      "events": ["message.inbound.text", "message.status.delivered"],
      "status": "ACTIVE",
      "retryEnabled": true,
      "retryMaxAttempts": 3,
      "hasVerificationToken": true
    }
  ],
  "metadata": {
    "apiVersion": "v2",
    "requestId": "request-uuid"
  }
}

Get One Webhook

Endpoint: GET /api/v2/webhooks/:webhookUid. Use the existing uid returned as webhookUid.

Get webhook
curl -X GET "https://graph.whats91.com/api/v2/webhooks/wh_abc?senderId=916268662275" \
  -H "Authorization: Bearer w91_public_token_here"

Update Webhook

Endpoint: POST /api/v2/webhooks/:webhookUid. Updates use POST so integrations only need GET and POST.

Disable webhook
curl -X POST "https://graph.whats91.com/api/v2/webhooks/wh_abc" \
  -H "Authorization: Bearer w91_public_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "senderId": "916268662275",
    "webhook": {
      "status": "INACTIVE",
      "retryEnabled": false
    }
  }'
Update verification token
{
  "webhook": {
    "verificationToken": "new-shared-secret"
  }
}
Clear verification token
{
  "webhook": {
    "clearVerificationToken": true
  }
}

Updating a webhook does not rotate the signing secret. Create a new webhook if you need a fresh signing secret.

Event Payload Samples

Event keyUse it forTypical consumer
message.inbound.textIncoming text messages from customers.CRM, support inbox, chatbot.
message.status.deliveredDelivery confirmation for sent messages.Order timeline, campaign reports.
message.status.failedDelivery failure tracking.Alerting and retry workflows.
template.status_updateTemplate review status changes.Template operations dashboard.
Inbound text payload
{
  "event": "message.inbound.text",
  "webhookUid": "wh_abc",
  "senderId": "916268662275",
  "data": {
    "from": "919888888888",
    "messageId": "wamid.HBgMOTE5...",
    "text": "I need help with my order",
    "timestamp": "2026-06-05T10:30:00.000Z"
  }
}
Delivered status payload
{
  "event": "message.status.delivered",
  "webhookUid": "wh_abc",
  "senderId": "916268662275",
  "data": {
    "messageId": "wamid.HBgMOTE5...",
    "recipient": "919888888888",
    "status": "delivered",
    "timestamp": "2026-06-05T10:31:00.000Z"
  }
}
Failed status payload
{
  "event": "message.status.failed",
  "webhookUid": "wh_abc",
  "senderId": "916268662275",
  "data": {
    "messageId": "wamid.HBgMOTE5...",
    "recipient": "919888888888",
    "status": "failed",
    "error": {
      "code": "131026",
      "message": "Message undeliverable"
    }
  }
}
Template status payload
{
  "event": "template.status_update",
  "webhookUid": "wh_abc",
  "senderId": "916268662275",
  "data": {
    "templateName": "payment_reminder_v1",
    "category": "UTILITY",
    "language": "en",
    "status": "APPROVED"
  }
}

Error Samples

Missing token error
{
  "success": false,
  "message": "Missing authorization token",
  "error_code": "MISSING_AUTH_TOKEN",
  "metadata": {
    "apiVersion": "v2",
    "requestId": "request-uuid"
  }
}
Validation error
{
  "success": false,
  "message": "Unsupported webhook event: message.invalid",
  "error_code": "VALIDATION_FAILED",
  "details": {},
  "metadata": {
    "apiVersion": "v2",
    "requestId": "request-uuid"
  }
}

Related Documentation